summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-09-26 14:36:44 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-09-26 14:36:44 +0200
commit263c8bfab4e444bc97b1ff92ffa097642e710493 (patch)
treed945c72a7a57cc7139f1c30f23c889611ead060b
parentThe pyLoad Team thanks everyone who was involved in development process with ... (diff)
downloadpyload-263c8bfab4e444bc97b1ff92ffa097642e710493.tar.xz
processing some plugins in collector
-rw-r--r--module/FileDatabase.py10
-rw-r--r--module/plugins/Crypter.py2
-rw-r--r--module/web/settings.py8
3 files changed, 13 insertions, 7 deletions
diff --git a/module/FileDatabase.py b/module/FileDatabase.py
index 012dd8383..9064d5a03 100644
--- a/module/FileDatabase.py
+++ b/module/FileDatabase.py
@@ -310,6 +310,7 @@ class FileHandler:
"""get suitable job"""
#@TODO clean mess
+ #@TODO improve selection of valid jobs
if self.jobCache.has_key(occ):
if self.jobCache[occ]:
@@ -849,15 +850,18 @@ class FileDatabaseBackend(Thread):
@queue
def getJob(self, occ):
"""return pyfile instance, which is suitable for download and dont use a occupied plugin"""
-
+
+ #@TODO improve this hardcoded method
+ pre = "('DLC', 'LinkList', 'SerienjunkiesOrg', 'CCF', 'RSDF')" #plugins which are processed in collector
+
cmd = "("
for i, item in enumerate(occ):
if i != 0: cmd += ", "
cmd += "'%s'" % item
cmd += ")"
-
- cmd = "SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE p.queue=1 AND l.plugin NOT IN %s AND l.status IN (2,3,6,14) ORDER BY p.priority DESC, p.packageorder ASC, l.linkorder ASC LIMIT 5" % cmd
+
+ cmd = "SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE ((p.queue=1 AND l.plugin NOT IN %s) OR l.plugin IN %s) AND l.status IN (2,3,6,14) ORDER BY p.priority DESC, p.packageorder ASC, l.linkorder ASC LIMIT 5" % (cmd, pre)
self.c.execute(cmd) # very bad!
diff --git a/module/plugins/Crypter.py b/module/plugins/Crypter.py
index 97840e20c..d326f41e1 100644
--- a/module/plugins/Crypter.py
+++ b/module/plugins/Crypter.py
@@ -57,5 +57,5 @@ class Crypter(Plugin):
self.log.info(_("Parsed package %(name)s with %(len)d links") % { "name" : pack[0], "len" : len(pack[1]) } )
- self.core.server_methods.add_package(pack[0], pack[1], 1)
+ self.core.server_methods.add_package(pack[0], pack[1], self.pyfile.package().queue)
diff --git a/module/web/settings.py b/module/web/settings.py
index 756554deb..515117860 100644
--- a/module/web/settings.py
+++ b/module/web/settings.py
@@ -24,9 +24,7 @@ sys.path.append(os.path.join(PYLOAD_DIR, "module"))
import InitHomeDir
sys.path.append(pypath)
-
-from module.ConfigParser import ConfigParser
-config = ConfigParser()
+config = None
#os.chdir(PROJECT_DIR) # UNCOMMENT FOR LOCALE GENERATION
#DEBUG = config.get("general","debug")
@@ -36,10 +34,14 @@ try:
if not module.web.ServerThread.core:
raise Exception
PYLOAD = module.web.ServerThread.core.server_methods
+ config = module.web.ServerThread.core.config
except:
import xmlrpclib
ssl = ""
+ from module.ConfigParser import ConfigParser
+ config = ConfigParser()
+
if config.get("ssl", "activated"):
ssl = "s"