diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-05-29 20:47:03 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-05-29 20:47:03 +0200 |
commit | ca1c034012f15fcebf1cf918f578afbcfe028ea7 (patch) | |
tree | 16e4f590aed0fe5498add0bb880bd4367eaffdbd | |
parent | requestobject and working interface to the core (diff) | |
download | pyload-ca1c034012f15fcebf1cf918f578afbcfe028ea7.tar.xz |
little request fix
-rw-r--r-- | Core.py | 2 | ||||
-rw-r--r-- | module/remote/RequestHandler.py | 14 | ||||
-rw-r--r-- | module/remote/RequestObject.py | 2 |
3 files changed, 11 insertions, 7 deletions
@@ -200,7 +200,7 @@ class Core(object): start_h, start_m = self.config['start'].split(":") end_h, end_m = self.config['end'].split(":") - #@todo: doesnt work at the moment + #@todo: little bug, when start and end time in same hour hour, minute = time.localtime()[3:5] if hour > int(start_h) and hour < int(end_h): diff --git a/module/remote/RequestHandler.py b/module/remote/RequestHandler.py index 09ad5b548..1405fd3eb 100644 --- a/module/remote/RequestHandler.py +++ b/module/remote/RequestHandler.py @@ -30,7 +30,7 @@ class RequestHandler: if obj.command == "exec": func = getattr(self.core, obj.function) - obj.response = func() + obj.response = func(*obj.args) else: obj.response = "antwort" @@ -38,11 +38,15 @@ class RequestHandler: def decrypt(self, dec_str): - dec_str = base64.standard_b64decode(dec_str) - dec_str = self.aes.decrypt(dec_str) + try: + dec_str = base64.standard_b64decode(dec_str) + dec_str = self.aes.decrypt(dec_str) - dec_str = dec_str[:-(int(dec_str[-1], 16) + 1)] - obj = cPickle.loads(dec_str) + dec_str = dec_str[:-(int(dec_str[-1], 16) + 1)] + obj = cPickle.loads(dec_str) + except: + obj = RequestObject() + return obj def encrypt(self, obj): diff --git a/module/remote/RequestObject.py b/module/remote/RequestObject.py index 77322663a..86e803e9c 100644 --- a/module/remote/RequestObject.py +++ b/module/remote/RequestObject.py @@ -3,7 +3,7 @@ """ authored by: RaNaN -this module handels the incoming requests +represents the object for interaction """ |