예제 #1
0
 def unload(self, modname):
     """ unload plugin .. remove related commands from cmnds object. """
     logging.info("unloading %s" % modname)
     try:
         self[modname].shutdown()
         logging.debug('called %s shutdown' % modname)
     except KeyError:
         logging.debug("no %s module found" % modname) 
         return False
     except AttributeError: pass
     try: cmnds.unload(modname)
     except KeyError: pass
     try: first_callbacks.unload(modname)
     except KeyError: pass
     try: callbacks.unload(modname)
     except KeyError: pass
     try: last_callbacks.unload(modname)
     except KeyError: pass
     try: remote_callbacks.unload(modname)
     except KeyError: pass
     try: outputmorphs.unload(modname)
     except: handle_exception()
     try: inputmorphs.unload(modname)
     except: handle_exception()
     try: waiter.remove(modname)
     except: handle_exception()
     try: mainsink.unregister(modname)
     except: handle_exception()
     return True
예제 #2
0
파일: plugins.py 프로젝트: Petraea/jsonbot
 def unload(self, modname):
     """ unload plugin .. remove related commands from cmnds object. """
     logging.warn("unloading %s" % modname)
     try:
         self[modname].shutdown()
         logging.debug('called %s shutdown' % modname)
     except KeyError:
         logging.debug("no %s module found" % modname) 
         return False
     except AttributeError: pass
     try: cmnds.unload(modname)
     except KeyError: pass
     try: first_callbacks.unload(modname)
     except KeyError: pass
     try: callbacks.unload(modname)
     except KeyError: pass
     try: last_callbacks.unload(modname)
     except KeyError: pass
     try: remote_callbacks.unload(modname)
     except KeyError: pass
     try: outputmorphs.unload(modname)
     except: handle_exception()
     try: inputmorphs.unload(modname)
     except: handle_exception()
     try: waiter.remove(modname)
     except: handle_exception()
     try: mainsink.unregister(modname)
     except: handle_exception()
     return True
예제 #3
0
        # remove from avail list
        try:
            self.avail.remove(plugname)
        except ValueError:
            pass

        # remove from initcalled list
        try:
            self.initcalled.remove(plugname)
        except ValueError:
            pass

        # unload commands, RE callbacks, callbacks, monitorsetc.
        try:
            cmnds.unload(plugname)
            callbacks.unload(plugname)
            jcallbacks.unload(plugname)
            rebefore.unload(plugname)
            reafter.unload(plugname)
            saymonitor.unload(plugname)
            outmonitor.unload(plugname)
            jabbermonitor.unload(plugname)
            tests.unload(plugname)
            outputmorphs.unload(plugname)
            inputmorphs.unload(plugname)
            if self.plugs.has_key(plugname):
                del self.plugs[plugname]
        except Exception, ex:
            handle_exception()
            return 0
예제 #4
0
        # remove from avail list
        try:
            self.avail.remove(plugname)
        except ValueError:
            pass

        # remove from initcalled list
        try:
            self.initcalled.remove(plugname)
        except ValueError:
            pass

        # unload commands, RE callbacks, callbacks, monitorsetc.
        try:
            cmnds.unload(plugname)
            callbacks.unload(plugname)
            jcallbacks.unload(plugname)
            rebefore.unload(plugname)
            reafter.unload(plugname)
            saymonitor.unload(plugname)
            outmonitor.unload(plugname)
            jabbermonitor.unload(plugname)
            tests.unload(plugname)
            outputmorphs.unload(plugname)
            inputmorphs.unload(plugname)
            if self.plugs.has_key(plugname):
                del self.plugs[plugname]
        except Exception, ex:
            handle_exception()
            return 0