Subversion Repositories SmartDukaan

Rev

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

Rev 304 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 '  void log(MsgType messageType, string message)'
25
  print '  void log(MsgType messageType, string message)'
25
  print ''
26
  print ''
26
  sys.exit(0)
27
  sys.exit(0)
27
 
28
 
28
pp = pprint.PrettyPrinter(indent = 2)
29
pp = pprint.PrettyPrinter(indent = 2)
Line 68... Line 69...
68
    transport = TTransport.TBufferedTransport(socket)
69
    transport = TTransport.TBufferedTransport(socket)
69
protocol = TBinaryProtocol.TBinaryProtocol(transport)
70
protocol = TBinaryProtocol.TBinaryProtocol(transport)
70
client = DataLogger.Client(protocol)
71
client = DataLogger.Client(protocol)
71
transport.open()
72
transport.open()
72
 
73
 
-
 
74
if cmd == 'closeSession':
-
 
75
  if len(args) != 0:
-
 
76
    print 'closeSession requires 0 args'
-
 
77
    sys.exit(1)
-
 
78
  pp.pprint(client.closeSession())
-
 
79
 
73
if cmd == 'log':
80
elif cmd == 'log':
74
  if len(args) != 2:
81
  if len(args) != 2:
75
    print 'log requires 2 args'
82
    print 'log requires 2 args'
76
    sys.exit(1)
83
    sys.exit(1)
77
  pp.pprint(client.log(eval(args[0]),args[1],))
84
  pp.pprint(client.log(eval(args[0]),args[1],))
78
 
85