| 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 serialNumber, i64 purchaseId)'
|
24 |
print ' InventoryItem createSerializedInventoryItem(i64 itemId, string itemNumber, string serialNumber, i64 purchaseId)'
|
| 25 |
print ' InventoryItem createSerializedInventoryItemFromItemNumber(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)'
|
26 |
print ' InventoryItem createInventoryItem(i64 itemId, i64 quantity, i64 purchaseId)'
|
| 27 |
print ' InventoryItem getInventoryItem(string serialNumber)'
|
27 |
print ' InventoryItem getInventoryItem(string serialNumber)'
|
| 28 |
print ' getNonSeralizedInventoryItems(i64 itemId, i64 quantity, i64 supplierId)'
|
28 |
print ' getNonSeralizedInventoryItems(i64 itemId, i64 quantity, i64 supplierId)'
|
| 29 |
print ' getInventoryItems(i64 itemId)'
|
29 |
print ' getInventoryItems(i64 itemId)'
|
| Line 84... |
Line 84... |
| 84 |
protocol = TBinaryProtocol.TBinaryProtocol(transport)
|
84 |
protocol = TBinaryProtocol.TBinaryProtocol(transport)
|
| 85 |
client = WarehouseService.Client(protocol)
|
85 |
client = WarehouseService.Client(protocol)
|
| 86 |
transport.open()
|
86 |
transport.open()
|
| 87 |
|
87 |
|
| 88 |
if cmd == 'createSerializedInventoryItem':
|
88 |
if cmd == 'createSerializedInventoryItem':
|
| 89 |
if len(args) != 3:
|
89 |
if len(args) != 4:
|
| 90 |
print 'createSerializedInventoryItem requires 3 args'
|
90 |
print 'createSerializedInventoryItem requires 4 args'
|
| 91 |
sys.exit(1)
|
91 |
sys.exit(1)
|
| 92 |
pp.pprint(client.createSerializedInventoryItem(eval(args[0]),args[1],eval(args[2]),))
|
92 |
pp.pprint(client.createSerializedInventoryItem(eval(args[0]),args[1],args[2],eval(args[3]),))
|
| 93 |
|
93 |
|
| 94 |
elif cmd == 'createSerializedInventoryItemFromItemNumber':
|
94 |
elif cmd == 'createSerializedInventoryItemFromItemNumber':
|
| 95 |
if len(args) != 3:
|
95 |
if len(args) != 3:
|
| 96 |
print 'createSerializedInventoryItemFromItemNumber requires 3 args'
|
96 |
print 'createSerializedInventoryItemFromItemNumber requires 3 args'
|
| 97 |
sys.exit(1)
|
97 |
sys.exit(1)
|