Subversion Repositories SmartDukaan

Rev

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

Rev 472 Rev 483
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 '  LogisticsInfo getLogisticsInfo(string destination_pincode, string sku_id)'
24
  print '  ItemLogistics getLogisticsEstimation(i64 itemId, string destination_pin, i64 provider_id)'
25
  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)'
26
  print '  void addDeliveryEstimate(i64 warahouse_id, string destination_pin, i64 provider_id, i64 delivery_time, i64 reliability)'
-
 
27
  print '  void addPincodeWarehouseMapping(string pin_code, i64 warehouse_id, string warehouse_pin)'
26
  print '  void addEmptyAWBs( numbers, i64 provider_id)'
28
  print '  void addEmptyAWBs( numbers, i64 provider_id)'
27
  print '  string getEmptyAWB(i64 provider_id)'
29
  print '  string getEmptyAWB(i64 provider_id)'
28
  print '   getProviders()'
30
  print '   getProviders()'
29
  print '  Provider getProvider(i64 provider_id)'
31
  print '  Provider getProvider(i64 provider_id)'
30
  print '  void createShipment(Shipment shipment)'
32
  print '  void createShipment(Shipment shipment)'
Line 78... Line 80...
78
    transport = TTransport.TBufferedTransport(socket)
80
    transport = TTransport.TBufferedTransport(socket)
79
protocol = TBinaryProtocol.TBinaryProtocol(transport)
81
protocol = TBinaryProtocol.TBinaryProtocol(transport)
80
client = LogisticsService.Client(protocol)
82
client = LogisticsService.Client(protocol)
81
transport.open()
83
transport.open()
82
 
84
 
-
 
85
if cmd == 'getLogisticsInfo':
-
 
86
  if len(args) != 2:
-
 
87
    print 'getLogisticsInfo requires 2 args'
-
 
88
    sys.exit(1)
-
 
89
  pp.pprint(client.getLogisticsInfo(args[0],args[1],))
-
 
90
 
83
if cmd == 'getLogisticsEstimation':
91
elif cmd == 'getLogisticsEstimation':
84
  if len(args) != 3:
92
  if len(args) != 3:
85
    print 'getLogisticsEstimation requires 3 args'
93
    print 'getLogisticsEstimation requires 3 args'
86
    sys.exit(1)
94
    sys.exit(1)
87
  pp.pprint(client.getLogisticsEstimation(eval(args[0]),args[1],eval(args[2]),))
95
  pp.pprint(client.getLogisticsEstimation(eval(args[0]),args[1],eval(args[2]),))
88
 
96
 
89
elif cmd == 'addDeliveryEstimate':
97
elif cmd == 'addDeliveryEstimate':
90
  if len(args) != 4:
98
  if len(args) != 5:
91
    print 'addDeliveryEstimate requires 4 args'
99
    print 'addDeliveryEstimate requires 5 args'
-
 
100
    sys.exit(1)
-
 
101
  pp.pprint(client.addDeliveryEstimate(eval(args[0]),args[1],eval(args[2]),eval(args[3]),eval(args[4]),))
-
 
102
 
-
 
103
elif cmd == 'addPincodeWarehouseMapping':
-
 
104
  if len(args) != 3:
-
 
105
    print 'addPincodeWarehouseMapping requires 3 args'
92
    sys.exit(1)
106
    sys.exit(1)
93
  pp.pprint(client.addDeliveryEstimate(eval(args[0]),args[1],eval(args[2]),eval(args[3]),))
107
  pp.pprint(client.addPincodeWarehouseMapping(args[0],eval(args[1]),args[2],))
94
 
108
 
95
elif cmd == 'addEmptyAWBs':
109
elif cmd == 'addEmptyAWBs':
96
  if len(args) != 2:
110
  if len(args) != 2:
97
    print 'addEmptyAWBs requires 2 args'
111
    print 'addEmptyAWBs requires 2 args'
98
    sys.exit(1)
112
    sys.exit(1)