]> jfr.im git - z_archive/twitter.git/blobdiff - twitter/ircbot.py
Transition from httplib to urllib2.
[z_archive/twitter.git] / twitter / ircbot.py
index fb14c111297be5bff2c0a1f5f81a1cea46df6b95..e882ba7433206eaef42e5151075fcb47cf0582ba 100644 (file)
@@ -26,7 +26,7 @@ password: <twitter_account_password>
   If no config file is given "twitterbot.ini" will be used by default.
 """
 
-BOT_VERSION = "TwitterBot 0.5.1 (http://mike.verdone.ca/twitter)"
+BOT_VERSION = "TwitterBot 1.0 (http://mike.verdone.ca/twitter)"
 
 IRC_BOLD = chr(0x02)
 IRC_ITALIC = chr(0x16)
@@ -241,11 +241,12 @@ def load_config(filename):
     cp.read((filename,))
     
     # attempt to read these properties-- they are required
-    self.config.get('twitter', 'email'),
-    self.config.get('twitter', 'password')
-    self.config.get('irc', 'server')
-    self.config.getint('irc', 'port')
-    self.config.get('irc', 'nick')
+    cp.get('twitter', 'email'),
+    cp.get('twitter', 'password')
+    cp.get('irc', 'server')
+    cp.getint('irc', 'port')
+    cp.get('irc', 'nick')
+    cp.get('irc', 'channel')
 
     return cp
 
@@ -269,10 +270,11 @@ def main():
         if not os.path.exists(configFilename):
             raise Exception()
         load_config(configFilename)
-    except:
+    except Exception, e:
         print >> sys.stderr, "Error while loading ini file %s" %(
             configFilename)
-        print __doc__
+        print >> sys.stderr, e
+        print >> sys.stderr, __doc__
         sys.exit(1)
 
     bot = TwitterBot(configFilename)