summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-05-17 21:11:22 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-05-17 21:11:22 +0200
commitf8422d1555df000d2f55d59afc372c20cd9fe677 (patch)
tree657cbb0fe3e730cedc6718509cc91fdea5ddfbb1
parentfixes last commit (diff)
downloadpyload-f8422d1555df000d2f55d59afc372c20cd9fe677.tar.xz
convert sizes to ints
-rw-r--r--module/PyFile.py14
-rw-r--r--module/Utils.py2
-rw-r--r--module/web/pyload_app.py2
-rwxr-xr-xpyLoadCore.py4
4 files changed, 15 insertions, 7 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])
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 09b039a4e..be06dc5ee 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -382,7 +382,9 @@ class Core(object):
self.server_methods.add_package("links.txt", [link_file], 1)
f.close()
- self.scheduler.addJob(0, self.accountManager.getAccountInfos)
+ #self.scheduler.addJob(0, self.accountManager.getAccountInfos)
+ self.log.info(_("Activating Accounts..."))
+ self.accountManager.getAccountInfos()
while True:
sleep(2)