config file can now be read in with a command-line option

This commit is contained in:
Anna 2010-04-15 00:05:49 -04:00
parent 7670ba9e6b
commit 7d997b16f0

View File

@ -2,7 +2,7 @@
#
# Custom twitter client... mostly for learning Python
import sys, ConfigParser, os, re
import sys, ConfigParser, os, re, optparse
import twitter
import gtk, gtk.glade, gobject
from urllib2 import HTTPError
@ -269,8 +269,9 @@ class MyTwitter():
# main
config_file = "~/.mytwitter"
parser = optparse.OptionParser()
parser.add_option('-c' ,'--config', dest="filename", default="~/.mytwitter")
(options, args) = parser.parse_args()
my_twitter = MyTwitter(config_file)
my_twitter = MyTwitter(options.filename)
gtk.main()