Subversion Repositories SmartDukaan

Rev

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

Rev 4501 Rev 4541
Line 302... Line 302...
302
    result = getInventoryItem_result()
302
    result = getInventoryItem_result()
303
    result.read(self._iprot)
303
    result.read(self._iprot)
304
    self._iprot.readMessageEnd()
304
    self._iprot.readMessageEnd()
305
    if result.success is not None:
305
    if result.success is not None:
306
      return result.success
306
      return result.success
-
 
307
    if result.wex is not None:
-
 
308
      raise result.wex
307
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getInventoryItem failed: unknown result");
309
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getInventoryItem failed: unknown result");
308
 
310
 
309
  def getNonSeralizedInventoryItems(self, itemId, quantity, supplierId):
311
  def getNonSeralizedInventoryItems(self, itemId, quantity, supplierId):
310
    """
312
    """
311
    Retrieves non-serialized inventory items from a given supplier
313
    Retrieves non-serialized inventory items from a given supplier
Line 702... Line 704...
702
  def process_getInventoryItem(self, seqid, iprot, oprot):
704
  def process_getInventoryItem(self, seqid, iprot, oprot):
703
    args = getInventoryItem_args()
705
    args = getInventoryItem_args()
704
    args.read(iprot)
706
    args.read(iprot)
705
    iprot.readMessageEnd()
707
    iprot.readMessageEnd()
706
    result = getInventoryItem_result()
708
    result = getInventoryItem_result()
-
 
709
    try:
707
    result.success = self._handler.getInventoryItem(args.serialNumber)
710
      result.success = self._handler.getInventoryItem(args.serialNumber)
-
 
711
    except WarehouseServiceException, wex:
-
 
712
      result.wex = wex
708
    oprot.writeMessageBegin("getInventoryItem", TMessageType.REPLY, seqid)
713
    oprot.writeMessageBegin("getInventoryItem", TMessageType.REPLY, seqid)
709
    result.write(oprot)
714
    result.write(oprot)
710
    oprot.writeMessageEnd()
715
    oprot.writeMessageEnd()
711
    oprot.trans.flush()
716
    oprot.trans.flush()
712
 
717
 
Line 1354... Line 1359...
1354
 
1359
 
1355
class getInventoryItem_result:
1360
class getInventoryItem_result:
1356
  """
1361
  """
1357
  Attributes:
1362
  Attributes:
1358
   - success
1363
   - success
-
 
1364
   - wex
1359
  """
1365
  """
1360
 
1366
 
1361
  thrift_spec = (
1367
  thrift_spec = (
1362
    (0, TType.STRUCT, 'success', (InventoryItem, InventoryItem.thrift_spec), None, ), # 0
1368
    (0, TType.STRUCT, 'success', (InventoryItem, InventoryItem.thrift_spec), None, ), # 0
-
 
1369
    (1, TType.STRUCT, 'wex', (WarehouseServiceException, WarehouseServiceException.thrift_spec), None, ), # 1
1363
  )
1370
  )
1364
 
1371
 
1365
  def __init__(self, success=None,):
1372
  def __init__(self, success=None, wex=None,):
1366
    self.success = success
1373
    self.success = success
-
 
1374
    self.wex = wex
1367
 
1375
 
1368
  def read(self, iprot):
1376
  def read(self, iprot):
1369
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1377
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1370
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1378
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1371
      return
1379
      return
Line 1378... Line 1386...
1378
        if ftype == TType.STRUCT:
1386
        if ftype == TType.STRUCT:
1379
          self.success = InventoryItem()
1387
          self.success = InventoryItem()
1380
          self.success.read(iprot)
1388
          self.success.read(iprot)
1381
        else:
1389
        else:
1382
          iprot.skip(ftype)
1390
          iprot.skip(ftype)
-
 
1391
      elif fid == 1:
-
 
1392
        if ftype == TType.STRUCT:
-
 
1393
          self.wex = WarehouseServiceException()
-
 
1394
          self.wex.read(iprot)
-
 
1395
        else:
-
 
1396
          iprot.skip(ftype)
1383
      else:
1397
      else:
1384
        iprot.skip(ftype)
1398
        iprot.skip(ftype)
1385
      iprot.readFieldEnd()
1399
      iprot.readFieldEnd()
1386
    iprot.readStructEnd()
1400
    iprot.readStructEnd()
1387
 
1401
 
Line 1392... Line 1406...
1392
    oprot.writeStructBegin('getInventoryItem_result')
1406
    oprot.writeStructBegin('getInventoryItem_result')
1393
    if self.success is not None:
1407
    if self.success is not None:
1394
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
1408
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
1395
      self.success.write(oprot)
1409
      self.success.write(oprot)
1396
      oprot.writeFieldEnd()
1410
      oprot.writeFieldEnd()
-
 
1411
    if self.wex is not None:
-
 
1412
      oprot.writeFieldBegin('wex', TType.STRUCT, 1)
-
 
1413
      self.wex.write(oprot)
-
 
1414
      oprot.writeFieldEnd()
1397
    oprot.writeFieldStop()
1415
    oprot.writeFieldStop()
1398
    oprot.writeStructEnd()
1416
    oprot.writeStructEnd()
1399
 
1417
 
1400
  def validate(self):
1418
  def validate(self):
1401
    return
1419
    return