gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r202280 - in /gump/branches/Gump3/pygump/python/gump: config.py plugins/irc.py
Date Tue, 28 Jun 2005 20:30:08 GMT
Author: ajack
Date: Tue Jun 28 13:30:07 2005
New Revision: 202280

URL: http://svn.apache.org/viewcvs?rev=202280&view=rev
Log:
Don't try to swallow ImportError's and such. Since --irc
is optional, be strict and fail early/fail hard.

Note to self ... less is more. ;-)

Modified:
    gump/branches/Gump3/pygump/python/gump/config.py
    gump/branches/Gump3/pygump/python/gump/plugins/irc.py

Modified: gump/branches/Gump3/pygump/python/gump/config.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/config.py?rev=202280&r1=202279&r2=202280&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/config.py (original)
+++ gump/branches/Gump3/pygump/python/gump/config.py Tue Jun 28 13:30:07 2005
@@ -144,15 +144,16 @@
      
            
     if config.irc:        
-        # Parse here, allowing input errors to be thrown
-        from gump.plugins.irc import parseAddressInfo
+        # Since one does not need to put --irc onto the command line,
+        # bew pretty strict. Fail if there config is in error, or if
+        # IRCLIB is not available.
+        from gump.plugins.irc import parseAddressInfo, IrcBotPlugin
+        
+        # Parse the input format to extract addressing
         (channel,nickname,server,port)=parseAddressInfo(config.irc)
-        try:      
-            # Load here, ignoring if libirc not present
-            from gump.plugins.irc import IrcBotPlugin      
-            plugins.append(IrcBotPlugin(log,config.debug,channel,nickname,server,port))
-        except Exception,details:
-            log.warn('Failed to load IRC bot for %s: %s' % (config.irc, details), exc_info=1)
+        
+        # Add the plugin, based upon this configuration information.
+        plugins.append(IrcBotPlugin(log,config.debug,channel,nickname,server,port))
         
     plugins.append(TimerPlugin("work_end"))
 

Modified: gump/branches/Gump3/pygump/python/gump/plugins/irc.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/plugins/irc.py?rev=202280&r1=202279&r2=202280&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/plugins/irc.py (original)
+++ gump/branches/Gump3/pygump/python/gump/plugins/irc.py Tue Jun 28 13:30:07 2005
@@ -58,8 +58,7 @@
         try:
             port = int(s[1])
         except ValueError:
-            if not 2 == len(s): 
-                raise Error, 'Unable to extract port for %s from %s' % (CONFIG_FORMAT, data)
+            raise Error, 'Unable to extract port for %s from %s using %s' % (CONFIG_FORMAT,
data, s[1])
     else:
         port = DEFAULT_IRC_PORT
 



Mime
View raw message