Subversion Repositories SmartDukaan

Rev

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

Rev 777 Rev 866
Line 28... Line 28...
28
    Parameters:
28
    Parameters:
29
     - id
29
     - id
30
    """
30
    """
31
    pass
31
    pass
32
 
32
 
-
 
33
  def getAddressId(self, ):
-
 
34
    pass
-
 
35
 
-
 
36
  def getAddress(self, ):
-
 
37
    pass
-
 
38
 
33
  def createUser(self, name):
39
  def createUser(self, name):
34
    """
40
    """
35
    Parameters:
41
    Parameters:
36
     - name
42
     - name
37
    """
43
    """
Line 104... Line 110...
104
    self._iprot.readMessageEnd()
110
    self._iprot.readMessageEnd()
105
    if result.success != None:
111
    if result.success != None:
106
      return result.success
112
      return result.success
107
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getUser failed: unknown result");
113
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getUser failed: unknown result");
108
 
114
 
-
 
115
  def getAddressId(self, ):
-
 
116
    self.send_getAddressId()
-
 
117
    return self.recv_getAddressId()
-
 
118
 
-
 
119
  def send_getAddressId(self, ):
-
 
120
    self._oprot.writeMessageBegin('getAddressId', TMessageType.CALL, self._seqid)
-
 
121
    args = getAddressId_args()
-
 
122
    args.write(self._oprot)
-
 
123
    self._oprot.writeMessageEnd()
-
 
124
    self._oprot.trans.flush()
-
 
125
 
-
 
126
  def recv_getAddressId(self, ):
-
 
127
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
128
    if mtype == TMessageType.EXCEPTION:
-
 
129
      x = TApplicationException()
-
 
130
      x.read(self._iprot)
-
 
131
      self._iprot.readMessageEnd()
-
 
132
      raise x
-
 
133
    result = getAddressId_result()
-
 
134
    result.read(self._iprot)
-
 
135
    self._iprot.readMessageEnd()
-
 
136
    if result.success != None:
-
 
137
      return result.success
-
 
138
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAddressId failed: unknown result");
-
 
139
 
-
 
140
  def getAddress(self, ):
-
 
141
    self.send_getAddress()
-
 
142
    return self.recv_getAddress()
-
 
143
 
-
 
144
  def send_getAddress(self, ):
-
 
145
    self._oprot.writeMessageBegin('getAddress', TMessageType.CALL, self._seqid)
-
 
146
    args = getAddress_args()
-
 
147
    args.write(self._oprot)
-
 
148
    self._oprot.writeMessageEnd()
-
 
149
    self._oprot.trans.flush()
-
 
150
 
-
 
151
  def recv_getAddress(self, ):
-
 
152
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
153
    if mtype == TMessageType.EXCEPTION:
-
 
154
      x = TApplicationException()
-
 
155
      x.read(self._iprot)
-
 
156
      self._iprot.readMessageEnd()
-
 
157
      raise x
-
 
158
    result = getAddress_result()
-
 
159
    result.read(self._iprot)
-
 
160
    self._iprot.readMessageEnd()
-
 
161
    if result.success != None:
-
 
162
      return result.success
-
 
163
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAddress failed: unknown result");
-
 
164
 
109
  def createUser(self, name):
165
  def createUser(self, name):
110
    """
166
    """
111
    Parameters:
167
    Parameters:
112
     - name
168
     - name
113
    """
169
    """
Line 162... Line 218...
162
  def __init__(self, handler):
218
  def __init__(self, handler):
163
    self._handler = handler
219
    self._handler = handler
164
    self._processMap = {}
220
    self._processMap = {}
165
    self._processMap["sayHello"] = Processor.process_sayHello
221
    self._processMap["sayHello"] = Processor.process_sayHello
166
    self._processMap["getUser"] = Processor.process_getUser
222
    self._processMap["getUser"] = Processor.process_getUser
-
 
223
    self._processMap["getAddressId"] = Processor.process_getAddressId
-
 
224
    self._processMap["getAddress"] = Processor.process_getAddress
167
    self._processMap["createUser"] = Processor.process_createUser
225
    self._processMap["createUser"] = Processor.process_createUser
168
    self._processMap["closeSession"] = Processor.process_closeSession
226
    self._processMap["closeSession"] = Processor.process_closeSession
169
 
227
 
170
  def process(self, iprot, oprot):
228
  def process(self, iprot, oprot):
171
    (name, type, seqid) = iprot.readMessageBegin()
229
    (name, type, seqid) = iprot.readMessageBegin()
Line 202... Line 260...
202
    oprot.writeMessageBegin("getUser", TMessageType.REPLY, seqid)
260
    oprot.writeMessageBegin("getUser", TMessageType.REPLY, seqid)
203
    result.write(oprot)
261
    result.write(oprot)
204
    oprot.writeMessageEnd()
262
    oprot.writeMessageEnd()
205
    oprot.trans.flush()
263
    oprot.trans.flush()
206
 
264
 
-
 
265
  def process_getAddressId(self, seqid, iprot, oprot):
-
 
266
    args = getAddressId_args()
-
 
267
    args.read(iprot)
-
 
268
    iprot.readMessageEnd()
-
 
269
    result = getAddressId_result()
-
 
270
    result.success = self._handler.getAddressId()
-
 
271
    oprot.writeMessageBegin("getAddressId", TMessageType.REPLY, seqid)
-
 
272
    result.write(oprot)
-
 
273
    oprot.writeMessageEnd()
-
 
274
    oprot.trans.flush()
-
 
275
 
-
 
276
  def process_getAddress(self, seqid, iprot, oprot):
-
 
277
    args = getAddress_args()
-
 
278
    args.read(iprot)
-
 
279
    iprot.readMessageEnd()
-
 
280
    result = getAddress_result()
-
 
281
    result.success = self._handler.getAddress()
-
 
282
    oprot.writeMessageBegin("getAddress", TMessageType.REPLY, seqid)
-
 
283
    result.write(oprot)
-
 
284
    oprot.writeMessageEnd()
-
 
285
    oprot.trans.flush()
-
 
286
 
207
  def process_createUser(self, seqid, iprot, oprot):
287
  def process_createUser(self, seqid, iprot, oprot):
208
    args = createUser_args()
288
    args = createUser_args()
209
    args.read(iprot)
289
    args.read(iprot)
210
    iprot.readMessageEnd()
290
    iprot.readMessageEnd()
211
    result = createUser_result()
291
    result = createUser_result()
Line 422... Line 502...
422
      oprot.writeFieldEnd()
502
      oprot.writeFieldEnd()
423
    oprot.writeFieldStop()
503
    oprot.writeFieldStop()
424
    oprot.writeStructEnd()
504
    oprot.writeStructEnd()
425
 
505
 
426
  def __repr__(self):
506
  def __repr__(self):
-
 
507
    L = ['%s=%r' % (key, value)
-
 
508
      for key, value in self.__dict__.iteritems()]
-
 
509
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
510
 
-
 
511
  def __eq__(self, other):
-
 
512
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
513
 
-
 
514
  def __ne__(self, other):
-
 
515
    return not (self == other)
-
 
516
 
-
 
517
class getAddressId_args:
-
 
518
 
-
 
519
  thrift_spec = (
-
 
520
  )
-
 
521
 
-
 
522
  def read(self, iprot):
-
 
523
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
524
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
525
      return
-
 
526
    iprot.readStructBegin()
-
 
527
    while True:
-
 
528
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
529
      if ftype == TType.STOP:
-
 
530
        break
-
 
531
      else:
-
 
532
        iprot.skip(ftype)
-
 
533
      iprot.readFieldEnd()
-
 
534
    iprot.readStructEnd()
-
 
535
 
-
 
536
  def write(self, oprot):
-
 
537
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
538
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
539
      return
-
 
540
    oprot.writeStructBegin('getAddressId_args')
-
 
541
    oprot.writeFieldStop()
-
 
542
    oprot.writeStructEnd()
-
 
543
 
-
 
544
  def __repr__(self):
-
 
545
    L = ['%s=%r' % (key, value)
-
 
546
      for key, value in self.__dict__.iteritems()]
-
 
547
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
548
 
-
 
549
  def __eq__(self, other):
-
 
550
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
551
 
-
 
552
  def __ne__(self, other):
-
 
553
    return not (self == other)
-
 
554
 
-
 
555
class getAddressId_result:
-
 
556
  """
-
 
557
  Attributes:
-
 
558
   - success
-
 
559
  """
-
 
560
 
-
 
561
  thrift_spec = (
-
 
562
    (0, TType.I64, 'success', None, None, ), # 0
-
 
563
  )
-
 
564
 
-
 
565
  def __init__(self, success=None,):
-
 
566
    self.success = success
-
 
567
 
-
 
568
  def read(self, iprot):
-
 
569
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
570
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
571
      return
-
 
572
    iprot.readStructBegin()
-
 
573
    while True:
-
 
574
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
575
      if ftype == TType.STOP:
-
 
576
        break
-
 
577
      if fid == 0:
-
 
578
        if ftype == TType.I64:
-
 
579
          self.success = iprot.readI64();
-
 
580
        else:
-
 
581
          iprot.skip(ftype)
-
 
582
      else:
-
 
583
        iprot.skip(ftype)
-
 
584
      iprot.readFieldEnd()
-
 
585
    iprot.readStructEnd()
-
 
586
 
-
 
587
  def write(self, oprot):
-
 
588
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
589
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
590
      return
-
 
591
    oprot.writeStructBegin('getAddressId_result')
-
 
592
    if self.success != None:
-
 
593
      oprot.writeFieldBegin('success', TType.I64, 0)
-
 
594
      oprot.writeI64(self.success)
-
 
595
      oprot.writeFieldEnd()
-
 
596
    oprot.writeFieldStop()
-
 
597
    oprot.writeStructEnd()
-
 
598
 
-
 
599
  def __repr__(self):
-
 
600
    L = ['%s=%r' % (key, value)
-
 
601
      for key, value in self.__dict__.iteritems()]
-
 
602
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
603
 
-
 
604
  def __eq__(self, other):
-
 
605
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
606
 
-
 
607
  def __ne__(self, other):
-
 
608
    return not (self == other)
-
 
609
 
-
 
610
class getAddress_args:
-
 
611
 
-
 
612
  thrift_spec = (
-
 
613
  )
-
 
614
 
-
 
615
  def read(self, iprot):
-
 
616
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
617
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
618
      return
-
 
619
    iprot.readStructBegin()
-
 
620
    while True:
-
 
621
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
622
      if ftype == TType.STOP:
-
 
623
        break
-
 
624
      else:
-
 
625
        iprot.skip(ftype)
-
 
626
      iprot.readFieldEnd()
-
 
627
    iprot.readStructEnd()
-
 
628
 
-
 
629
  def write(self, oprot):
-
 
630
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
631
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
632
      return
-
 
633
    oprot.writeStructBegin('getAddress_args')
-
 
634
    oprot.writeFieldStop()
-
 
635
    oprot.writeStructEnd()
-
 
636
 
-
 
637
  def __repr__(self):
-
 
638
    L = ['%s=%r' % (key, value)
-
 
639
      for key, value in self.__dict__.iteritems()]
-
 
640
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
641
 
-
 
642
  def __eq__(self, other):
-
 
643
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
644
 
-
 
645
  def __ne__(self, other):
-
 
646
    return not (self == other)
-
 
647
 
-
 
648
class getAddress_result:
-
 
649
  """
-
 
650
  Attributes:
-
 
651
   - success
-
 
652
  """
-
 
653
 
-
 
654
  thrift_spec = (
-
 
655
    (0, TType.STRUCT, 'success', (Address, Address.thrift_spec), None, ), # 0
-
 
656
  )
-
 
657
 
-
 
658
  def __init__(self, success=None,):
-
 
659
    self.success = success
-
 
660
 
-
 
661
  def read(self, iprot):
-
 
662
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
663
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
664
      return
-
 
665
    iprot.readStructBegin()
-
 
666
    while True:
-
 
667
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
668
      if ftype == TType.STOP:
-
 
669
        break
-
 
670
      if fid == 0:
-
 
671
        if ftype == TType.STRUCT:
-
 
672
          self.success = Address()
-
 
673
          self.success.read(iprot)
-
 
674
        else:
-
 
675
          iprot.skip(ftype)
-
 
676
      else:
-
 
677
        iprot.skip(ftype)
-
 
678
      iprot.readFieldEnd()
-
 
679
    iprot.readStructEnd()
-
 
680
 
-
 
681
  def write(self, oprot):
-
 
682
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
683
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
684
      return
-
 
685
    oprot.writeStructBegin('getAddress_result')
-
 
686
    if self.success != None:
-
 
687
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
-
 
688
      self.success.write(oprot)
-
 
689
      oprot.writeFieldEnd()
-
 
690
    oprot.writeFieldStop()
-
 
691
    oprot.writeStructEnd()
-
 
692
 
-
 
693
  def __repr__(self):
427
    L = ['%s=%r' % (key, value)
694
    L = ['%s=%r' % (key, value)
428
      for key, value in self.__dict__.iteritems()]
695
      for key, value in self.__dict__.iteritems()]
429
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
696
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
430
 
697
 
431
  def __eq__(self, other):
698
  def __eq__(self, other):