Here are the examples of the python api request_pb2.Request taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
0
Source : pauto_reader.py
with Apache License 2.0
from truechain
with Apache License 2.0
from truechain
def run(self):
for msg in self.msg_list:
self.sock.send(msg)
self.start_time = time.time()
data = self.sock.recv(4096)
self.sock.close()
try:
req = request_pb2.Request()
size = struct.unpack("!I",data[:4])[0]
req.ParseFromString(data[4:size+4])
if req.inner.msg != "APPROVED" and req.inner.msg != "INVALID":
self.ret[self.index] = None
return None
except:
self.ret[self.index] = None
return None
self.ret[self.index] = (time.time() - self.start_time, req.inner.msg)
return time.time() - self.start_time
if len(sys.argv) == 2: