fixbot/irc.py
changeset 44 779d7cd38f1a
parent 23 67e71e9170e5
child 58 31a17b0b5159
equal deleted inserted replaced
43:78bc61c677d8 44:779d7cd38f1a
    57 
    57 
    58     def sendEvent (self, event) :
    58     def sendEvent (self, event) :
    59         self.send("[%s.%s] %s" % (event.module.name, event.type, event.msg))
    59         self.send("[%s.%s] %s" % (event.module.name, event.type, event.msg))
    60 
    60 
    61     def moduleConnected (self, module, addr) :
    61     def moduleConnected (self, module, addr) :
    62         self.send("{modules.%s} connected from %s:%d, version %s" % (module.name, addr.host, addr.port, module.version))
    62         self.send("{modules.%s} connected from %s" % (module.name, addr))
    63 
    63 
    64     def moduleDisconnected (self, module, reason) :
    64     def moduleDisconnected (self, module, reason) :
    65         self.send("{modules.%s} disconnected: %s" % (module.name, reason))
    65         self.send("{modules.%s} disconnected: %s" % (module.name, reason))
    66     
    66     
    67     class _noDefault : pass
    67     class _noDefault : pass
   110             return method.__doc__
   110             return method.__doc__
   111         else :
   111         else :
   112             try :
   112             try :
   113                 module, addr = self.nexus.getModuleInfo(cmd)
   113                 module, addr = self.nexus.getModuleInfo(cmd)
   114 
   114 
   115                 return "%s is version %d from %s:%d. Events: %s. See `commands %s' for a list of commands" % (module.name, module.version, addr.host, addr.port, ', '.join(module.event_types), module.name)
   115                 return "%s from %s. Events: %s. See `commands %s' for a list of commands" % (module.name, addr, ', '.join(module.event_types), module.name)
   116 
   116 
   117             except KeyError :
   117             except KeyError :
   118                 raise ReplyException("No command/module called `%s'. See `help commands'" % cmd)
   118                 raise ReplyException("No command/module called `%s'. See `help commands'" % cmd)
   119 
   119 
   120     def cmd_commands (self, module=None) :
   120     def cmd_commands (self, module=None) :