diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-09-17 14:23:28 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-09-17 14:23:28 +0200 |
commit | d53f3b99a1f5176caa94fcbdd3e3fe59f346ece1 (patch) | |
tree | 52280c0176566f27d225efcf6ae75f5c28c61a88 | |
parent | stub class for content provider (diff) | |
download | pyload-d53f3b99a1f5176caa94fcbdd3e3fe59f346ece1.tar.xz |
more fixes for py2.5
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | pyload/plugins/Crypter.py | 7 | ||||
-rw-r--r-- | pyload/threads/InfoThread.py | 16 | ||||
-rw-r--r-- | pyload/web/api_app.py | 7 |
4 files changed, 11 insertions, 22 deletions
diff --git a/.gitignore b/.gitignore index 3c1d6ae26..52969376b 100644 --- a/.gitignore +++ b/.gitignore @@ -49,8 +49,7 @@ Logs/* docs/module/ docs/pyload/ docs/_build -pyload/plugins/container/DLC_*.py -failed_links.txt +DLC.py links.txt ssl.crt ssl.key diff --git a/pyload/plugins/Crypter.py b/pyload/plugins/Crypter.py index 2f5584074..cce43fb56 100644 --- a/pyload/plugins/Crypter.py +++ b/pyload/plugins/Crypter.py @@ -135,8 +135,6 @@ class Crypter(Base): self.package = package #: Password supplied by user self.password = password - #: Propose a renaming of the owner package - self.rename = None # For old style decrypter, do not use these! self.packages = [] @@ -236,10 +234,9 @@ class Crypter(Base): :return: Decrypting results """ try: - return self._decrypt(urls) + return to_list(self._decrypt(urls)) except Exception: - if self.core.debug: - print_exc() + self.core.print_exc() return [] def getLocalContent(self, urls): diff --git a/pyload/threads/InfoThread.py b/pyload/threads/InfoThread.py index f3aad5bb6..fb4bdf11e 100644 --- a/pyload/threads/InfoThread.py +++ b/pyload/threads/InfoThread.py @@ -57,7 +57,7 @@ class InfoThread(BaseThread): data = self.decrypt(name, urls) except: print_exc() - self.m.log.error("Could not decrypt container.") + self.m.log.error("Could not decrypt content.") data = [] accumulate(data, plugins) @@ -148,15 +148,9 @@ class InfoThread(BaseThread): result = [(url, 0, 3, url) for url in urls] cb(pluginname, result) - def decrypt(self, plugin, urls): - self.m.log.debug("Pre decrypting %s" % plugin) + self.m.log.debug("Decrypting %s" % plugin) klass = self.m.core.pluginManager.loadClass("crypter", plugin) - - # only decrypt files - if has_method(klass, "decryptFile"): - urls = klass.decrypt(urls) - data, crypter = self.m.core.pluginManager.parseUrls(urls) - return data - - return [] + urls = klass.decrypt(self.core, urls) + data, crypter = self.m.core.pluginManager.parseUrls(urls) + return data + crypter diff --git a/pyload/web/api_app.py b/pyload/web/api_app.py index af5c3074c..d0a41b4d0 100644 --- a/pyload/web/api_app.py +++ b/pyload/web/api_app.py @@ -44,14 +44,14 @@ def call_api(func, args=""): api = get_user_api(s) if not api: - return HTTPError(401, dumps("Unauthorized"), **response.headers) + return error(401, "Unauthorized") if not PYLOAD.isAuthorized(func, api.user): - return HTTPError(403, dumps("Forbidden"), **response.headers) + return error(403, "Forbidden") if not hasattr(PYLOAD.EXTERNAL, func) or func.startswith("_"): print "Invalid API call", func - return HTTPError(404, dumps("Not Found"), **response.headers) + return error(404, "Not Found") # TODO: possible encoding # TODO Better error codes on invalid input @@ -65,7 +65,6 @@ def call_api(func, args=""): # file upload, reads whole file into memory for name, f in request.files.iteritems(): - print f.length kwargs["filename"] = f.filename kwargs[name] = f.value |