summaryrefslogtreecommitdiffstats
path: root/module/FileDatabase.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-12-22 12:53:38 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-12-22 12:53:38 +0100
commitd52bcc46770e2f932b12fcaac45d056846814ef1 (patch)
tree8b4a53a93b15a6134bd6c4af8cdb2ace6f5ec78e /module/FileDatabase.py
parentchanged request files (diff)
downloadpyload-d52bcc46770e2f932b12fcaac45d056846814ef1.tar.xz
at least its downloading now
Diffstat (limited to 'module/FileDatabase.py')
-rw-r--r--module/FileDatabase.py32
1 files changed, 1 insertions, 31 deletions
diff --git a/module/FileDatabase.py b/module/FileDatabase.py
index 9e5417c75..818c6ed07 100644
--- a/module/FileDatabase.py
+++ b/module/FileDatabase.py
@@ -24,7 +24,6 @@ from shutil import move
from threading import Lock
from threading import RLock
from threading import Thread
-from time import sleep
from time import time
import traceback
@@ -35,6 +34,7 @@ from module.PullEvents import UpdateEvent
from module.PyPackage import PyPackage
from module.PyFile import PyFile
+from module.PyFile import formatSize
try:
from pysqlite2 import dbapi2 as sqlite3
@@ -43,36 +43,6 @@ except:
DB_VERSION = 2
-statusMap = {
- "finished": 0,
- "offline": 1,
- "online": 2,
- "queued": 3,
- "checking": 4,
- "waiting": 5,
- "reconnected": 6,
- "starting": 7,
- "failed": 8,
- "aborted": 9,
- "decrypting": 10,
- "custom": 11,
- "downloading": 12,
- "processing": 13,
- "unknown": 14
-}
-
-def formatSize(size):
- """formats size of bytes"""
- size = int(size)
- steps = 0
- sizes = ["B", "KB", "MB", "GB", "TB"]
-
- while size > 1000:
- size /= 1024.0
- steps += 1
-
- return "%.2f %s" % (size, sizes[steps])
-
########################################################################
class FileHandler:
"""Handles all request made to obtain information,