Subversion Repositories SmartDukaan

Rev

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

Rev 759 Rev 765
Line 14... Line 14...
14
except:
14
except:
15
  fastbinary = None
15
  fastbinary = None
16
 
16
 
17
 
17
 
18
class Iface:
18
class Iface:
-
 
19
  def closeSession(self, ):
-
 
20
    """
-
 
21
    For closing the open session in sqlalchemy
-
 
22
    """
-
 
23
    pass
-
 
24
 
19
  def createTransaction(self, transaction):
25
  def createTransaction(self, transaction):
20
    """
26
    """
21
    Parameters:
27
    Parameters:
22
     - transaction
28
     - transaction
23
    """
29
    """
Line 164... Line 170...
164
    self._iprot = self._oprot = iprot
170
    self._iprot = self._oprot = iprot
165
    if oprot != None:
171
    if oprot != None:
166
      self._oprot = oprot
172
      self._oprot = oprot
167
    self._seqid = 0
173
    self._seqid = 0
168
 
174
 
-
 
175
  def closeSession(self, ):
-
 
176
    """
-
 
177
    For closing the open session in sqlalchemy
-
 
178
    """
-
 
179
    self.send_closeSession()
-
 
180
    self.recv_closeSession()
-
 
181
 
-
 
182
  def send_closeSession(self, ):
-
 
183
    self._oprot.writeMessageBegin('closeSession', TMessageType.CALL, self._seqid)
-
 
184
    args = closeSession_args()
-
 
185
    args.write(self._oprot)
-
 
186
    self._oprot.writeMessageEnd()
-
 
187
    self._oprot.trans.flush()
-
 
188
 
-
 
189
  def recv_closeSession(self, ):
-
 
190
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
191
    if mtype == TMessageType.EXCEPTION:
-
 
192
      x = TApplicationException()
-
 
193
      x.read(self._iprot)
-
 
194
      self._iprot.readMessageEnd()
-
 
195
      raise x
-
 
196
    result = closeSession_result()
-
 
197
    result.read(self._iprot)
-
 
198
    self._iprot.readMessageEnd()
-
 
199
    return
-
 
200
 
169
  def createTransaction(self, transaction):
201
  def createTransaction(self, transaction):
170
    """
202
    """
171
    Parameters:
203
    Parameters:
172
     - transaction
204
     - transaction
173
    """
205
    """
Line 751... Line 783...
751
 
783
 
752
class Processor(Iface, TProcessor):
784
class Processor(Iface, TProcessor):
753
  def __init__(self, handler):
785
  def __init__(self, handler):
754
    self._handler = handler
786
    self._handler = handler
755
    self._processMap = {}
787
    self._processMap = {}
-
 
788
    self._processMap["closeSession"] = Processor.process_closeSession
756
    self._processMap["createTransaction"] = Processor.process_createTransaction
789
    self._processMap["createTransaction"] = Processor.process_createTransaction
757
    self._processMap["getTransaction"] = Processor.process_getTransaction
790
    self._processMap["getTransaction"] = Processor.process_getTransaction
758
    self._processMap["getTransactionsForCustomer"] = Processor.process_getTransactionsForCustomer
791
    self._processMap["getTransactionsForCustomer"] = Processor.process_getTransactionsForCustomer
759
    self._processMap["getTransactionsForShoppingCartId"] = Processor.process_getTransactionsForShoppingCartId
792
    self._processMap["getTransactionsForShoppingCartId"] = Processor.process_getTransactionsForShoppingCartId
760
    self._processMap["getTransactionStatus"] = Processor.process_getTransactionStatus
793
    self._processMap["getTransactionStatus"] = Processor.process_getTransactionStatus
Line 784... Line 817...
784
      return
817
      return
785
    else:
818
    else:
786
      self._processMap[name](self, seqid, iprot, oprot)
819
      self._processMap[name](self, seqid, iprot, oprot)
787
    return True
820
    return True
788
 
821
 
-
 
822
  def process_closeSession(self, seqid, iprot, oprot):
-
 
823
    args = closeSession_args()
-
 
824
    args.read(iprot)
-
 
825
    iprot.readMessageEnd()
-
 
826
    result = closeSession_result()
-
 
827
    self._handler.closeSession()
-
 
828
    oprot.writeMessageBegin("closeSession", TMessageType.REPLY, seqid)
-
 
829
    result.write(oprot)
-
 
830
    oprot.writeMessageEnd()
-
 
831
    oprot.trans.flush()
-
 
832
 
789
  def process_createTransaction(self, seqid, iprot, oprot):
833
  def process_createTransaction(self, seqid, iprot, oprot):
790
    args = createTransaction_args()
834
    args = createTransaction_args()
791
    args.read(iprot)
835
    args.read(iprot)
792
    iprot.readMessageEnd()
836
    iprot.readMessageEnd()
793
    result = createTransaction_result()
837
    result = createTransaction_result()
Line 1019... Line 1063...
1019
    oprot.trans.flush()
1063
    oprot.trans.flush()
1020
 
1064
 
1021
 
1065
 
1022
# HELPER FUNCTIONS AND STRUCTURES
1066
# HELPER FUNCTIONS AND STRUCTURES
1023
 
1067
 
-
 
1068
class closeSession_args:
-
 
1069
 
-
 
1070
  thrift_spec = (
-
 
1071
  )
-
 
1072
 
-
 
1073
  def read(self, iprot):
-
 
1074
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1075
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1076
      return
-
 
1077
    iprot.readStructBegin()
-
 
1078
    while True:
-
 
1079
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1080
      if ftype == TType.STOP:
-
 
1081
        break
-
 
1082
      else:
-
 
1083
        iprot.skip(ftype)
-
 
1084
      iprot.readFieldEnd()
-
 
1085
    iprot.readStructEnd()
-
 
1086
 
-
 
1087
  def write(self, oprot):
-
 
1088
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1089
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1090
      return
-
 
1091
    oprot.writeStructBegin('closeSession_args')
-
 
1092
    oprot.writeFieldStop()
-
 
1093
    oprot.writeStructEnd()
-
 
1094
 
-
 
1095
  def __repr__(self):
-
 
1096
    L = ['%s=%r' % (key, value)
-
 
1097
      for key, value in self.__dict__.iteritems()]
-
 
1098
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1099
 
-
 
1100
  def __eq__(self, other):
-
 
1101
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1102
 
-
 
1103
  def __ne__(self, other):
-
 
1104
    return not (self == other)
-
 
1105
 
-
 
1106
class closeSession_result:
-
 
1107
 
-
 
1108
  thrift_spec = (
-
 
1109
  )
-
 
1110
 
-
 
1111
  def read(self, iprot):
-
 
1112
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1113
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1114
      return
-
 
1115
    iprot.readStructBegin()
-
 
1116
    while True:
-
 
1117
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1118
      if ftype == TType.STOP:
-
 
1119
        break
-
 
1120
      else:
-
 
1121
        iprot.skip(ftype)
-
 
1122
      iprot.readFieldEnd()
-
 
1123
    iprot.readStructEnd()
-
 
1124
 
-
 
1125
  def write(self, oprot):
-
 
1126
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1127
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1128
      return
-
 
1129
    oprot.writeStructBegin('closeSession_result')
-
 
1130
    oprot.writeFieldStop()
-
 
1131
    oprot.writeStructEnd()
-
 
1132
 
-
 
1133
  def __repr__(self):
-
 
1134
    L = ['%s=%r' % (key, value)
-
 
1135
      for key, value in self.__dict__.iteritems()]
-
 
1136
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1137
 
-
 
1138
  def __eq__(self, other):
-
 
1139
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1140
 
-
 
1141
  def __ne__(self, other):
-
 
1142
    return not (self == other)
-
 
1143
 
1024
class createTransaction_args:
1144
class createTransaction_args:
1025
  """
1145
  """
1026
  Attributes:
1146
  Attributes:
1027
   - transaction
1147
   - transaction
1028
  """
1148
  """