Set up shelve module so that we can persist some UI info
This commit is contained in:
parent
6bde20333f
commit
c9317af7e8
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# Custom twitter client... mostly for learning Python
|
||||
|
||||
import sys, ConfigParser, os, re, optparse
|
||||
import sys, ConfigParser, os, re, optparse, shelve
|
||||
import twitter
|
||||
import gtk, gtk.glade, gobject
|
||||
from urllib2 import HTTPError
|
||||
|
@ -18,10 +18,12 @@ class MyTwitter():
|
|||
config.read(os.path.expanduser(config_file))
|
||||
self.username = config.get('global', 'username')
|
||||
self.password = config.get('global', 'password')
|
||||
|
||||
self.num_entries = int(config.get('global', 'entries'))
|
||||
|
||||
self.refresh_time = int(config.get('global', 'refreshtime'))
|
||||
|
||||
db_file = os.path.expanduser(config.get('global', 'dbfile'))
|
||||
self.db = shelve.open(db_file)
|
||||
|
||||
if self.refresh_time < 10:
|
||||
self.refresh_time = 10
|
||||
|
||||
|
@ -135,6 +137,7 @@ class MyTwitter():
|
|||
|
||||
|
||||
def gtk_main_quit(self, widget):
|
||||
self.db.close()
|
||||
gtk.main_quit()
|
||||
|
||||
|
||||
|
|
Reference in New Issue
Block a user