| 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 ' ItemLogistics getLogisticsEstimation(i64 itemId, string destination_pin, i64 provider_id)'
|
| - |
|
25 |
print ' void addDeliveryEstimate(i64 warahouse_id, string destination_pin, i64 provider_id, i64 delivery_time)'
|
| 24 |
print ' void addEmptyAWBs( numbers, i64 provider_id)'
|
26 |
print ' void addEmptyAWBs( numbers, i64 provider_id)'
|
| 25 |
print ' string getEmptyAWB(i64 provider_id)'
|
27 |
print ' string getEmptyAWB(i64 provider_id)'
|
| 26 |
print ' getProviders()'
|
28 |
print ' getProviders()'
|
| 27 |
print ' Provider getProvider(i64 provider_id)'
|
29 |
print ' Provider getProvider(i64 provider_id)'
|
| 28 |
print ' void createShipment(Shipment shipment)'
|
30 |
print ' void createShipment(Shipment shipment)'
|
| Line 76... |
Line 78... |
| 76 |
transport = TTransport.TBufferedTransport(socket)
|
78 |
transport = TTransport.TBufferedTransport(socket)
|
| 77 |
protocol = TBinaryProtocol.TBinaryProtocol(transport)
|
79 |
protocol = TBinaryProtocol.TBinaryProtocol(transport)
|
| 78 |
client = LogisticsService.Client(protocol)
|
80 |
client = LogisticsService.Client(protocol)
|
| 79 |
transport.open()
|
81 |
transport.open()
|
| 80 |
|
82 |
|
| - |
|
83 |
if cmd == 'getLogisticsEstimation':
|
| - |
|
84 |
if len(args) != 3:
|
| - |
|
85 |
print 'getLogisticsEstimation requires 3 args'
|
| - |
|
86 |
sys.exit(1)
|
| - |
|
87 |
pp.pprint(client.getLogisticsEstimation(eval(args[0]),args[1],eval(args[2]),))
|
| - |
|
88 |
|
| - |
|
89 |
elif cmd == 'addDeliveryEstimate':
|
| - |
|
90 |
if len(args) != 4:
|
| - |
|
91 |
print 'addDeliveryEstimate requires 4 args'
|
| - |
|
92 |
sys.exit(1)
|
| - |
|
93 |
pp.pprint(client.addDeliveryEstimate(eval(args[0]),args[1],eval(args[2]),eval(args[3]),))
|
| - |
|
94 |
|
| 81 |
if cmd == 'addEmptyAWBs':
|
95 |
elif cmd == 'addEmptyAWBs':
|
| 82 |
if len(args) != 2:
|
96 |
if len(args) != 2:
|
| 83 |
print 'addEmptyAWBs requires 2 args'
|
97 |
print 'addEmptyAWBs requires 2 args'
|
| 84 |
sys.exit(1)
|
98 |
sys.exit(1)
|
| 85 |
pp.pprint(client.addEmptyAWBs(eval(args[0]),eval(args[1]),))
|
99 |
pp.pprint(client.addEmptyAWBs(eval(args[0]),eval(args[1]),))
|
| 86 |
|
100 |
|