summaryrefslogtreecommitdiffstats
path: root/pyload/manager/AddonManager.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-20 02:32:36 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-20 02:32:36 +0100
commit6acbca30b0de51462b1a486c83d936c0c4f5d94e (patch)
treebb6aae47aca0294302b33be816bef3e30d397add /pyload/manager/AddonManager.py
parent[Addon] Periodical default to off (diff)
downloadpyload-6acbca30b0de51462b1a486c83d936c0c4f5d94e.tar.xz
Import threading instead thread + thread cleanup
Diffstat (limited to 'pyload/manager/AddonManager.py')
-rw-r--r--pyload/manager/AddonManager.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/pyload/manager/AddonManager.py b/pyload/manager/AddonManager.py
index 5ad62f515..a394373a9 100644
--- a/pyload/manager/AddonManager.py
+++ b/pyload/manager/AddonManager.py
@@ -20,8 +20,7 @@
import __builtin__
import traceback
-from thread import start_new_thread
-from threading import RLock
+from threading import RLock, Thread
from types import MethodType
@@ -149,7 +148,6 @@ class AddonManager:
self.deactivateAddon(plugin)
def activateAddon(self, plugin):
-
#check if already loaded
for inst in self.plugins:
if inst.__name__ == plugin:
@@ -166,10 +164,12 @@ class AddonManager:
self.pluginMap[pluginClass.__name__] = plugin
# call core Ready
- start_new_thread(plugin.coreReady, tuple())
+ t = Thread(target=plugin.coreReady)
+ t.setDaemon(True)
+ t.start()
- def deactivateAddon(self, plugin):
+ def deactivateAddon(self, plugin):
addon = None
for inst in self.plugins:
if inst.__name__ == plugin:
@@ -253,7 +253,7 @@ class AddonManager:
self.dispatchEvent("afterReconnecting", ip)
def startThread(self, function, *args, **kwargs):
- t = AddonThread(self.core.threadManager, function, args, kwargs)
+ return AddonThread(self.core.threadManager, function, args, kwargs)
def activePlugins(self):
""" returns all active plugins """