Adam Lindsay avatar Adam Lindsay committed 79878e3

Added die() Base method.

Comments (0)

Files changed (4)

gen-py/locator/Base-remote

   print '  string service_type()'
   print '   service_types()'
   print '  void debug()'
+  print '  void die()'
   print ''
   sys.exit(0)
 
     sys.exit(1)
   pp.pprint(client.debug())
 
+elif cmd == 'die':
+  if len(args) != 0:
+    print 'die requires 0 args'
+    sys.exit(1)
+  pp.pprint(client.die())
+
 transport.close()

gen-py/locator/Base.py

   def debug(self, ):
     pass
 
+  def die(self, ):
+    pass
+
 
 class Client(Iface):
   def __init__(self, iprot, oprot=None):
     args.write(self._oprot)
     self._oprot.writeMessageEnd()
     self._oprot.trans.flush()
+  def die(self, ):
+    self.send_die()
+
+  def send_die(self, ):
+    self._oprot.writeMessageBegin('die', TMessageType.CALL, self._seqid)
+    args = die_args()
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
 
 class Processor(Iface, TProcessor):
   def __init__(self, handler):
     self._processMap["service_type"] = Processor.process_service_type
     self._processMap["service_types"] = Processor.process_service_types
     self._processMap["debug"] = Processor.process_debug
+    self._processMap["die"] = Processor.process_die
 
   def process(self, iprot, oprot):
     (name, type, seqid) = iprot.readMessageBegin()
     self._handler.debug()
     return
 
+  def process_die(self, seqid, iprot, oprot):
+    args = die_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    self._handler.die()
+    return
+
 
 # HELPER FUNCTIONS AND STRUCTURES
 
   def __ne__(self, other):
     return not (self == other)
 
+class die_args(object):
 
+  thrift_spec = (
+  )
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('die_args')
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+
     def ping(self):
         print 'ping()'
     
+    def die(self):
+        raise KeyboardInterrupt
+    
 
 class LocatorHandler(BaseHandler, Locator.Iface):
     def __init__(self, peer=None, port=9900):
  string         service_type ()
  list<string>   service_types()
  oneway void    debug        ()
+ oneway void    die          ()
 }
 
 service Locator extends Base {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.