Subversion Repositories SmartDukaan

Rev

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

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