You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ns...@apache.org on 2016/01/02 18:59:04 UTC

[2/9] thrift git commit: THRIFT-3506 Eliminate old style classes from library code Client: Python Patch: Nobuaki Sukegawa

THRIFT-3506 Eliminate old style classes from library code
Client: Python
Patch: Nobuaki Sukegawa

This closes #758


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/b9c859a0
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/b9c859a0
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/b9c859a0

Branch: refs/heads/master
Commit: b9c859a07bae89643c0953a14e490cf3db435957
Parents: 7b89469
Author: Nobuaki Sukegawa <ns...@apache.org>
Authored: Mon Dec 21 01:10:25 2015 +0900
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Sat Jan 2 22:54:16 2016 +0900

----------------------------------------------------------------------
 lib/py/src/Thrift.py                    |  6 +++---
 lib/py/src/protocol/TBinaryProtocol.py  |  4 ++--
 lib/py/src/protocol/TCompactProtocol.py |  4 ++--
 lib/py/src/protocol/TJSONProtocol.py    |  2 +-
 lib/py/src/protocol/TProtocol.py        |  4 ++--
 lib/py/src/server/TNonblockingServer.py |  4 ++--
 lib/py/src/server/TServer.py            |  2 +-
 lib/py/src/transport/TTransport.py      | 12 ++++++------
 8 files changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/b9c859a0/lib/py/src/Thrift.py
----------------------------------------------------------------------
diff --git a/lib/py/src/Thrift.py b/lib/py/src/Thrift.py
index cbb9184..11ee796 100644
--- a/lib/py/src/Thrift.py
+++ b/lib/py/src/Thrift.py
@@ -20,7 +20,7 @@
 import sys
 
 
-class TType:
+class TType(object):
   STOP   = 0
   VOID   = 1
   BOOL   = 2
@@ -59,14 +59,14 @@ class TType:
                      'UTF16')
 
 
-class TMessageType:
+class TMessageType(object):
   CALL = 1
   REPLY = 2
   EXCEPTION = 3
   ONEWAY = 4
 
 
-class TProcessor:
+class TProcessor(object):
   """Base class for procsessor, which works on two streams."""
 
   def process(iprot, oprot):

http://git-wip-us.apache.org/repos/asf/thrift/blob/b9c859a0/lib/py/src/protocol/TBinaryProtocol.py
----------------------------------------------------------------------
diff --git a/lib/py/src/protocol/TBinaryProtocol.py b/lib/py/src/protocol/TBinaryProtocol.py
index f92f558..43cb5a4 100644
--- a/lib/py/src/protocol/TBinaryProtocol.py
+++ b/lib/py/src/protocol/TBinaryProtocol.py
@@ -223,7 +223,7 @@ class TBinaryProtocol(TProtocolBase):
     return s
 
 
-class TBinaryProtocolFactory:
+class TBinaryProtocolFactory(object):
   def __init__(self, strictRead=False, strictWrite=True):
     self.strictRead = strictRead
     self.strictWrite = strictWrite
@@ -255,6 +255,6 @@ class TBinaryProtocolAccelerated(TBinaryProtocol):
   pass
 
 
-class TBinaryProtocolAcceleratedFactory:
+class TBinaryProtocolAcceleratedFactory(object):
   def getProtocol(self, trans):
     return TBinaryProtocolAccelerated(trans)

http://git-wip-us.apache.org/repos/asf/thrift/blob/b9c859a0/lib/py/src/protocol/TCompactProtocol.py
----------------------------------------------------------------------
diff --git a/lib/py/src/protocol/TCompactProtocol.py b/lib/py/src/protocol/TCompactProtocol.py
index b8d171e..a8b025a 100644
--- a/lib/py/src/protocol/TCompactProtocol.py
+++ b/lib/py/src/protocol/TCompactProtocol.py
@@ -79,7 +79,7 @@ def readVarint(trans):
     shift += 7
 
 
-class CompactType:
+class CompactType(object):
   STOP = 0x00
   TRUE = 0x01
   FALSE = 0x02
@@ -399,7 +399,7 @@ class TCompactProtocol(TProtocolBase):
     return TTYPES[byte & 0x0f]
 
 
-class TCompactProtocolFactory:
+class TCompactProtocolFactory(object):
   def __init__(self):
     pass
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/b9c859a0/lib/py/src/protocol/TJSONProtocol.py
----------------------------------------------------------------------
diff --git a/lib/py/src/protocol/TJSONProtocol.py b/lib/py/src/protocol/TJSONProtocol.py
index 3539412..acfce4a 100644
--- a/lib/py/src/protocol/TJSONProtocol.py
+++ b/lib/py/src/protocol/TJSONProtocol.py
@@ -559,7 +559,7 @@ class TJSONProtocol(TJSONProtocolBase):
     self.writeJSONBase64(binary)
 
 
-class TJSONProtocolFactory:
+class TJSONProtocolFactory(object):
 
   def getProtocol(self, trans):
     return TJSONProtocol(trans)

http://git-wip-us.apache.org/repos/asf/thrift/blob/b9c859a0/lib/py/src/protocol/TProtocol.py
----------------------------------------------------------------------
diff --git a/lib/py/src/protocol/TProtocol.py b/lib/py/src/protocol/TProtocol.py
index 1d703e3..be2fcea 100644
--- a/lib/py/src/protocol/TProtocol.py
+++ b/lib/py/src/protocol/TProtocol.py
@@ -39,7 +39,7 @@ class TProtocolException(TException):
     self.type = type
 
 
-class TProtocolBase:
+class TProtocolBase(object):
   """Base class for Thrift protocol driver."""
 
   def __init__(self, trans):
@@ -445,6 +445,6 @@ def checkIntegerLimits(i, bits):
                                   "i64 requires -9223372036854775808 <= number <= 9223372036854775807")
 
 
-class TProtocolFactory:
+class TProtocolFactory(object):
   def getProtocol(self, trans):
     pass

http://git-wip-us.apache.org/repos/asf/thrift/blob/b9c859a0/lib/py/src/server/TNonblockingServer.py
----------------------------------------------------------------------
diff --git a/lib/py/src/server/TNonblockingServer.py b/lib/py/src/server/TNonblockingServer.py
index 79748b7..a930a80 100644
--- a/lib/py/src/server/TNonblockingServer.py
+++ b/lib/py/src/server/TNonblockingServer.py
@@ -88,7 +88,7 @@ def socket_exception(func):
     return read
 
 
-class Connection:
+class Connection(object):
     """Basic class is represented connection.
 
     It can be in state:
@@ -222,7 +222,7 @@ class Connection:
         self.socket.close()
 
 
-class TNonblockingServer:
+class TNonblockingServer(object):
     """Non-blocking server."""
 
     def __init__(self,

http://git-wip-us.apache.org/repos/asf/thrift/blob/b9c859a0/lib/py/src/server/TServer.py
----------------------------------------------------------------------
diff --git a/lib/py/src/server/TServer.py b/lib/py/src/server/TServer.py
index 130f730..30f063b 100644
--- a/lib/py/src/server/TServer.py
+++ b/lib/py/src/server/TServer.py
@@ -31,7 +31,7 @@ from thrift.protocol import TBinaryProtocol
 from thrift.transport import TTransport
 
 
-class TServer:
+class TServer(object):
   """Base interface for a server, which must have a serve() method.
 
   Three constructors for all servers:

http://git-wip-us.apache.org/repos/asf/thrift/blob/b9c859a0/lib/py/src/transport/TTransport.py
----------------------------------------------------------------------
diff --git a/lib/py/src/transport/TTransport.py b/lib/py/src/transport/TTransport.py
index 92dc4cd..8e2da8d 100644
--- a/lib/py/src/transport/TTransport.py
+++ b/lib/py/src/transport/TTransport.py
@@ -36,7 +36,7 @@ class TTransportException(TException):
     self.type = type
 
 
-class TTransportBase:
+class TTransportBase(object):
   """Base class for Thrift transport layer."""
 
   def isOpen(self):
@@ -72,7 +72,7 @@ class TTransportBase:
 
 
 # This class should be thought of as an interface.
-class CReadableTransport:
+class CReadableTransport(object):
   """base class for transports that are readable from C"""
 
   # TODO(dreiss): Think about changing this interface to allow us to use
@@ -100,7 +100,7 @@ class CReadableTransport:
     pass
 
 
-class TServerTransportBase:
+class TServerTransportBase(object):
   """Base class for Thrift server transports."""
 
   def listen(self):
@@ -113,14 +113,14 @@ class TServerTransportBase:
     pass
 
 
-class TTransportFactoryBase:
+class TTransportFactoryBase(object):
   """Base class for a Transport Factory"""
 
   def getTransport(self, trans):
     return trans
 
 
-class TBufferedTransportFactory:
+class TBufferedTransportFactory(object):
   """Factory transport that builds buffered transports"""
 
   def getTransport(self, trans):
@@ -244,7 +244,7 @@ class TMemoryBuffer(TTransportBase, CReadableTransport):
     raise EOFError()
 
 
-class TFramedTransportFactory:
+class TFramedTransportFactory(object):
   """Factory transport that builds framed transports"""
 
   def getTransport(self, trans):