def __init__(self, trans, spec=None): TProtocolBase.__init__(self, trans) # Used as stack for contexts. self.contexts = [TJSONContext(protocol=self)] self.context = TJSONContext(protocol=self) self.pair_context_class = TJSONPairContext self.list_context_class = TJSONListContext self.reader = LookaheadReader(self) self.specs = [] self.spec = StructSpec(spec)
def __init__(self, trans, strictRead=False, client_types=None, client_type=None): """Create a THeaderProtocol instance @param transport(TTransport) The underlying transport. @param strictRead(bool) Turn on strictRead if using TBinaryProtocol @param client_types([CLIENT_TYPE.HEADER, ...]) List of client types to support. Defaults to CLIENT_TYPE.HEADER only. """ if isinstance(trans, THeaderTransport): trans._THeaderTransport__supported_client_types = set( client_types or (CLIENT_TYPE.HEADER,)) if client_type is not None: trans._THeaderTransport__client_type = client_type htrans = trans else: htrans = THeaderTransport(trans, client_types, client_type) TProtocolBase.__init__(self, htrans) self.strictRead = strictRead self.reset_protocol()
def __init__(self, trans): TProtocolBase.__init__(self, trans) self.resetWriteContext() self.resetReadContext()
def __init__(self, trans, validJSON=True): TProtocolBase.__init__(self, trans) self.validJSON = validJSON self.resetWriteContext() self.resetReadContext()
def __init__(self, trans): TProtocolBase.__init__(self, trans) self.resetWriteContext() self.resetReadContext()