def connect(): transport = TSocket.TSocket('127.0.0.1', 9090) transport = TTransport.TBufferedTransport(transport) protocol = TBinaryProtocol.TBinaryProtocol(transport) client = server.Client(protocol) transport.open() return client
def connect(): envPort = os.getenv('CHARYBDEFS_PORT', '') port = int(envPort) if envPort else 9090 transport = TSocket.TSocket('127.0.0.1', port) transport = TTransport.TBufferedTransport(transport) protocol = TBinaryProtocol.TBinaryProtocol(transport) client = server.Client(protocol) transport.open() return client