diff options
Diffstat (limited to 'pyload/manager')
-rw-r--r-- | pyload/manager/Addon.py | 5 | ||||
-rw-r--r-- | pyload/manager/Scheduler.py | 7 |
2 files changed, 5 insertions, 7 deletions
diff --git a/pyload/manager/Addon.py b/pyload/manager/Addon.py index 98b66189a..a632111ea 100644 --- a/pyload/manager/Addon.py +++ b/pyload/manager/Addon.py @@ -6,8 +6,7 @@ import __builtin__ import threading import traceback - -from types import MethodType +import types from pyload.Thread import AddonThread from pyload.manager.Plugin import literal_eval @@ -55,7 +54,7 @@ class AddonManager(object): self.events = {} #: contains events # registering callback for config event - self.core.config.pluginCB = MethodType(self.dispatchEvent, "pluginConfigChanged", basestring) #@TODO: Rename event pluginConfigChanged + self.core.config.pluginCB = types.MethodType(self.dispatchEvent, "pluginConfigChanged", basestring) #@TODO: Rename event pluginConfigChanged self.addEvent("pluginConfigChanged", self.manageAddon) diff --git a/pyload/manager/Scheduler.py b/pyload/manager/Scheduler.py index 630e43022..b82768aff 100644 --- a/pyload/manager/Scheduler.py +++ b/pyload/manager/Scheduler.py @@ -1,11 +1,10 @@ # -*- coding: utf-8 -*- # @author: mkaay +import heapq import threading import time -from heapq import heappop, heappush - class AlreadyCalled(Exception): pass @@ -125,7 +124,7 @@ class PriorityQueue(object): def put(self, element): self.lock.acquire() - heappush(self.queue, element) + heapq.heappush(self.queue, element) self.lock.release() @@ -133,7 +132,7 @@ class PriorityQueue(object): """ return element or None """ self.lock.acquire() try: - el = heappop(self.queue) + el = heapq.heappop(self.queue) return el except IndexError: return None, None |