diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-12-01 23:53:07 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-01 23:53:07 +0100 |
commit | 004a80bfaad38f9400e8aebcb8f980353a232295 (patch) | |
tree | 1e786d2d14a3040767aac237982544b74a9567cb /pyload/manager/event | |
parent | Fix previous merge (diff) | |
download | pyload-004a80bfaad38f9400e8aebcb8f980353a232295.tar.xz |
PEP-8, Python Zen, refactor and reduce code (thx FedeG)
Diffstat (limited to 'pyload/manager/event')
-rw-r--r-- | pyload/manager/event/PullEvents.py | 16 | ||||
-rw-r--r-- | pyload/manager/event/Scheduler.py | 8 |
2 files changed, 12 insertions, 12 deletions
diff --git a/pyload/manager/event/PullEvents.py b/pyload/manager/event/PullEvents.py index 0739b4ec8..aa78f590e 100644 --- a/pyload/manager/event/PullEvents.py +++ b/pyload/manager/event/PullEvents.py @@ -20,7 +20,7 @@ from time import time from pyload.utils import uniqify -class PullManager: +class PullManager(object): def __init__(self, core): self.core = core self.clients = [] @@ -52,7 +52,7 @@ class PullManager: for client in self.clients: client.addEvent(event) -class Client: +class Client(object): def __init__(self, uuid): self.uuid = uuid self.lastActive = time() @@ -69,7 +69,7 @@ class Client: def addEvent(self, event): self.events.append(event) -class UpdateEvent: +class UpdateEvent(object): def __init__(self, itype, iid, destination): assert itype == "pack" or itype == "file" assert destination == "queue" or destination == "collector" @@ -80,7 +80,7 @@ class UpdateEvent: def toList(self): return ["update", self.destination, self.type, self.id] -class RemoveEvent: +class RemoveEvent(object): def __init__(self, itype, iid, destination): assert itype == "pack" or itype == "file" assert destination == "queue" or destination == "collector" @@ -91,7 +91,7 @@ class RemoveEvent: def toList(self): return ["remove", self.destination, self.type, self.id] -class InsertEvent: +class InsertEvent(object): def __init__(self, itype, iid, after, destination): assert itype == "pack" or itype == "file" assert destination == "queue" or destination == "collector" @@ -103,7 +103,7 @@ class InsertEvent: def toList(self): return ["insert", self.destination, self.type, self.id, self.after] -class ReloadAllEvent: +class ReloadAllEvent(object): def __init__(self, destination): assert destination == "queue" or destination == "collector" self.destination = destination @@ -111,10 +111,10 @@ class ReloadAllEvent: def toList(self): return ["reload", self.destination] -class AccountUpdateEvent: +class AccountUpdateEvent(object): def toList(self): return ["account"] -class ConfigUpdateEvent: +class ConfigUpdateEvent(object): def toList(self): return ["config"] diff --git a/pyload/manager/event/Scheduler.py b/pyload/manager/event/Scheduler.py index 39dfbc3cc..59b84cfcf 100644 --- a/pyload/manager/event/Scheduler.py +++ b/pyload/manager/event/Scheduler.py @@ -25,7 +25,7 @@ class AlreadyCalled(Exception): pass -class Deferred: +class Deferred(object): def __init__(self): self.call = [] self.result = () @@ -43,7 +43,7 @@ class Deferred: f(*args ** kwargs) -class Scheduler: +class Scheduler(object): def __init__(self, core): self.core = core @@ -87,7 +87,7 @@ class Scheduler: break -class Job: +class Job(object): def __init__(self, time, call, args=[], kwargs={}, deferred=None, threaded=True): self.time = float(time) self.call = call @@ -112,7 +112,7 @@ class Job: self.run() -class PriorityQueue: +class PriorityQueue(object): """ a non blocking priority queue """ def __init__(self): |