summaryrefslogtreecommitdiffstats
path: root/pyLoadCore.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2009-12-21 19:19:28 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2009-12-21 19:19:28 +0100
commit63d4273065f475719e63e5785abdbf11be43dae3 (patch)
tree7094a92d40bc7ab41028012b7825c1eaa5143692 /pyLoadCore.py
parentmerged Wugy, 2nd try (diff)
downloadpyload-63d4273065f475719e63e5785abdbf11be43dae3.tar.xz
reverted files, pyload.db fix
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-xpyLoadCore.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 2a9cbbc59..eb43ce840 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -43,7 +43,8 @@ from sys import path
from sys import stdout
import thread
import time
-from time import sleep
+from time import sleep
+from shutil import copyfile
from module.file_list import File_List
from module.network.Request import Request
@@ -185,7 +186,11 @@ class Core(object):
traceback.print_exc()
- def init_webserver(self):
+ def init_webserver(self):
+ pyloadDBFile = join(self.path, "module", "web", "pyload.db")
+ pyloadDefaultDBFile = join(self.path, "module", "web", "pyload_default.db")
+ if not exists(pyloadDBFile):
+ copyfile(pyloadDefaultDBFile, pyloadDBFile)
if self.config['webinterface']['activated']:
self.webserver = WebServer(self)
self.webserver.start()
@@ -372,7 +377,8 @@ class ServerMethods():
if self.core.thread_list.pause:
self.core.thread_list.pause = False
else:
- self.core.thread_list.pause = True
+ self.core.thread_list.pause = True
+ return self.core.thread_list.pause
def status_server(self):
status = {}
@@ -394,8 +400,10 @@ class ServerMethods():
return CURRENT_VERSION
def add_urls(self, links):
- for link in links:
- self.core.file_list.collector.addLink(link)
+ for link in links:
+ link = link.strip()
+ if link.startswith("http") or exists(link):
+ self.core.file_list.collector.addLink(link)
self.core.file_list.save()
def add_package(self, name, links):