diff options
author | cp1 <christopherpool1@googlemail.com> | 2009-06-11 16:50:48 +0200 |
---|---|---|
committer | cp1 <christopherpool1@googlemail.com> | 2009-06-11 16:50:48 +0200 |
commit | fd6e286ee089cf75276f2581471aba254d69fcb5 (patch) | |
tree | 1f91e2063f3182d172d7c7f70c4fdb98b407a60b /module/remote | |
parent | add wxversion selector to ensure wxWidgets 2.8 is used (diff) | |
download | pyload-fd6e286ee089cf75276f2581471aba254d69fcb5.tar.xz |
correcting false identation (tabs to spaces)
Diffstat (limited to 'module/remote')
-rw-r--r-- | module/remote/ClientSocket.py | 35 | ||||
-rw-r--r-- | module/remote/RequestHandler.py | 11 | ||||
-rw-r--r-- | module/remote/SocketServer.py | 6 |
3 files changed, 24 insertions, 28 deletions
diff --git a/module/remote/ClientSocket.py b/module/remote/ClientSocket.py index 4efeaf3ab..ee0d03e82 100644 --- a/module/remote/ClientSocket.py +++ b/module/remote/ClientSocket.py @@ -16,29 +16,29 @@ from RequestObject import RequestObject class SocketThread(threading.Thread): def __init__(self, adress, port, pw, client): - threading.Thread.__init__(self) - self.setDaemon(True) - sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sock.connect((adress, port)) - self.socket = ClientSocket(sock, pw, client) - self.start() + threading.Thread.__init__(self) + self.setDaemon(True) + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.connect((adress, port)) + self.socket = ClientSocket(sock, pw, client) + self.start() def run(self): - asyncore.loop() - print "loop closed" + asyncore.loop() + print "loop closed" def push_exec(self, function, args=[]): - obj = RequestObject() - obj.command = "exec" - obj.function = function - obj.args = args - self.push(obj) + obj = RequestObject() + obj.command = "exec" + obj.function = function + obj.args = args + self.push(obj) def push(self, obj): - self.socket.push_obj(obj) + self.socket.push_obj(obj) -class ClientSocket(asynchat.async_chat): +class ClientSocket(asynchat.async_chat): def __init__(self, sock, pw, client): asynchat.async_chat.__init__(self, sock) self.data = "" @@ -58,6 +58,5 @@ class ClientSocket(asynchat.async_chat): self.data = "" def push_obj(self, obj): - string = self.handler.encrypt(obj) - self.push(string) - + string = self.handler.encrypt(obj) + self.push(string)
\ No newline at end of file diff --git a/module/remote/RequestHandler.py b/module/remote/RequestHandler.py index 2f6f248bd..9ded5d02e 100644 --- a/module/remote/RequestHandler.py +++ b/module/remote/RequestHandler.py @@ -1,5 +1,5 @@ #!/usr/bin/python -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- """ authored by: RaNaN @@ -31,7 +31,7 @@ class RequestHandler: obj.response = func( * obj.args) else: obj.response = "error happend" - + return self.encrypt(obj) @@ -39,7 +39,7 @@ class RequestHandler: try: dec_str = base64.standard_b64decode(dec_str) dec_str = self.bf.decrypt(dec_str) - + dec_str = dec_str[:-(int(dec_str[-1], 16) + 1)] obj = cPickle.loads(dec_str) except: @@ -60,7 +60,4 @@ class RequestHandler: enc_str = self.bf.encrypt(enc_str) enc_str = base64.standard_b64encode(enc_str) - return enc_str + "\n" - - - + return enc_str + "\n"
\ No newline at end of file diff --git a/module/remote/SocketServer.py b/module/remote/SocketServer.py index e5932bb6e..c683c6672 100644 --- a/module/remote/SocketServer.py +++ b/module/remote/SocketServer.py @@ -19,7 +19,7 @@ class ServerThread(threading.Thread): threading.Thread.__init__(self) self.setDaemon(True) self.server = MainServerSocket(int(pycore.config['port']), pycore) - + def run(self): asyncore.loop() print "loop closed" @@ -52,8 +52,8 @@ class MainServerSocket(asyncore.dispatcher): print "Connected from", address SecondaryServerSocket(newSocket, self.pycore) def handle_close(self): - print "going to close" - self.close() + print "going to close" + self.close() class SecondaryServerSocket(asynchat.async_chat): |