]> jfr.im git - z_archive/twitter.git/blobdiff - twitter/ircbot.py
Explicitly utf8 decode strings coming from Twitter.
[z_archive/twitter.git] / twitter / ircbot.py
index 1ea68237946caa973157813ad6926f491188f0bc..bfac05086445e1257275d68f7a07a811c46bce2a 100644 (file)
@@ -266,10 +266,14 @@ class TwitterBot(object):
                 pass
 
 def load_config(filename):
-    defaults = dict(
-        server=dict(port=6667, nick="twitterbot"),
-        twitter=dict(oauth_token_file=OAUTH_FILE))
-    cp = SafeConfigParser(defaults)
+    # Note: Python ConfigParser module has the worst interface in the
+    # world. Mega gross.
+    cp = SafeConfigParser()
+    cp.add_section('irc')
+    cp.set('irc', 'port', '6667')
+    cp.set('irc', 'nick', 'twitterbot')
+    cp.add_section('twitter')
+    cp.set('twitter', 'oauth_token_file', OAUTH_FILE)
     cp.read((filename,))
 
     # attempt to read these properties-- they are required