diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-02-16 10:46:28 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-02-16 10:46:28 +0100 |
commit | ce1c2b6b05c08b669357947e61ae40efce7fc50f (patch) | |
tree | 0b5f7996960cf35c4eface53a89eba18a37519b7 /pyload/remote/thriftbackend/Protocol.py | |
parent | Fix filename case (diff) | |
download | pyload-ce1c2b6b05c08b669357947e61ae40efce7fc50f.tar.xz |
module temp
Diffstat (limited to 'pyload/remote/thriftbackend/Protocol.py')
-rw-r--r-- | pyload/remote/thriftbackend/Protocol.py | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/pyload/remote/thriftbackend/Protocol.py b/pyload/remote/thriftbackend/Protocol.py deleted file mode 100644 index 417b45834..000000000 --- a/pyload/remote/thriftbackend/Protocol.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- - -from thrift.protocol import TBinaryProtocol - -class Protocol(TBinaryProtocol.TBinaryProtocol): - def writeString(self, str): - try: - str = str.encode("utf8", "ignore") - except Exception, e: - pass - - self.writeI32(len(str)) - self.trans.write(str) - - def readString(self): - len = self.readI32() - str = self.trans.readAll(len) - try: - str = str.decode("utf8", "ignore") - except Exception: - pass - - return str - - -class ProtocolFactory(TBinaryProtocol.TBinaryProtocolFactory): - - def getProtocol(self, trans): - prot = Protocol(trans, self.strictRead, self.strictWrite) - return prot |