Subversion Repositories SmartDukaan

Rev

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

Rev 3103 Rev 3376
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 '  void closeSession()'
-
 
25
  print '  Provider getProvider(i64 providerId)'
24
  print '  Provider getProvider(i64 providerId)'
26
  print '   getAllProviders()'
25
  print '   getAllProviders()'
27
  print '  LogisticsInfo getLogisticsEstimation(i64 itemId, string destination_pin)'
26
  print '  LogisticsInfo getLogisticsEstimation(i64 itemId, string destination_pin)'
28
  print '  LogisticsInfo getLogisticsInfo(string destination_pincode, i64 item_id, DeliveryType type)'
27
  print '  LogisticsInfo getLogisticsInfo(string destination_pincode, i64 item_id, DeliveryType type)'
29
  print '  string getEmptyAWB(i64 providerId)'
28
  print '  string getEmptyAWB(i64 providerId)'
Line 78... Line 77...
78
    transport = TTransport.TBufferedTransport(socket)
77
    transport = TTransport.TBufferedTransport(socket)
79
protocol = TBinaryProtocol.TBinaryProtocol(transport)
78
protocol = TBinaryProtocol.TBinaryProtocol(transport)
80
client = LogisticsService.Client(protocol)
79
client = LogisticsService.Client(protocol)
81
transport.open()
80
transport.open()
82
 
81
 
83
if cmd == 'closeSession':
-
 
84
  if len(args) != 0:
-
 
85
    print 'closeSession requires 0 args'
-
 
86
    sys.exit(1)
-
 
87
  pp.pprint(client.closeSession())
-
 
88
 
-
 
89
elif cmd == 'getProvider':
82
if cmd == 'getProvider':
90
  if len(args) != 1:
83
  if len(args) != 1:
91
    print 'getProvider requires 1 args'
84
    print 'getProvider requires 1 args'
92
    sys.exit(1)
85
    sys.exit(1)
93
  pp.pprint(client.getProvider(eval(args[0]),))
86
  pp.pprint(client.getProvider(eval(args[0]),))
94
 
87