text: #
  # Autogenerated by Thrift Compiler (0.8.0)
  #
  # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  #
  #  options string: py
  #
  
  from thrift.Thrift import TType, TMessageType, TException
  from ttypes import *
  from thrift.Thrift import TProcessor
  from thrift.transport import TTransport
  from thrift.protocol import TBinaryProtocol, TProtocol
  try:
    from thrift.protocol import fastbinary
  except:
    fastbinary = None
  
  
  class Iface:
    def put(self, info):
      """
      Parameters:
       - info
      """
      pass
  
  
  class Client(Iface):
    def __init__(self, iprot, oprot=None):
      self._iprot = self._oprot = iprot
      if oprot is not None:
        self._oprot = oprot
      self._seqid = 0
  
    def put(self, info):
      """
      Parameters:
       - info
      """
      self.send_put(info)
      return self.recv_put()
  
    def send_put(self, info):
      self._oprot.writeMessageBegin('put', TMessageType.CALL, self._seqid)
      args = put_args()
      args.info = info
      args.write(self._oprot)
      self._oprot.writeMessageEnd()
      self._oprot.trans.flush()
  
    def recv_put(self, ):
      (fname, mtype, rseqid) = self._iprot.readMessageBegin()
      if mtype == TMessageType.EXCEPTION:
        x = TApplicationException()
        x.read(self._iprot)
        self._iprot.readMessageEnd()
        raise x
      result = put_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
      if result.success is not None:
        return result.success
      raise TApplicationException(TApplicationException.MISSING_RESULT, "put failed: unknown result");
  
  
  class Processor(Iface, TProcessor):
    def __init__(self, handler):
      self._handler = handler
      self._processMap = {}
      self._processMap["put"] = Processor.process_put
  
    def process(self, iprot, oprot):
      (name, type, seqid) = iprot.readMessageBegin()
      if name not in self._processMap:
        iprot.skip(TType.STRUCT)
        iprot.readMessageEnd()
        x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
        oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
        x.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()
        return
      else:
        self._processMap[name](self, seqid, iprot, oprot)
      return True
  
    def process_put(self, seqid, iprot, oprot):
      args = put_args()
      args.read(iprot)
      iprot.readMessageEnd()
      result = put_result()
      result.success = self._handler.put(args.info)
      oprot.writeMessageBegin("put", TMessageType.REPLY, seqid)
      result.write(oprot)
      oprot.writeMessageEnd()
      oprot.trans.flush()
  
  
  # HELPER FUNCTIONS AND STRUCTURES
  
  class put_args:
    """
    Attributes:
     - info
    """
  
    thrift_spec = (
      None, # 0
      (1, TType.STRUCT, 'info', (movie_info, movie_info.thrift_spec), None, ), # 1
    )
  
    def __init__(self, info=None,):
      self.info = info
  
    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
        if fid == 1:
          if ftype == TType.STRUCT:
            self.info = movie_info()
            self.info.read(iprot)
          else:
            iprot.skip(ftype)
        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('put_args')
      if self.info is not None:
        oprot.writeFieldBegin('info', TType.STRUCT, 1)
        self.info.write(oprot)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
  
    def validate(self):
      return
  
  
    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)
  
  class put_result:
    """
    Attributes:
     - success
    """
  
    thrift_spec = (
      (0, TType.I32, 'success', None, None, ), # 0
    )
  
    def __init__(self, success=None,):
      self.success = success
  
    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
        if fid == 0:
          if ftype == TType.I32:
            self.success = iprot.readI32();
          else:
            iprot.skip(ftype)
        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('put_result')
      if self.success is not None:
        oprot.writeFieldBegin('success', TType.I32, 0)
        oprot.writeI32(self.success)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
  
    def validate(self):
      return
  
  
    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)
  