config file can now be read in with a command-line option
This commit is contained in:
parent
7670ba9e6b
commit
7d997b16f0
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# Custom twitter client... mostly for learning Python
|
# Custom twitter client... mostly for learning Python
|
||||||
|
|
||||||
import sys, ConfigParser, os, re
|
import sys, ConfigParser, os, re, optparse
|
||||||
import twitter
|
import twitter
|
||||||
import gtk, gtk.glade, gobject
|
import gtk, gtk.glade, gobject
|
||||||
from urllib2 import HTTPError
|
from urllib2 import HTTPError
|
||||||
|
@ -269,8 +269,9 @@ class MyTwitter():
|
||||||
|
|
||||||
|
|
||||||
# main
|
# main
|
||||||
config_file = "~/.mytwitter"
|
parser = optparse.OptionParser()
|
||||||
|
parser.add_option('-c' ,'--config', dest="filename", default="~/.mytwitter")
|
||||||
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
my_twitter = MyTwitter(options.filename)
|
||||||
my_twitter = MyTwitter(config_file)
|
|
||||||
gtk.main()
|
gtk.main()
|
||||||
|
|
Reference in New Issue
Block a user