| 49 | |
| 50 | |
| 51 | class Client(Iface): |
| 52 | def __init__(self, iprot, oprot=None): |
| 53 | self._iprot = self._oprot = iprot |
| 54 | if oprot is not None: |
| 55 | self._oprot = oprot |
| 56 | self._seqid = 0 |
| 57 | |
| 58 | def execute(self, functionName, funcArgs): |
| 59 | """ |
| 60 | Parameters: |
| 61 | - functionName |
| 62 | - funcArgs |
| 63 | |
| 64 | """ |
| 65 | self.send_execute(functionName, funcArgs) |
| 66 | return self.recv_execute() |
| 67 | |
| 68 | def send_execute(self, functionName, funcArgs): |
| 69 | self._oprot.writeMessageBegin('execute', TMessageType.CALL, self._seqid) |
| 70 | args = execute_args() |
| 71 | args.functionName = functionName |
| 72 | args.funcArgs = funcArgs |
| 73 | args.write(self._oprot) |
| 74 | self._oprot.writeMessageEnd() |
| 75 | self._oprot.trans.flush() |
| 76 | |
| 77 | def recv_execute(self): |
| 78 | iprot = self._iprot |
| 79 | (fname, mtype, rseqid) = iprot.readMessageBegin() |
| 80 | if mtype == TMessageType.EXCEPTION: |
| 81 | x = TApplicationException() |
| 82 | x.read(iprot) |
| 83 | iprot.readMessageEnd() |
| 84 | raise x |
| 85 | result = execute_result() |
| 86 | result.read(iprot) |
| 87 | iprot.readMessageEnd() |
| 88 | if result.success is not None: |
| 89 | return result.success |
| 90 | if result.e is not None: |
| 91 | raise result.e |
| 92 | if result.aze is not None: |
| 93 | raise result.aze |
| 94 | raise TApplicationException(TApplicationException.MISSING_RESULT, "execute failed: unknown result") |
| 95 | |
| 96 | |
| 97 | class Processor(Iface, TProcessor): |
nothing calls this directly
no outgoing calls
no test coverage detected