summaryrefslogtreecommitdiffstats
path: root/pyLoadCore.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-xpyLoadCore.py38
1 files changed, 16 insertions, 22 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 16c272d5e..5ae81294d 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -28,49 +28,43 @@ from glob import glob
from imp import find_module
import logging
import logging.handlers
-from os import listdir
+from os import execv
from os import makedirs
-from os import sep
+from os import sep
from os.path import basename
-from os.path import abspath
from os.path import dirname
from os.path import exists
from os.path import join
-from os import execv
-from sys import stdin
from re import sub
import subprocess
from sys import argv
+from sys import executable
from sys import exit
from sys import path
from sys import stdout
-from sys import executable
+from tempfile import NamedTemporaryFile
import thread
import time
from time import sleep
-from shutil import copyfile
-from tempfile import NamedTemporaryFile
+from xmlrpclib import Binary
-from module.network.Request import Request
-import module.remote.SecureXMLRPCServer as Server
+from module.CaptchaManager import CaptchaManager
+from module.HookManager import HookManager
from module.XMLConfigParser import XMLConfigParser
-
from module.file_list import File_List
+from module.network.Request import Request
+import module.remote.SecureXMLRPCServer as Server
from module.thread_list import Thread_List
from module.web.ServerThread import WebServer
-from module.CaptchaManager import CaptchaManager
-from module.HookManager import HookManager
-
-from xmlrpclib import Binary
class Core(object):
""" pyLoad Core """
def __init__(self):
if len(argv) > 1:
if argv[1] == "-v" or argv[1] == "--version":
- print "pyLoad", CURRENT_VERSION
- else:
- print "Unknown Command"
+ print "pyLoad", CURRENT_VERSION
+ else:
+ print "Unknown Command"
exit()
def toggle_pause(self):
@@ -90,7 +84,7 @@ class Core(object):
self.plugin_folder = join("module", "plugins")
- self.xmlconfig = XMLConfigParser(join(self.path,"module","config","core.xml"))
+ self.xmlconfig = XMLConfigParser(join(self.path, "module", "config", "core.xml"))
self.config = self.xmlconfig.getConfig()
self.do_kill = False
@@ -136,7 +130,7 @@ class Core(object):
self.last_update_check = 0
self.update_check_interval = 1800
self.update_available = self.check_update()
- self.logger.info(_("Downloadtime: %s") % self.server_methods.is_time_download())
+ self.logger.info(_("Downloadtime: %s") % self.server_methods.is_time_download())
self.init_server()
self.init_webserver()
@@ -265,7 +259,7 @@ class Core(object):
exit()
def isGUIConnected(self):
- return self.lastGuiConnected+10 > time.time()
+ return self.lastGuiConnected + 10 > time.time()
def restart(self):
self.shutdown()
@@ -512,7 +506,7 @@ class ServerMethods():
self.core.file_list.packager.resetFileStatus(fileid)
def upload_container(self, filename, type, content):
- th = NamedTemporaryFile(mode="w", suffix="."+type, delete=False)
+ th = NamedTemporaryFile(mode="w", suffix="." + type, delete=False)
th.write(content)
path = th.name
th.close()