Subversion Repositories SmartDukaan

Rev

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

Rev 349 Rev 353
Line 236... Line 236...
236
    """
236
    """
237
    Parameters:
237
    Parameters:
238
     - id
238
     - id
239
    """
239
    """
240
    self.send_getMessage(id)
240
    self.send_getMessage(id)
241
    self.recv_getMessage()
241
    return self.recv_getMessage()
242
 
242
 
243
  def send_getMessage(self, id):
243
  def send_getMessage(self, id):
244
    self._oprot.writeMessageBegin('getMessage', TMessageType.CALL, self._seqid)
244
    self._oprot.writeMessageBegin('getMessage', TMessageType.CALL, self._seqid)
245
    args = getMessage_args()
245
    args = getMessage_args()
246
    args.id = id
246
    args.id = id
Line 256... Line 256...
256
      self._iprot.readMessageEnd()
256
      self._iprot.readMessageEnd()
257
      raise x
257
      raise x
258
    result = getMessage_result()
258
    result = getMessage_result()
259
    result.read(self._iprot)
259
    result.read(self._iprot)
260
    self._iprot.readMessageEnd()
260
    self._iprot.readMessageEnd()
-
 
261
    if result.success != None:
-
 
262
      return result.success
261
    if result.se != None:
263
    if result.se != None:
262
      raise result.se
264
      raise result.se
263
    return
-
 
-
 
265
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getMessage failed: unknown result");
264
 
266
 
265
  def getSubstitutedMessage(self, id, params):
267
  def getSubstitutedMessage(self, id, params):
266
    """
268
    """
267
    Parameters:
269
    Parameters:
268
     - id
270
     - id
269
     - params
271
     - params
270
    """
272
    """
271
    self.send_getSubstitutedMessage(id, params)
273
    self.send_getSubstitutedMessage(id, params)
272
    self.recv_getSubstitutedMessage()
274
    return self.recv_getSubstitutedMessage()
273
 
275
 
274
  def send_getSubstitutedMessage(self, id, params):
276
  def send_getSubstitutedMessage(self, id, params):
275
    self._oprot.writeMessageBegin('getSubstitutedMessage', TMessageType.CALL, self._seqid)
277
    self._oprot.writeMessageBegin('getSubstitutedMessage', TMessageType.CALL, self._seqid)
276
    args = getSubstitutedMessage_args()
278
    args = getSubstitutedMessage_args()
277
    args.id = id
279
    args.id = id
Line 288... Line 290...
288
      self._iprot.readMessageEnd()
290
      self._iprot.readMessageEnd()
289
      raise x
291
      raise x
290
    result = getSubstitutedMessage_result()
292
    result = getSubstitutedMessage_result()
291
    result.read(self._iprot)
293
    result.read(self._iprot)
292
    self._iprot.readMessageEnd()
294
    self._iprot.readMessageEnd()
-
 
295
    if result.success != None:
-
 
296
      return result.success
293
    if result.se != None:
297
    if result.se != None:
294
      raise result.se
298
      raise result.se
295
    return
-
 
-
 
299
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getSubstitutedMessage failed: unknown result");
296
 
300
 
297
 
301
 
298
class Processor(Iface, TProcessor):
302
class Processor(Iface, TProcessor):
299
  def __init__(self, handler):
303
  def __init__(self, handler):
300
    self._handler = handler
304
    self._handler = handler
Line 396... Line 400...
396
    args = getMessage_args()
400
    args = getMessage_args()
397
    args.read(iprot)
401
    args.read(iprot)
398
    iprot.readMessageEnd()
402
    iprot.readMessageEnd()
399
    result = getMessage_result()
403
    result = getMessage_result()
400
    try:
404
    try:
401
      self._handler.getMessage(args.id)
405
      result.success = self._handler.getMessage(args.id)
402
    except HelperServiceException, se:
406
    except HelperServiceException, se:
403
      result.se = se
407
      result.se = se
404
    oprot.writeMessageBegin("getMessage", TMessageType.REPLY, seqid)
408
    oprot.writeMessageBegin("getMessage", TMessageType.REPLY, seqid)
405
    result.write(oprot)
409
    result.write(oprot)
406
    oprot.writeMessageEnd()
410
    oprot.writeMessageEnd()
Line 410... Line 414...
410
    args = getSubstitutedMessage_args()
414
    args = getSubstitutedMessage_args()
411
    args.read(iprot)
415
    args.read(iprot)
412
    iprot.readMessageEnd()
416
    iprot.readMessageEnd()
413
    result = getSubstitutedMessage_result()
417
    result = getSubstitutedMessage_result()
414
    try:
418
    try:
415
      self._handler.getSubstitutedMessage(args.id, args.params)
419
      result.success = self._handler.getSubstitutedMessage(args.id, args.params)
416
    except HelperServiceException, se:
420
    except HelperServiceException, se:
417
      result.se = se
421
      result.se = se
418
    oprot.writeMessageBegin("getSubstitutedMessage", TMessageType.REPLY, seqid)
422
    oprot.writeMessageBegin("getSubstitutedMessage", TMessageType.REPLY, seqid)
419
    result.write(oprot)
423
    result.write(oprot)
420
    oprot.writeMessageEnd()
424
    oprot.writeMessageEnd()
Line 455... Line 459...
455
        else:
459
        else:
456
          iprot.skip(ftype)
460
          iprot.skip(ftype)
457
      elif fid == 2:
461
      elif fid == 2:
458
        if ftype == TType.MAP:
462
        if ftype == TType.MAP:
459
          self.location = {}
463
          self.location = {}
460
          (_ktype8, _vtype9, _size7 ) = iprot.readMapBegin() 
464
          (_ktype15, _vtype16, _size14 ) = iprot.readMapBegin() 
461
          for _i11 in xrange(_size7):
465
          for _i18 in xrange(_size14):
462
            _key12 = iprot.readString();
466
            _key19 = iprot.readString();
463
            _val13 = iprot.readString();
467
            _val20 = iprot.readString();
464
            self.location[_key12] = _val13
468
            self.location[_key19] = _val20
465
          iprot.readMapEnd()
469
          iprot.readMapEnd()
466
        else:
470
        else:
467
          iprot.skip(ftype)
471
          iprot.skip(ftype)
468
      else:
472
      else:
469
        iprot.skip(ftype)
473
        iprot.skip(ftype)
Line 480... Line 484...
480
      oprot.writeI64(self.itemId)
484
      oprot.writeI64(self.itemId)
481
      oprot.writeFieldEnd()
485
      oprot.writeFieldEnd()
482
    if self.location != None:
486
    if self.location != None:
483
      oprot.writeFieldBegin('location', TType.MAP, 2)
487
      oprot.writeFieldBegin('location', TType.MAP, 2)
484
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.location))
488
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.location))
485
      for kiter14,viter15 in self.location.items():
489
      for kiter21,viter22 in self.location.items():
486
        oprot.writeString(kiter14)
490
        oprot.writeString(kiter21)
487
        oprot.writeString(viter15)
491
        oprot.writeString(viter22)
488
      oprot.writeMapEnd()
492
      oprot.writeMapEnd()
489
      oprot.writeFieldEnd()
493
      oprot.writeFieldEnd()
490
    oprot.writeFieldStop()
494
    oprot.writeFieldStop()
491
    oprot.writeStructEnd()
495
    oprot.writeStructEnd()
492
 
496
 
Line 527... Line 531...
527
      if ftype == TType.STOP:
531
      if ftype == TType.STOP:
528
        break
532
        break
529
      if fid == 0:
533
      if fid == 0:
530
        if ftype == TType.LIST:
534
        if ftype == TType.LIST:
531
          self.success = []
535
          self.success = []
532
          (_etype19, _size16) = iprot.readListBegin()
536
          (_etype26, _size23) = iprot.readListBegin()
533
          for _i20 in xrange(_size16):
537
          for _i27 in xrange(_size23):
534
            _elem21 = ItemLogistics()
538
            _elem28 = ItemLogistics()
535
            _elem21.read(iprot)
539
            _elem28.read(iprot)
536
            self.success.append(_elem21)
540
            self.success.append(_elem28)
537
          iprot.readListEnd()
541
          iprot.readListEnd()
538
        else:
542
        else:
539
          iprot.skip(ftype)
543
          iprot.skip(ftype)
540
      elif fid == 1:
544
      elif fid == 1:
541
        if ftype == TType.STRUCT:
545
        if ftype == TType.STRUCT:
Line 554... Line 558...
554
      return
558
      return
555
    oprot.writeStructBegin('getLogisticsEstimation_result')
559
    oprot.writeStructBegin('getLogisticsEstimation_result')
556
    if self.success != None:
560
    if self.success != None:
557
      oprot.writeFieldBegin('success', TType.LIST, 0)
561
      oprot.writeFieldBegin('success', TType.LIST, 0)
558
      oprot.writeListBegin(TType.STRUCT, len(self.success))
562
      oprot.writeListBegin(TType.STRUCT, len(self.success))
559
      for iter22 in self.success:
563
      for iter29 in self.success:
560
        iter22.write(oprot)
564
        iter29.write(oprot)
561
      oprot.writeListEnd()
565
      oprot.writeListEnd()
562
      oprot.writeFieldEnd()
566
      oprot.writeFieldEnd()
563
    if self.se != None:
567
    if self.se != None:
564
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
568
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
565
      self.se.write(oprot)
569
      self.se.write(oprot)
Line 1102... Line 1106...
1102
    return not (self == other)
1106
    return not (self == other)
1103
 
1107
 
1104
class getMessage_result:
1108
class getMessage_result:
1105
  """
1109
  """
1106
  Attributes:
1110
  Attributes:
-
 
1111
   - success
1107
   - se
1112
   - se
1108
  """
1113
  """
1109
 
1114
 
1110
  thrift_spec = (
1115
  thrift_spec = (
1111
    None, # 0
1116
    (0, TType.STRUCT, 'success', (Message, Message.thrift_spec), None, ), # 0
1112
    (1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
1117
    (1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
1113
  )
1118
  )
1114
 
1119
 
1115
  def __init__(self, se=None,):
1120
  def __init__(self, success=None, se=None,):
-
 
1121
    self.success = success
1116
    self.se = se
1122
    self.se = se
1117
 
1123
 
1118
  def read(self, iprot):
1124
  def read(self, iprot):
1119
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1125
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1120
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1126
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
Line 1122... Line 1128...
1122
    iprot.readStructBegin()
1128
    iprot.readStructBegin()
1123
    while True:
1129
    while True:
1124
      (fname, ftype, fid) = iprot.readFieldBegin()
1130
      (fname, ftype, fid) = iprot.readFieldBegin()
1125
      if ftype == TType.STOP:
1131
      if ftype == TType.STOP:
1126
        break
1132
        break
1127
      if fid == 1:
1133
      if fid == 0:
-
 
1134
        if ftype == TType.STRUCT:
-
 
1135
          self.success = Message()
-
 
1136
          self.success.read(iprot)
-
 
1137
        else:
-
 
1138
          iprot.skip(ftype)
-
 
1139
      elif fid == 1:
1128
        if ftype == TType.STRUCT:
1140
        if ftype == TType.STRUCT:
1129
          self.se = HelperServiceException()
1141
          self.se = HelperServiceException()
1130
          self.se.read(iprot)
1142
          self.se.read(iprot)
1131
        else:
1143
        else:
1132
          iprot.skip(ftype)
1144
          iprot.skip(ftype)
Line 1138... Line 1150...
1138
  def write(self, oprot):
1150
  def write(self, oprot):
1139
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1151
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1140
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1152
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1141
      return
1153
      return
1142
    oprot.writeStructBegin('getMessage_result')
1154
    oprot.writeStructBegin('getMessage_result')
-
 
1155
    if self.success != None:
-
 
1156
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
-
 
1157
      self.success.write(oprot)
-
 
1158
      oprot.writeFieldEnd()
1143
    if self.se != None:
1159
    if self.se != None:
1144
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
1160
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
1145
      self.se.write(oprot)
1161
      self.se.write(oprot)
1146
      oprot.writeFieldEnd()
1162
      oprot.writeFieldEnd()
1147
    oprot.writeFieldStop()
1163
    oprot.writeFieldStop()
Line 1190... Line 1206...
1190
        else:
1206
        else:
1191
          iprot.skip(ftype)
1207
          iprot.skip(ftype)
1192
      elif fid == 2:
1208
      elif fid == 2:
1193
        if ftype == TType.MAP:
1209
        if ftype == TType.MAP:
1194
          self.params = {}
1210
          self.params = {}
1195
          (_ktype24, _vtype25, _size23 ) = iprot.readMapBegin() 
1211
          (_ktype31, _vtype32, _size30 ) = iprot.readMapBegin() 
1196
          for _i27 in xrange(_size23):
1212
          for _i34 in xrange(_size30):
1197
            _key28 = iprot.readString();
1213
            _key35 = iprot.readString();
1198
            _val29 = iprot.readString();
1214
            _val36 = iprot.readString();
1199
            self.params[_key28] = _val29
1215
            self.params[_key35] = _val36
1200
          iprot.readMapEnd()
1216
          iprot.readMapEnd()
1201
        else:
1217
        else:
1202
          iprot.skip(ftype)
1218
          iprot.skip(ftype)
1203
      else:
1219
      else:
1204
        iprot.skip(ftype)
1220
        iprot.skip(ftype)
Line 1215... Line 1231...
1215
      oprot.writeI64(self.id)
1231
      oprot.writeI64(self.id)
1216
      oprot.writeFieldEnd()
1232
      oprot.writeFieldEnd()
1217
    if self.params != None:
1233
    if self.params != None:
1218
      oprot.writeFieldBegin('params', TType.MAP, 2)
1234
      oprot.writeFieldBegin('params', TType.MAP, 2)
1219
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.params))
1235
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.params))
1220
      for kiter30,viter31 in self.params.items():
1236
      for kiter37,viter38 in self.params.items():
1221
        oprot.writeString(kiter30)
1237
        oprot.writeString(kiter37)
1222
        oprot.writeString(viter31)
1238
        oprot.writeString(viter38)
1223
      oprot.writeMapEnd()
1239
      oprot.writeMapEnd()
1224
      oprot.writeFieldEnd()
1240
      oprot.writeFieldEnd()
1225
    oprot.writeFieldStop()
1241
    oprot.writeFieldStop()
1226
    oprot.writeStructEnd()
1242
    oprot.writeStructEnd()
1227
 
1243
 
Line 1237... Line 1253...
1237
    return not (self == other)
1253
    return not (self == other)
1238
 
1254
 
1239
class getSubstitutedMessage_result:
1255
class getSubstitutedMessage_result:
1240
  """
1256
  """
1241
  Attributes:
1257
  Attributes:
-
 
1258
   - success
1242
   - se
1259
   - se
1243
  """
1260
  """
1244
 
1261
 
1245
  thrift_spec = (
1262
  thrift_spec = (
1246
    None, # 0
1263
    (0, TType.STRUCT, 'success', (Message, Message.thrift_spec), None, ), # 0
1247
    (1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
1264
    (1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
1248
  )
1265
  )
1249
 
1266
 
1250
  def __init__(self, se=None,):
1267
  def __init__(self, success=None, se=None,):
-
 
1268
    self.success = success
1251
    self.se = se
1269
    self.se = se
1252
 
1270
 
1253
  def read(self, iprot):
1271
  def read(self, iprot):
1254
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1272
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1255
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1273
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
Line 1257... Line 1275...
1257
    iprot.readStructBegin()
1275
    iprot.readStructBegin()
1258
    while True:
1276
    while True:
1259
      (fname, ftype, fid) = iprot.readFieldBegin()
1277
      (fname, ftype, fid) = iprot.readFieldBegin()
1260
      if ftype == TType.STOP:
1278
      if ftype == TType.STOP:
1261
        break
1279
        break
1262
      if fid == 1:
1280
      if fid == 0:
-
 
1281
        if ftype == TType.STRUCT:
-
 
1282
          self.success = Message()
-
 
1283
          self.success.read(iprot)
-
 
1284
        else:
-
 
1285
          iprot.skip(ftype)
-
 
1286
      elif fid == 1:
1263
        if ftype == TType.STRUCT:
1287
        if ftype == TType.STRUCT:
1264
          self.se = HelperServiceException()
1288
          self.se = HelperServiceException()
1265
          self.se.read(iprot)
1289
          self.se.read(iprot)
1266
        else:
1290
        else:
1267
          iprot.skip(ftype)
1291
          iprot.skip(ftype)
Line 1273... Line 1297...
1273
  def write(self, oprot):
1297
  def write(self, oprot):
1274
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1298
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1275
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1299
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1276
      return
1300
      return
1277
    oprot.writeStructBegin('getSubstitutedMessage_result')
1301
    oprot.writeStructBegin('getSubstitutedMessage_result')
-
 
1302
    if self.success != None:
-
 
1303
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
-
 
1304
      self.success.write(oprot)
-
 
1305
      oprot.writeFieldEnd()
1278
    if self.se != None:
1306
    if self.se != None:
1279
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
1307
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
1280
      self.se.write(oprot)
1308
      self.se.write(oprot)
1281
      oprot.writeFieldEnd()
1309
      oprot.writeFieldEnd()
1282
    oprot.writeFieldStop()
1310
    oprot.writeFieldStop()