| 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 ' Provider getProvider(i64 providerId)'
|
| 24 |
print ' LogisticsInfo getLogisticsEstimation(i64 itemId, string destination_pin)'
|
25 |
print ' LogisticsInfo getLogisticsEstimation(i64 itemId, string destination_pin)'
|
| 25 |
print ' LogisticsInfo getLogisticsInfo(string destination_pincode, string item_id)'
|
26 |
print ' LogisticsInfo getLogisticsInfo(string destination_pincode, string item_id)'
|
| 26 |
print ' string getEmptyAWB(i64 providerId)'
|
27 |
print ' string getEmptyAWB(i64 providerId)'
|
| 27 |
print ' getShipmentInfo(string awb, i64 providerId)'
|
28 |
print ' getShipmentInfo(string awb, i64 providerId)'
|
| 28 |
print ''
|
29 |
print ''
|
| Line 71... |
Line 72... |
| 71 |
transport = TTransport.TBufferedTransport(socket)
|
72 |
transport = TTransport.TBufferedTransport(socket)
|
| 72 |
protocol = TBinaryProtocol.TBinaryProtocol(transport)
|
73 |
protocol = TBinaryProtocol.TBinaryProtocol(transport)
|
| 73 |
client = LogisticsService.Client(protocol)
|
74 |
client = LogisticsService.Client(protocol)
|
| 74 |
transport.open()
|
75 |
transport.open()
|
| 75 |
|
76 |
|
| - |
|
77 |
if cmd == 'getProvider':
|
| - |
|
78 |
if len(args) != 1:
|
| - |
|
79 |
print 'getProvider requires 1 args'
|
| - |
|
80 |
sys.exit(1)
|
| - |
|
81 |
pp.pprint(client.getProvider(eval(args[0]),))
|
| - |
|
82 |
|
| 76 |
if cmd == 'getLogisticsEstimation':
|
83 |
elif cmd == 'getLogisticsEstimation':
|
| 77 |
if len(args) != 2:
|
84 |
if len(args) != 2:
|
| 78 |
print 'getLogisticsEstimation requires 2 args'
|
85 |
print 'getLogisticsEstimation requires 2 args'
|
| 79 |
sys.exit(1)
|
86 |
sys.exit(1)
|
| 80 |
pp.pprint(client.getLogisticsEstimation(eval(args[0]),args[1],))
|
87 |
pp.pprint(client.getLogisticsEstimation(eval(args[0]),args[1],))
|
| 81 |
|
88 |
|