diff --git a/couchpotato/core/event.py b/couchpotato/core/event.py index 1fd6ab2..43cfdda 100644 --- a/couchpotato/core/event.py +++ b/couchpotato/core/event.py @@ -21,15 +21,12 @@ def addEvent(name, handler, priority = 100): def createHandle(*args, **kwargs): - try: - parent = handler.im_self - bc = hasattr(parent, 'beforeCall') - if bc: parent.beforeCall(handler) - h = runHandler(name, handler, *args, **kwargs) - ac = hasattr(parent, 'afterCall') - if ac: parent.afterCall(handler) - except: - h = runHandler(name, handler, *args, **kwargs) + parent = handler.im_self + bc = hasattr(parent, 'beforeCall') + if bc: parent.beforeCall(handler) + h = runHandler(name, handler, *args, **kwargs) + ac = hasattr(parent, 'afterCall') + if ac: parent.afterCall(handler) return h diff --git a/couchpotato/core/plugins/base.py b/couchpotato/core/plugins/base.py index 43aa93d..ef4563f 100644 --- a/couchpotato/core/plugins/base.py +++ b/couchpotato/core/plugins/base.py @@ -37,6 +37,7 @@ class Plugin(object): def registerPlugin(self): addEvent('app.do_shutdown', self.doShutdown) addEvent('plugin.running', self.isRunning) + self._running = [] def conf(self, attr, value = None, default = None): return Env.setting(attr, self.getName().lower(), value = value, default = default) @@ -226,9 +227,6 @@ class Plugin(object): def isRunning(self, value = None, boolean = True): - if not hasattr(self, '_running'): - self._running = [] - if value is None: return self._running