diff options
Diffstat (limited to 'pyload/network')
-rw-r--r-- | pyload/network/Browser.py | 12 | ||||
-rw-r--r-- | pyload/network/HTTPChunk.py | 6 | ||||
-rw-r--r-- | pyload/network/HTTPDownload.py | 9 | ||||
-rw-r--r-- | pyload/network/JsEngine.py | 4 | ||||
-rw-r--r-- | pyload/network/XDCCRequest.py | 9 |
5 files changed, 12 insertions, 28 deletions
diff --git a/pyload/network/Browser.py b/pyload/network/Browser.py index 1c0596ccc..61bf523ab 100644 --- a/pyload/network/Browser.py +++ b/pyload/network/Browser.py @@ -42,17 +42,15 @@ class Browser(object): self.cj = cj self.http.cj = cj - @property - + @property def speed(self): if self.dl: return self.dl.speed return 0 - @property - + @property def size(self): if self._size: return self._size @@ -60,17 +58,15 @@ class Browser(object): return self.dl.size return 0 - @property - + @property def arrived(self): if self.dl: return self.dl.arrived return 0 - @property - + @property def percent(self): if not self.size: return 0 return (self.arrived * 100) / self.size diff --git a/pyload/network/HTTPChunk.py b/pyload/network/HTTPChunk.py index 5395b7bda..c11ad9e3c 100644 --- a/pyload/network/HTTPChunk.py +++ b/pyload/network/HTTPChunk.py @@ -67,9 +67,8 @@ class ChunkInfo(object): fh.write("\trange:%i-%i\n" % c[1]) fh.close() - @staticmethod - + @staticmethod def load(name): fs_name = fs_encode("%s.chunks" % name) if not exists(fs_name): @@ -153,9 +152,8 @@ class HTTPChunk(HTTPRequest): def __repr__(self): return "<HTTPChunk id=%d, size=%d, arrived=%d>" % (self.id, self.size, self.arrived) - @property - + @property def cj(self): return self.p.cj diff --git a/pyload/network/HTTPDownload.py b/pyload/network/HTTPDownload.py index 89e594640..0580a6b90 100644 --- a/pyload/network/HTTPDownload.py +++ b/pyload/network/HTTPDownload.py @@ -58,22 +58,19 @@ class HTTPDownload(object): self.progress = progress - @property - + @property def speed(self): last = [sum(x) for x in self.lastSpeeds if x] return (sum(self.speeds) + sum(last)) / (1 + len(last)) - @property - + @property def arrived(self): return sum([c.arrived for c in self.chunks]) - @property - + @property def percent(self): if not self.size: return 0 return (self.arrived * 100) / self.size diff --git a/pyload/network/JsEngine.py b/pyload/network/JsEngine.py index bcf6ae0e2..c64e8c490 100644 --- a/pyload/network/JsEngine.py +++ b/pyload/network/JsEngine.py @@ -33,8 +33,6 @@ class JsEngine(object): @classmethod - - def find(cls): """ Check if there is any engine available """ return [E for E in ENGINES if E.find()] @@ -122,8 +120,6 @@ class AbstractEngine(object): @classmethod - - def find(cls): """ Check if the engine is available """ try: diff --git a/pyload/network/XDCCRequest.py b/pyload/network/XDCCRequest.py index a4813e039..01fc2ea78 100644 --- a/pyload/network/XDCCRequest.py +++ b/pyload/network/XDCCRequest.py @@ -132,21 +132,18 @@ class XDCCRequest(object): def abortDownloads(self): self.abort = True - @property - + @property def size(self): return self.filesize - @property - + @property def arrived(self): return self.recv - @property - + @property def percent(self): if not self.filesize: return 0 return (self.recv * 100) / self.filesize |