MCPcopy Create free account
hub / github.com/apache/thrift / JSONPairContext

Class JSONPairContext

lib/py/src/protocol/TJSONProtocol.py:126–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124
125
126class JSONPairContext(JSONBaseContext):
127
128 def __init__(self, protocol):
129 super(JSONPairContext, self).__init__(protocol)
130 self.colon = True
131
132 def doIO(self, function):
133 if self.first:
134 self.first = False
135 self.colon = True
136 else:
137 function(COLON if self.colon else COMMA)
138 self.colon = not self.colon
139
140 def write(self):
141 self.doIO(self.protocol.trans.write)
142
143 def read(self):
144 self.doIO(self.protocol.readJSONSyntaxChar)
145
146 def escapeNum(self):
147 return self.colon
148
149 def __str__(self):
150 return '%s, colon=%s' % (self.__class__.__name__, self.colon)
151
152
153class LookaheadReader():

Callers 2

writeJSONObjectStartMethod · 0.70
readJSONObjectStartMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected