summaryrefslogtreecommitdiffstats
path: root/module/gui/Collector.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-09-21 16:43:22 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-09-21 16:43:22 +0200
commit79ce6f862285f355455119d64d8aa1753cff0470 (patch)
tree238b2f309d2f90cb9c3d722b15748b45a6e5d6d1 /module/gui/Collector.py
parentyourfiles.biz fix (diff)
downloadpyload-79ce6f862285f355455119d64d8aa1753cff0470.tar.xz
royflos GUI patches, prefix option for webinterface (
Diffstat (limited to 'module/gui/Collector.py')
-rw-r--r--module/gui/Collector.py22
1 files changed, 5 insertions, 17 deletions
diff --git a/module/gui/Collector.py b/module/gui/Collector.py
index 6b0a54d2f..c569785e2 100644
--- a/module/gui/Collector.py
+++ b/module/gui/Collector.py
@@ -19,25 +19,15 @@
from PyQt4.QtCore import *
from PyQt4.QtGui import *
-from module.remote.thriftbackend.thriftgen.pyload.ttypes import *
from module.PyFile import statusMap
+from module.utils import formatSize
+
+from module.remote.thriftbackend.ThriftClient import Destination, FileDoesNotExists, ElementType
statusMapReverse = dict((v,k) for k, v in statusMap.iteritems())
translatedStatusMap = {} # -> CollectorModel.__init__
-def formatSize(size):
- """formats size of bytes"""
- size = int(size)
- steps = 0
- sizes = ["B", "KiB", "MiB", "GiB", "TiB"]
-
- while size > 1000:
- size /= 1024.0
- steps += 1
-
- return "%.2f %s" % (size, sizes[steps])
-
class CollectorModel(QAbstractItemModel):
"""
model for the collector view
@@ -80,7 +70,7 @@ class CollectorModel(QAbstractItemModel):
"""
called from main loop, pass events to the correct methods
"""
- locker = QMutexLocker(self.mutex)
+ QMutexLocker(self.mutex)
if event.event == "reload":
self.fullReload()
elif event.event == "remove":
@@ -339,7 +329,6 @@ class Package(object):
"site": pack.site,
"password": pack.password,
"order": pack.order,
- "priority": pack.priority,
}
self.data.update(data)
@@ -392,13 +381,12 @@ class Link(object):
"name": f.name,
"plugin": f.plugin,
"size": f.size,
- "forrmat_size": f.format_size,
+ "format_size": f.format_size,
"status": f.status,
"statusmsg": f.statusmsg,
"package": f.packageID,
"error": f.error,
"order": f.order,
- "progress": f.progress
}
self.data.update(data)