diff options
author | fedeG <federicogonzalez761@gmail.com> | 2015-04-20 21:47:58 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-04-20 23:01:33 +0200 |
commit | d39e789f9a464ab38bd160ec9ce05bd157928a54 (patch) | |
tree | 5a84cb5773a6e53f996fc101f0c6d03979bcb1bf | |
parent | Spare code cosmetics (7) (diff) | |
download | pyload-d39e789f9a464ab38bd160ec9ce05bd157928a54.tar.xz |
PEP-8, Python Zen, refactor and reduce code (part 13 in master module/remote)
Conflicts:
module/remote/ThriftBackend.py
pyload/manager/Remote.py
pyload/remote/ClickNLoadBackend.py
pyload/remote/SocketBackend.py
-rw-r--r-- | pyload/remote/ClickNLoadBackend.py | 30 | ||||
-rw-r--r-- | pyload/remote/ThriftBackend.py | 6 |
2 files changed, 18 insertions, 18 deletions
diff --git a/pyload/remote/ClickNLoadBackend.py b/pyload/remote/ClickNLoadBackend.py index 5c08986a7..2d3e29dbc 100644 --- a/pyload/remote/ClickNLoadBackend.py +++ b/pyload/remote/ClickNLoadBackend.py @@ -62,20 +62,20 @@ class CNLHandler(BaseHTTPRequestHandler): def do_GET(self): path = self.path.strip("/").lower() - #self.wfile.write(path+"\n") + # self.wfile.write(path+"\n") - self.map = [ (r"add$", self.add), - (r"addcrypted$", self.addcrypted), - (r"addcrypted2$", self.addcrypted2), - (r"flashgot", self.flashgot), - (r"crossdomain\.xml", self.crossdomain), - (r"checkSupportForUrl", self.checksupport), - (r"jdcheck.js", self.jdcheck), - (r"", self.flash) ] + self.map = [(r"add$", self.add), + (r"addcrypted$", self.addcrypted), + (r"addcrypted2$", self.addcrypted2), + (r"flashgot", self.flashgot), + (r"crossdomain\.xml", self.crossdomain), + (r"checkSupportForUrl", self.checksupport), + (r"jdcheck.js", self.jdcheck), + (r"", self.flash)] func = None for r, f in self.map: - if re.match(r"(flash(got)?/?)?"+r, path): + if re.match(r"(flash(got)?/?)?" + r, path): func = f break @@ -94,11 +94,11 @@ class CNLHandler(BaseHTTPRequestHandler): def do_POST(self): form = FieldStorage( - fp=self.rfile, - headers=self.headers, - environ={'REQUEST_METHOD':'POST', - 'CONTENT_TYPE':self.headers['Content-Type'], - }) + fp=self.rfile, + headers=self.headers, + environ={'REQUEST_METHOD': 'POST', + 'CONTENT_TYPE': self.headers['Content-Type'], + }) self.post = {} for name in form.keys(): diff --git a/pyload/remote/ThriftBackend.py b/pyload/remote/ThriftBackend.py index a6f1841e2..f71e264e2 100644 --- a/pyload/remote/ThriftBackend.py +++ b/pyload/remote/ThriftBackend.py @@ -31,14 +31,14 @@ class ThriftBackend(BackendBase): transport = ServerSocket(port, host, key, cert) -# tfactory = TransportFactoryCompressed() + # tfactory = TransportFactoryCompressed() tfactory = TransportFactory() pfactory = ProtocolFactory() self.server = TServer.TThreadedServer(processor, transport, tfactory, pfactory) - #self.server = TNonblockingServer.TNonblockingServer(processor, transport, tfactory, pfactory) + # self.server = TNonblockingServer.TNonblockingServer(processor, transport, tfactory, pfactory) - #server = TServer.TThreadPoolServer(processor, transport, tfactory, pfactory) + # server = TServer.TThreadPoolServer(processor, transport, tfactory, pfactory) def serve(self): |