diff options
author | Bryan Duxbury <bryanduxbury@apache.org> | 2012-01-03 17:32:30 +0000 |
---|---|---|
committer | Bryan Duxbury <bryanduxbury@apache.org> | 2012-01-03 17:32:30 +0000 |
commit | 6972041392314d526584e733781ca382a960b295 (patch) | |
tree | f68da7e2d3d4187a9c1ce755417c7c735b7365fa /lib/py/src/server/THttpServer.py | |
parent | 9704630bab3dc502bbd216380f9bb5e6b13228f0 (diff) | |
download | thrift-6972041392314d526584e733781ca382a960b295.tar.gz |
THRIFT-1480. py: remove tabs, adjust whitespace and address PEP8 warnings
This patch addresses a host of PEP8 lint problems.
Patch: Will Pierce
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1226890 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'lib/py/src/server/THttpServer.py')
-rw-r--r-- | lib/py/src/server/THttpServer.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/py/src/server/THttpServer.py b/lib/py/src/server/THttpServer.py index 3047d9c00..be54bab94 100644 --- a/lib/py/src/server/THttpServer.py +++ b/lib/py/src/server/THttpServer.py @@ -22,6 +22,7 @@ import BaseHTTPServer from thrift.server import TServer from thrift.transport import TTransport + class ResponseException(Exception): """Allows handlers to override the HTTP response @@ -39,16 +40,19 @@ class THttpServer(TServer.TServer): """A simple HTTP-based Thrift server This class is not very performant, but it is useful (for example) for - acting as a mock version of an Apache-based PHP Thrift endpoint.""" - - def __init__(self, processor, server_address, - inputProtocolFactory, outputProtocolFactory = None, - server_class = BaseHTTPServer.HTTPServer): + acting as a mock version of an Apache-based PHP Thrift endpoint. + """ + def __init__(self, + processor, + server_address, + inputProtocolFactory, + outputProtocolFactory=None, + server_class=BaseHTTPServer.HTTPServer): """Set up protocol factories and HTTP server. See BaseHTTPServer for server_address. - See TServer for protocol factories.""" - + See TServer for protocol factories. + """ if outputProtocolFactory is None: outputProtocolFactory = inputProtocolFactory @@ -62,7 +66,8 @@ class THttpServer(TServer.TServer): # Don't care about the request path. itrans = TTransport.TFileObjectTransport(self.rfile) otrans = TTransport.TFileObjectTransport(self.wfile) - itrans = TTransport.TBufferedTransport(itrans, int(self.headers['Content-Length'])) + itrans = TTransport.TBufferedTransport( + itrans, int(self.headers['Content-Length'])) otrans = TTransport.TMemoryBuffer() iprot = thttpserver.inputProtocolFactory.getProtocol(itrans) oprot = thttpserver.outputProtocolFactory.getProtocol(otrans) |