| Line 19... |
Line 19... |
| 19 |
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
|
19 |
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
|
| 20 |
print ''
|
20 |
print ''
|
| 21 |
print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
|
21 |
print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
|
| 22 |
print ''
|
22 |
print ''
|
| 23 |
print 'Functions:'
|
23 |
print 'Functions:'
|
| 24 |
print ' InventoryItem createSerializedInventoryItem(i64 itemId, string itemNumber, string serialNumber, i64 purchaseId)'
|
- |
|
| 25 |
print ' InventoryItem createSerializedInventoryItemFromItemNumber(string itemNumber, string serialNumber, i64 purchaseId)'
|
- |
|
| 26 |
print ' InventoryItem createInventoryItem(i64 itemId, i64 quantity, i64 purchaseId)'
|
- |
|
| 27 |
print ' InventoryItem getInventoryItem(string serialNumber)'
|
24 |
print ' InventoryItem getInventoryItem(string serialNumber)'
|
| 28 |
print ' InventoryItem getNonSeralizedInventoryItem(i64 itemId, i64 warehouseId)'
|
25 |
print ' InventoryItem getNonSeralizedInventoryItem(i64 itemId, i64 warehouseId)'
|
| 29 |
print ' void scanSerializedItem(InventoryItem inventoryItem, ScanType type, i64 billingWarehouseId)'
|
26 |
print ' void scanSerializedItem(InventoryItem inventoryItem, ScanType type, i64 billingWarehouseId)'
|
| 30 |
print ' void scan(InventoryItem inventoryItem, ScanType type, i64 quantity, i64 billingWarehouseId)'
|
27 |
print ' void scan(InventoryItem inventoryItem, ScanType type, i64 quantity, i64 billingWarehouseId)'
|
| 31 |
print ' InventoryItem scanSerializedItemForOrder(string serialNumber, ScanType type, i64 orderId, i64 fulfilmentWarehouseId, double quantity, i64 billingWarehouseId)'
|
28 |
print ' InventoryItem scanSerializedItemForOrder(string serialNumber, ScanType type, i64 orderId, i64 fulfilmentWarehouseId, double quantity, i64 billingWarehouseId)'
|
| Line 84... |
Line 81... |
| 84 |
transport = TTransport.TBufferedTransport(socket)
|
81 |
transport = TTransport.TBufferedTransport(socket)
|
| 85 |
protocol = TBinaryProtocol.TBinaryProtocol(transport)
|
82 |
protocol = TBinaryProtocol.TBinaryProtocol(transport)
|
| 86 |
client = WarehouseService.Client(protocol)
|
83 |
client = WarehouseService.Client(protocol)
|
| 87 |
transport.open()
|
84 |
transport.open()
|
| 88 |
|
85 |
|
| 89 |
if cmd == 'createSerializedInventoryItem':
|
- |
|
| 90 |
if len(args) != 4:
|
- |
|
| 91 |
print 'createSerializedInventoryItem requires 4 args'
|
- |
|
| 92 |
sys.exit(1)
|
- |
|
| 93 |
pp.pprint(client.createSerializedInventoryItem(eval(args[0]),args[1],args[2],eval(args[3]),))
|
- |
|
| 94 |
|
- |
|
| 95 |
elif cmd == 'createSerializedInventoryItemFromItemNumber':
|
- |
|
| 96 |
if len(args) != 3:
|
- |
|
| 97 |
print 'createSerializedInventoryItemFromItemNumber requires 3 args'
|
- |
|
| 98 |
sys.exit(1)
|
- |
|
| 99 |
pp.pprint(client.createSerializedInventoryItemFromItemNumber(args[0],args[1],eval(args[2]),))
|
- |
|
| 100 |
|
- |
|
| 101 |
elif cmd == 'createInventoryItem':
|
- |
|
| 102 |
if len(args) != 3:
|
- |
|
| 103 |
print 'createInventoryItem requires 3 args'
|
- |
|
| 104 |
sys.exit(1)
|
- |
|
| 105 |
pp.pprint(client.createInventoryItem(eval(args[0]),eval(args[1]),eval(args[2]),))
|
- |
|
| 106 |
|
- |
|
| 107 |
elif cmd == 'getInventoryItem':
|
86 |
if cmd == 'getInventoryItem':
|
| 108 |
if len(args) != 1:
|
87 |
if len(args) != 1:
|
| 109 |
print 'getInventoryItem requires 1 args'
|
88 |
print 'getInventoryItem requires 1 args'
|
| 110 |
sys.exit(1)
|
89 |
sys.exit(1)
|
| 111 |
pp.pprint(client.getInventoryItem(args[0],))
|
90 |
pp.pprint(client.getInventoryItem(args[0],))
|
| 112 |
|
91 |
|