Subversion Repositories SmartDukaan

Rev

Rev 1596 | Rev 1845 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1596 Rev 1673
Line 405... Line 405...
405
    Parameters:
405
    Parameters:
406
     - userType
406
     - userType
407
    """
407
    """
408
    pass
408
    pass
409
 
409
 
-
 
410
  def getAllUsers(self, userType):
-
 
411
    """
-
 
412
    Returns list of users of type userType. If userType is null, then returns all the users.
-
 
413
    
-
 
414
    Parameters:
-
 
415
     - userType
-
 
416
    """
-
 
417
    pass
-
 
418
 
410
 
419
 
411
class Client(Iface):
420
class Client(Iface):
412
  """
421
  """
413
  service
422
  service
414
  """
423
  """
Line 2005... Line 2014...
2005
    self._iprot.readMessageEnd()
2014
    self._iprot.readMessageEnd()
2006
    if result.success != None:
2015
    if result.success != None:
2007
      return result.success
2016
      return result.success
2008
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getUserCount failed: unknown result");
2017
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getUserCount failed: unknown result");
2009
 
2018
 
-
 
2019
  def getAllUsers(self, userType):
-
 
2020
    """
-
 
2021
    Returns list of users of type userType. If userType is null, then returns all the users.
-
 
2022
    
-
 
2023
    Parameters:
-
 
2024
     - userType
-
 
2025
    """
-
 
2026
    self.send_getAllUsers(userType)
-
 
2027
    return self.recv_getAllUsers()
-
 
2028
 
-
 
2029
  def send_getAllUsers(self, userType):
-
 
2030
    self._oprot.writeMessageBegin('getAllUsers', TMessageType.CALL, self._seqid)
-
 
2031
    args = getAllUsers_args()
-
 
2032
    args.userType = userType
-
 
2033
    args.write(self._oprot)
-
 
2034
    self._oprot.writeMessageEnd()
-
 
2035
    self._oprot.trans.flush()
-
 
2036
 
-
 
2037
  def recv_getAllUsers(self, ):
-
 
2038
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
2039
    if mtype == TMessageType.EXCEPTION:
-
 
2040
      x = TApplicationException()
-
 
2041
      x.read(self._iprot)
-
 
2042
      self._iprot.readMessageEnd()
-
 
2043
      raise x
-
 
2044
    result = getAllUsers_result()
-
 
2045
    result.read(self._iprot)
-
 
2046
    self._iprot.readMessageEnd()
-
 
2047
    if result.success != None:
-
 
2048
      return result.success
-
 
2049
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllUsers failed: unknown result");
-
 
2050
 
2010
 
2051
 
2011
class Processor(Iface, TProcessor):
2052
class Processor(Iface, TProcessor):
2012
  def __init__(self, handler):
2053
  def __init__(self, handler):
2013
    self._handler = handler
2054
    self._handler = handler
2014
    self._processMap = {}
2055
    self._processMap = {}
Line 2058... Line 2099...
2058
    self._processMap["deleteItemFromMyResearch"] = Processor.process_deleteItemFromMyResearch
2099
    self._processMap["deleteItemFromMyResearch"] = Processor.process_deleteItemFromMyResearch
2059
    self._processMap["updateBrowseHistory"] = Processor.process_updateBrowseHistory
2100
    self._processMap["updateBrowseHistory"] = Processor.process_updateBrowseHistory
2060
    self._processMap["getBrowseHistory"] = Processor.process_getBrowseHistory
2101
    self._processMap["getBrowseHistory"] = Processor.process_getBrowseHistory
2061
    self._processMap["mergeBrowseHistory"] = Processor.process_mergeBrowseHistory
2102
    self._processMap["mergeBrowseHistory"] = Processor.process_mergeBrowseHistory
2062
    self._processMap["getUserCount"] = Processor.process_getUserCount
2103
    self._processMap["getUserCount"] = Processor.process_getUserCount
-
 
2104
    self._processMap["getAllUsers"] = Processor.process_getAllUsers
2063
 
2105
 
2064
  def process(self, iprot, oprot):
2106
  def process(self, iprot, oprot):
2065
    (name, type, seqid) = iprot.readMessageBegin()
2107
    (name, type, seqid) = iprot.readMessageBegin()
2066
    if name not in self._processMap:
2108
    if name not in self._processMap:
2067
      iprot.skip(TType.STRUCT)
2109
      iprot.skip(TType.STRUCT)
Line 2731... Line 2773...
2731
    oprot.writeMessageBegin("getUserCount", TMessageType.REPLY, seqid)
2773
    oprot.writeMessageBegin("getUserCount", TMessageType.REPLY, seqid)
2732
    result.write(oprot)
2774
    result.write(oprot)
2733
    oprot.writeMessageEnd()
2775
    oprot.writeMessageEnd()
2734
    oprot.trans.flush()
2776
    oprot.trans.flush()
2735
 
2777
 
-
 
2778
  def process_getAllUsers(self, seqid, iprot, oprot):
-
 
2779
    args = getAllUsers_args()
-
 
2780
    args.read(iprot)
-
 
2781
    iprot.readMessageEnd()
-
 
2782
    result = getAllUsers_result()
-
 
2783
    result.success = self._handler.getAllUsers(args.userType)
-
 
2784
    oprot.writeMessageBegin("getAllUsers", TMessageType.REPLY, seqid)
-
 
2785
    result.write(oprot)
-
 
2786
    oprot.writeMessageEnd()
-
 
2787
    oprot.trans.flush()
-
 
2788
 
2736
 
2789
 
2737
# HELPER FUNCTIONS AND STRUCTURES
2790
# HELPER FUNCTIONS AND STRUCTURES
2738
 
2791
 
2739
class closeSession_args:
2792
class closeSession_args:
2740
 
2793
 
Line 8929... Line 8982...
8929
      oprot.writeFieldEnd()
8982
      oprot.writeFieldEnd()
8930
    oprot.writeFieldStop()
8983
    oprot.writeFieldStop()
8931
    oprot.writeStructEnd()
8984
    oprot.writeStructEnd()
8932
 
8985
 
8933
  def __repr__(self):
8986
  def __repr__(self):
-
 
8987
    L = ['%s=%r' % (key, value)
-
 
8988
      for key, value in self.__dict__.iteritems()]
-
 
8989
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
8990
 
-
 
8991
  def __eq__(self, other):
-
 
8992
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
8993
 
-
 
8994
  def __ne__(self, other):
-
 
8995
    return not (self == other)
-
 
8996
 
-
 
8997
class getAllUsers_args:
-
 
8998
  """
-
 
8999
  Attributes:
-
 
9000
   - userType
-
 
9001
  """
-
 
9002
 
-
 
9003
  thrift_spec = (
-
 
9004
    None, # 0
-
 
9005
    (1, TType.I32, 'userType', None, None, ), # 1
-
 
9006
  )
-
 
9007
 
-
 
9008
  def __init__(self, userType=None,):
-
 
9009
    self.userType = userType
-
 
9010
 
-
 
9011
  def read(self, iprot):
-
 
9012
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
9013
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
9014
      return
-
 
9015
    iprot.readStructBegin()
-
 
9016
    while True:
-
 
9017
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
9018
      if ftype == TType.STOP:
-
 
9019
        break
-
 
9020
      if fid == 1:
-
 
9021
        if ftype == TType.I32:
-
 
9022
          self.userType = iprot.readI32();
-
 
9023
        else:
-
 
9024
          iprot.skip(ftype)
-
 
9025
      else:
-
 
9026
        iprot.skip(ftype)
-
 
9027
      iprot.readFieldEnd()
-
 
9028
    iprot.readStructEnd()
-
 
9029
 
-
 
9030
  def write(self, oprot):
-
 
9031
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
9032
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
9033
      return
-
 
9034
    oprot.writeStructBegin('getAllUsers_args')
-
 
9035
    if self.userType != None:
-
 
9036
      oprot.writeFieldBegin('userType', TType.I32, 1)
-
 
9037
      oprot.writeI32(self.userType)
-
 
9038
      oprot.writeFieldEnd()
-
 
9039
    oprot.writeFieldStop()
-
 
9040
    oprot.writeStructEnd()
-
 
9041
 
-
 
9042
  def __repr__(self):
-
 
9043
    L = ['%s=%r' % (key, value)
-
 
9044
      for key, value in self.__dict__.iteritems()]
-
 
9045
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
9046
 
-
 
9047
  def __eq__(self, other):
-
 
9048
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
9049
 
-
 
9050
  def __ne__(self, other):
-
 
9051
    return not (self == other)
-
 
9052
 
-
 
9053
class getAllUsers_result:
-
 
9054
  """
-
 
9055
  Attributes:
-
 
9056
   - success
-
 
9057
  """
-
 
9058
 
-
 
9059
  thrift_spec = (
-
 
9060
    (0, TType.LIST, 'success', (TType.STRUCT,(User, User.thrift_spec)), None, ), # 0
-
 
9061
  )
-
 
9062
 
-
 
9063
  def __init__(self, success=None,):
-
 
9064
    self.success = success
-
 
9065
 
-
 
9066
  def read(self, iprot):
-
 
9067
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
9068
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
9069
      return
-
 
9070
    iprot.readStructBegin()
-
 
9071
    while True:
-
 
9072
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
9073
      if ftype == TType.STOP:
-
 
9074
        break
-
 
9075
      if fid == 0:
-
 
9076
        if ftype == TType.LIST:
-
 
9077
          self.success = []
-
 
9078
          (_etype82, _size79) = iprot.readListBegin()
-
 
9079
          for _i83 in xrange(_size79):
-
 
9080
            _elem84 = User()
-
 
9081
            _elem84.read(iprot)
-
 
9082
            self.success.append(_elem84)
-
 
9083
          iprot.readListEnd()
-
 
9084
        else:
-
 
9085
          iprot.skip(ftype)
-
 
9086
      else:
-
 
9087
        iprot.skip(ftype)
-
 
9088
      iprot.readFieldEnd()
-
 
9089
    iprot.readStructEnd()
-
 
9090
 
-
 
9091
  def write(self, oprot):
-
 
9092
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
9093
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
9094
      return
-
 
9095
    oprot.writeStructBegin('getAllUsers_result')
-
 
9096
    if self.success != None:
-
 
9097
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
9098
      oprot.writeListBegin(TType.STRUCT, len(self.success))
-
 
9099
      for iter85 in self.success:
-
 
9100
        iter85.write(oprot)
-
 
9101
      oprot.writeListEnd()
-
 
9102
      oprot.writeFieldEnd()
-
 
9103
    oprot.writeFieldStop()
-
 
9104
    oprot.writeStructEnd()
-
 
9105
 
-
 
9106
  def __repr__(self):
8934
    L = ['%s=%r' % (key, value)
9107
    L = ['%s=%r' % (key, value)
8935
      for key, value in self.__dict__.iteritems()]
9108
      for key, value in self.__dict__.iteritems()]
8936
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
9109
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
8937
 
9110
 
8938
  def __eq__(self, other):
9111
  def __eq__(self, other):