diff --git a/mytwitter.py b/mytwitter.py index bb175b3..ae674d0 100755 --- a/mytwitter.py +++ b/mytwitter.py @@ -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()