summaryrefslogtreecommitdiffstats
path: root/pyLoadCore.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-05-14 15:37:58 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-05-14 15:37:58 +0200
commit9973f09a616900ab0900974da77d22b566598b5f (patch)
tree0669cdda0a367e1b53b7286f19b6aaf1b9e4004a /pyLoadCore.py
parentrevert premium account change see #309 (diff)
downloadpyload-9973f09a616900ab0900974da77d22b566598b5f.tar.xz
improved some code style issues
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-xpyLoadCore.py42
1 files changed, 20 insertions, 22 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 67778cee2..0cdd9efcb 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -534,22 +534,21 @@ class ServerMethods():
x.active and x.active != "quit"]:
if not isinstance(pyfile, PyFile):
continue
- download = {}
- download['id'] = pyfile.id
- download['name'] = pyfile.name
- download['speed'] = pyfile.getSpeed()/1024
- download['eta'] = pyfile.getETA()
- download['format_eta'] = pyfile.formatETA()
- download['kbleft'] = pyfile.getBytesLeft() #holded for backward comp.
- download['bleft'] = pyfile.getBytesLeft()
- download['size'] = pyfile.getSize()
- download['format_size'] = pyfile.formatSize()
- download['percent'] = pyfile.getPercent()
- download['status'] = pyfile.status
- download['statusmsg'] = pyfile.m.statusMsg[pyfile.status]
- download['format_wait'] = pyfile.formatWait()
- download['wait_until'] = pyfile.waitUntil
- download['package'] = pyfile.package().name
+ download = {'id': pyfile.id,
+ 'name': pyfile.name,
+ 'speed': pyfile.getSpeed() / 1024,
+ 'eta': pyfile.getETA(),
+ 'format_eta': pyfile.formatETA(),
+ 'kbleft': pyfile.getBytesLeft(),
+ 'bleft': pyfile.getBytesLeft(),
+ 'size': pyfile.getSize(),
+ 'format_size': pyfile.formatSize(),
+ 'percent': pyfile.getPercent(),
+ 'status': pyfile.status,
+ 'statusmsg': pyfile.m.statusMsg[pyfile.status],
+ 'format_wait': pyfile.formatWait(),
+ 'wait_until': pyfile.waitUntil,
+ 'package': pyfile.package().name}
downloads.append(download)
return downloads
@@ -596,12 +595,11 @@ class ServerMethods():
def status_server(self):
""" dict with current server status """
- status = {}
- status['pause'] = self.core.threadManager.pause
- status['activ'] = len(self.core.threadManager.processingIds())
- status['queue'] = self.core.files.getFileCount()
- status['total'] = self.core.files.getFileCount()
- status['speed'] = 0
+ status = {'pause': self.core.threadManager.pause,
+ 'activ': len(self.core.threadManager.processingIds()),
+ 'queue': self.core.files.getFileCount(),
+ 'total': self.core.files.getFileCount(),
+ 'speed': 0}
for pyfile in [x.active for x in self.core.threadManager.threads if x.active and x.active != "quit"]:
status['speed'] += pyfile.getSpeed()/1024