summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/PyFile.py14
-rw-r--r--module/Utils.py2
-rw-r--r--module/web/pyload_app.py2
3 files changed, 12 insertions, 6 deletions
diff --git a/module/PyFile.py b/module/PyFile.py
index f973fee70..931975305 100644
--- a/module/PyFile.py
+++ b/module/PyFile.py
@@ -21,8 +21,7 @@ from module.PullEvents import UpdateEvent
from module.Progress import Progress
from module.utils import formatSize
-from time import sleep
-from time import time
+from time import sleep, time
statusMap = {
"finished": 0,
@@ -43,7 +42,10 @@ statusMap = {
}
-class PyFile():
+def setSize(self, value):
+ self._size = int(value)
+
+class PyFile(object):
def __init__(self, manager, id, url, name, size, status, error, pluginname, package, order):
self.m = manager
@@ -76,6 +78,9 @@ class PyFile():
self.m.cache[int(id)] = self
+
+ # will convert all sizes to ints
+ size = property(lambda self: self._size, setSize)
def __repr__(self):
return "PyFile %s: %s@%s" % (self.id, self.name, self.pluginname)
@@ -229,7 +234,8 @@ class PyFile():
def getSize(self):
""" get size of download """
- if self.size: return self.size
+ if self.size:
+ return self.size
else:
try:
return self.plugin.req.size
diff --git a/module/Utils.py b/module/Utils.py
index 63ae9488f..6808f6862 100644
--- a/module/Utils.py
+++ b/module/Utils.py
@@ -113,4 +113,4 @@ def parseFileSize(string): #returns bytes
if __name__ == "__main__":
print freeSpace(".")
- print replace("ab'cdgdsf''ds'", "'ghd")
+ print removeChars("ab'cdgdsf''ds'", "'ghd")
diff --git a/module/web/pyload_app.py b/module/web/pyload_app.py
index c7af88275..0caf2ece3 100644
--- a/module/web/pyload_app.py
+++ b/module/web/pyload_app.py
@@ -144,7 +144,7 @@ def home():
for link in res:
if link["status"] == 12:
- link["information"] = "%s kB @ %s kB/s" % (link["size"] - link["kbleft"], link["speed"])
+ link["information"] = "%s kB @ %s kB/s" % (link["size"] - link["bleft"], link["speed"])
return render_to_response("home.html", {"res": res}, [pre_processor])