Subversion Repositories SmartDukaan

Rev

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

Rev 3103 Rev 3376
Line 3... Line 3...
3
#
3
#
4
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
4
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
#
5
#
6
 
6
 
7
from thrift.Thrift import *
7
from thrift.Thrift import *
-
 
8
import shop2020.thriftpy.generic.GenericService
8
from ttypes import *
9
from ttypes import *
9
from thrift.Thrift import TProcessor
10
from thrift.Thrift import TProcessor
10
from thrift.transport import TTransport
11
from thrift.transport import TTransport
11
from thrift.protocol import TBinaryProtocol
12
from thrift.protocol import TBinaryProtocol
12
try:
13
try:
13
  from thrift.protocol import fastbinary
14
  from thrift.protocol import fastbinary
14
except:
15
except:
15
  fastbinary = None
16
  fastbinary = None
16
 
17
 
17
 
18
 
18
class Iface:
-
 
19
  def closeSession(self, ):
-
 
20
    """
-
 
21
    For closing the open session in sqlalchemy
19
class Iface(shop2020.thriftpy.generic.GenericService.Iface):
22
    """
-
 
23
    pass
-
 
24
 
-
 
25
  def getProvider(self, providerId):
20
  def getProvider(self, providerId):
26
    """
21
    """
27
    Returns a provider for a given provider ID. Throws an exception if none found.
22
    Returns a provider for a given provider ID. Throws an exception if none found.
28
    
23
    
29
    Parameters:
24
    Parameters:
Line 121... Line 116...
121
     - destination_pincode
116
     - destination_pincode
122
    """
117
    """
123
    pass
118
    pass
124
 
119
 
125
 
120
 
126
class Client(Iface):
121
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
127
  def __init__(self, iprot, oprot=None):
122
  def __init__(self, iprot, oprot=None):
128
    self._iprot = self._oprot = iprot
-
 
129
    if oprot != None:
-
 
130
      self._oprot = oprot
-
 
131
    self._seqid = 0
-
 
132
 
-
 
133
  def closeSession(self, ):
-
 
134
    """
-
 
135
    For closing the open session in sqlalchemy
-
 
136
    """
-
 
137
    self.send_closeSession()
-
 
138
    self.recv_closeSession()
-
 
139
 
-
 
140
  def send_closeSession(self, ):
-
 
141
    self._oprot.writeMessageBegin('closeSession', TMessageType.CALL, self._seqid)
123
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
142
    args = closeSession_args()
-
 
143
    args.write(self._oprot)
-
 
144
    self._oprot.writeMessageEnd()
-
 
145
    self._oprot.trans.flush()
-
 
146
 
-
 
147
  def recv_closeSession(self, ):
-
 
148
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
149
    if mtype == TMessageType.EXCEPTION:
-
 
150
      x = TApplicationException()
-
 
151
      x.read(self._iprot)
-
 
152
      self._iprot.readMessageEnd()
-
 
153
      raise x
-
 
154
    result = closeSession_result()
-
 
155
    result.read(self._iprot)
-
 
156
    self._iprot.readMessageEnd()
-
 
157
    return
-
 
158
 
124
 
159
  def getProvider(self, providerId):
125
  def getProvider(self, providerId):
160
    """
126
    """
161
    Returns a provider for a given provider ID. Throws an exception if none found.
127
    Returns a provider for a given provider ID. Throws an exception if none found.
162
    
128
    
Line 505... Line 471...
505
    if result.success != None:
471
    if result.success != None:
506
      return result.success
472
      return result.success
507
    raise TApplicationException(TApplicationException.MISSING_RESULT, "isCodAllowed failed: unknown result");
473
    raise TApplicationException(TApplicationException.MISSING_RESULT, "isCodAllowed failed: unknown result");
508
 
474
 
509
 
475
 
510
class Processor(Iface, TProcessor):
476
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
511
  def __init__(self, handler):
477
  def __init__(self, handler):
512
    self._handler = handler
-
 
513
    self._processMap = {}
-
 
514
    self._processMap["closeSession"] = Processor.process_closeSession
478
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
515
    self._processMap["getProvider"] = Processor.process_getProvider
479
    self._processMap["getProvider"] = Processor.process_getProvider
516
    self._processMap["getAllProviders"] = Processor.process_getAllProviders
480
    self._processMap["getAllProviders"] = Processor.process_getAllProviders
517
    self._processMap["getLogisticsEstimation"] = Processor.process_getLogisticsEstimation
481
    self._processMap["getLogisticsEstimation"] = Processor.process_getLogisticsEstimation
518
    self._processMap["getLogisticsInfo"] = Processor.process_getLogisticsInfo
482
    self._processMap["getLogisticsInfo"] = Processor.process_getLogisticsInfo
519
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
483
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
Line 536... Line 500...
536
      return
500
      return
537
    else:
501
    else:
538
      self._processMap[name](self, seqid, iprot, oprot)
502
      self._processMap[name](self, seqid, iprot, oprot)
539
    return True
503
    return True
540
 
504
 
541
  def process_closeSession(self, seqid, iprot, oprot):
-
 
542
    args = closeSession_args()
-
 
543
    args.read(iprot)
-
 
544
    iprot.readMessageEnd()
-
 
545
    result = closeSession_result()
-
 
546
    self._handler.closeSession()
-
 
547
    oprot.writeMessageBegin("closeSession", TMessageType.REPLY, seqid)
-
 
548
    result.write(oprot)
-
 
549
    oprot.writeMessageEnd()
-
 
550
    oprot.trans.flush()
-
 
551
 
-
 
552
  def process_getProvider(self, seqid, iprot, oprot):
505
  def process_getProvider(self, seqid, iprot, oprot):
553
    args = getProvider_args()
506
    args = getProvider_args()
554
    args.read(iprot)
507
    args.read(iprot)
555
    iprot.readMessageEnd()
508
    iprot.readMessageEnd()
556
    result = getProvider_result()
509
    result = getProvider_result()
Line 681... Line 634...
681
    oprot.trans.flush()
634
    oprot.trans.flush()
682
 
635
 
683
 
636
 
684
# HELPER FUNCTIONS AND STRUCTURES
637
# HELPER FUNCTIONS AND STRUCTURES
685
 
638
 
686
class closeSession_args:
-
 
687
 
-
 
688
  thrift_spec = (
-
 
689
  )
-
 
690
 
-
 
691
  def read(self, iprot):
-
 
692
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
693
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
694
      return
-
 
695
    iprot.readStructBegin()
-
 
696
    while True:
-
 
697
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
698
      if ftype == TType.STOP:
-
 
699
        break
-
 
700
      else:
-
 
701
        iprot.skip(ftype)
-
 
702
      iprot.readFieldEnd()
-
 
703
    iprot.readStructEnd()
-
 
704
 
-
 
705
  def write(self, oprot):
-
 
706
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
707
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
708
      return
-
 
709
    oprot.writeStructBegin('closeSession_args')
-
 
710
    oprot.writeFieldStop()
-
 
711
    oprot.writeStructEnd()
-
 
712
 
-
 
713
  def __repr__(self):
-
 
714
    L = ['%s=%r' % (key, value)
-
 
715
      for key, value in self.__dict__.iteritems()]
-
 
716
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
717
 
-
 
718
  def __eq__(self, other):
-
 
719
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
720
 
-
 
721
  def __ne__(self, other):
-
 
722
    return not (self == other)
-
 
723
 
-
 
724
class closeSession_result:
-
 
725
 
-
 
726
  thrift_spec = (
-
 
727
  )
-
 
728
 
-
 
729
  def read(self, iprot):
-
 
730
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
731
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
732
      return
-
 
733
    iprot.readStructBegin()
-
 
734
    while True:
-
 
735
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
736
      if ftype == TType.STOP:
-
 
737
        break
-
 
738
      else:
-
 
739
        iprot.skip(ftype)
-
 
740
      iprot.readFieldEnd()
-
 
741
    iprot.readStructEnd()
-
 
742
 
-
 
743
  def write(self, oprot):
-
 
744
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
745
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
746
      return
-
 
747
    oprot.writeStructBegin('closeSession_result')
-
 
748
    oprot.writeFieldStop()
-
 
749
    oprot.writeStructEnd()
-
 
750
 
-
 
751
  def __repr__(self):
-
 
752
    L = ['%s=%r' % (key, value)
-
 
753
      for key, value in self.__dict__.iteritems()]
-
 
754
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
755
 
-
 
756
  def __eq__(self, other):
-
 
757
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
758
 
-
 
759
  def __ne__(self, other):
-
 
760
    return not (self == other)
-
 
761
 
-
 
762
class getProvider_args:
639
class getProvider_args:
763
  """
640
  """
764
  Attributes:
641
  Attributes:
765
   - providerId
642
   - providerId
766
  """
643
  """