Replaced hard-coded username and password with code to read from a config file. And yes, I've already changed the password. Bah.

This commit is contained in:
Anna 2010-04-07 13:17:21 -04:00
parent b74b992ad7
commit 50d23fee0f

View File

@ -2,7 +2,7 @@
#
# Custom twitter client... mostly for learning Python
import sys, twitter, Tkinter, Pmw
import sys, twitter, Tkinter, Pmw, ConfigParser, os
class TwitWindow:
@ -10,8 +10,10 @@ class TwitWindow:
""" Display Tweets, post to twitter """
def __init__(self):
self.username = "gjalfr"
self.password = "fun4cabbage"
config = ConfigParser.ConfigParser()
config.read(os.path.expanduser("~/.mytwitter"))
self.username = config.get('global', 'username')
self.password = config.get('global', 'password')
self.num_entries = 10
self.labels = []