diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/hooks/ExternalScripts.py | 6 | ||||
-rw-r--r-- | module/web/cnl_app.py | 15 |
2 files changed, 12 insertions, 9 deletions
diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index f755ffb7a..540b60477 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -49,7 +49,7 @@ class ExternalScripts(Hook): for script_type, names in self.scripts.iteritems(): if names: - self.logInfo(_("Installed scripts for %s : %s") % (script_type, ", ".join([basename(x) for x in names]))) + self.logInfo((_("Installed scripts for %s: ") % script_type ) + ", ".join([basename(x) for x in names])) def initPluginType(self, folder, path): @@ -64,7 +64,7 @@ class ExternalScripts(Hook): continue if not access(join(path,f), X_OK): - self.logWarning(_("Script not executable: %s/%s") % (folder, f)) + self.logWarning(_("Script not executable:") + " %s/%s" % (folder, f)) self.scripts[folder].append(join(path, f)) @@ -74,7 +74,7 @@ class ExternalScripts(Hook): #output goes to pyload subprocess.Popen(cmd, bufsize=-1) except Exception, e: - self.logError(_("Error in %s: %s") % (basename(script), str(e))) + self.logError(_("Error in %(script)s: %(error)s") % { "script" :basename(script), "error": str(e)}) def downloadStarts(self, pyfile): for script in self.scripts['download_preparing']: diff --git a/module/web/cnl_app.py b/module/web/cnl_app.py index 22be426de..13ddab1ef 100644 --- a/module/web/cnl_app.py +++ b/module/web/cnl_app.py @@ -36,10 +36,13 @@ def flash(id="0"): @route("/flash/add", method="POST") @local_check def add(request): - package = request.POST.get('referer', 'ClickAndLoad Package') + package = request.POST.get('referer', None) urls = filter(lambda x: x != "", request.POST['urls'].split("\n")) - PYLOAD.addPackage(package, urls, 0) + if package: + PYLOAD.addPackage(package, urls, 0) + else: + PYLOAD.generateAndAddPackages(urls, 0) return "" @@ -66,7 +69,7 @@ def addcrypted(): @local_check def addcrypted2(): - package = request.forms.get("source", "ClickAndLoad Package") + package = request.forms.get("source", None) crypted = request.forms["crypted"] jk = request.forms["jk"] @@ -102,7 +105,7 @@ def addcrypted2(): result = filter(lambda x: x != "", result) try: - if package != "ClickAndLoad Package": + if package: PYLOAD.addPackage(package, result, 0) else: PYLOAD.generateAndAddPackages(result, 0) @@ -118,11 +121,11 @@ def flashgot(request): return HTTPError() autostart = int(request.forms.get('autostart', 0)) - package = request.forms.get('package', "FlashGot") + package = request.forms.get('package', None) urls = filter(lambda x: x != "", request.forms['urls'].split("\n")) folder = request.forms.get('dir', None) - if package != "FlashGot": + if package: PYLOAD.addPackage(package, urls, autostart) else: PYLOAD.generateAndAddPackages(urls, autostart) |