summaryrefslogtreecommitdiffstats
path: root/module/lib/thrift/TSerialization.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/lib/thrift/TSerialization.py')
-rw-r--r--module/lib/thrift/TSerialization.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/module/lib/thrift/TSerialization.py b/module/lib/thrift/TSerialization.py
index b19f98aa8..8a58d89df 100644
--- a/module/lib/thrift/TSerialization.py
+++ b/module/lib/thrift/TSerialization.py
@@ -20,15 +20,19 @@
from protocol import TBinaryProtocol
from transport import TTransport
-def serialize(thrift_object, protocol_factory = TBinaryProtocol.TBinaryProtocolFactory()):
+
+def serialize(thrift_object,
+ protocol_factory=TBinaryProtocol.TBinaryProtocolFactory()):
transport = TTransport.TMemoryBuffer()
protocol = protocol_factory.getProtocol(transport)
thrift_object.write(protocol)
return transport.getvalue()
-def deserialize(base, buf, protocol_factory = TBinaryProtocol.TBinaryProtocolFactory()):
+
+def deserialize(base,
+ buf,
+ protocol_factory=TBinaryProtocol.TBinaryProtocolFactory()):
transport = TTransport.TMemoryBuffer(buf)
protocol = protocol_factory.getProtocol(transport)
base.read(protocol)
return base
-