THRIFT-3596 Better conformance to PEP8
This closes #832
diff --git a/contrib/zeromq/test-client.py b/contrib/zeromq/test-client.py
index 1886d9c..753b132 100755
--- a/contrib/zeromq/test-client.py
+++ b/contrib/zeromq/test-client.py
@@ -9,28 +9,28 @@
def main(args):
- endpoint = "tcp://127.0.0.1:9090"
- socktype = zmq.REQ
- incr = 0
- if len(args) > 1:
- incr = int(args[1])
+ endpoint = "tcp://127.0.0.1:9090"
+ socktype = zmq.REQ
+ incr = 0
+ if len(args) > 1:
+ incr = int(args[1])
+ if incr:
+ socktype = zmq.DOWNSTREAM
+ endpoint = "tcp://127.0.0.1:9091"
+
+ ctx = zmq.Context()
+ transport = TZmqClient.TZmqClient(ctx, endpoint, socktype)
+ protocol = thrift.protocol.TBinaryProtocol.TBinaryProtocolAccelerated(transport)
+ client = storage.Storage.Client(protocol)
+ transport.open()
+
if incr:
- socktype = zmq.DOWNSTREAM
- endpoint = "tcp://127.0.0.1:9091"
-
- ctx = zmq.Context()
- transport = TZmqClient.TZmqClient(ctx, endpoint, socktype)
- protocol = thrift.protocol.TBinaryProtocol.TBinaryProtocolAccelerated(transport)
- client = storage.Storage.Client(protocol)
- transport.open()
-
- if incr:
- client.incr(incr)
- time.sleep(0.05)
- else:
- value = client.get()
- print value
+ client.incr(incr)
+ time.sleep(0.05)
+ else:
+ value = client.get()
+ print value
if __name__ == "__main__":
- main(sys.argv)
+ main(sys.argv)