| 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 ' i64 createTransaction(Transaction transaction)'
|
24 |
print ' i64 createTransaction(Transaction transaction)'
|
| 26 |
print ' Transaction getTransaction(i64 id)'
|
25 |
print ' Transaction getTransaction(i64 id)'
|
| 27 |
print ' getTransactionsForCustomer(i64 customerId, i64 from_date, i64 to_date, TransactionStatus status)'
|
26 |
print ' getTransactionsForCustomer(i64 customerId, i64 from_date, i64 to_date, TransactionStatus status)'
|
| 28 |
print ' getTransactionsForShoppingCartId(i64 shoppingCartId)'
|
27 |
print ' getTransactionsForShoppingCartId(i64 shoppingCartId)'
|
| 29 |
print ' TransactionStatus getTransactionStatus(i64 transactionId)'
|
28 |
print ' TransactionStatus getTransactionStatus(i64 transactionId)'
|
| Line 117... |
Line 116... |
| 117 |
transport = TTransport.TBufferedTransport(socket)
|
116 |
transport = TTransport.TBufferedTransport(socket)
|
| 118 |
protocol = TBinaryProtocol.TBinaryProtocol(transport)
|
117 |
protocol = TBinaryProtocol.TBinaryProtocol(transport)
|
| 119 |
client = TransactionService.Client(protocol)
|
118 |
client = TransactionService.Client(protocol)
|
| 120 |
transport.open()
|
119 |
transport.open()
|
| 121 |
|
120 |
|
| 122 |
if cmd == 'closeSession':
|
- |
|
| 123 |
if len(args) != 0:
|
- |
|
| 124 |
print 'closeSession requires 0 args'
|
- |
|
| 125 |
sys.exit(1)
|
- |
|
| 126 |
pp.pprint(client.closeSession())
|
- |
|
| 127 |
|
- |
|
| 128 |
elif cmd == 'createTransaction':
|
121 |
if cmd == 'createTransaction':
|
| 129 |
if len(args) != 1:
|
122 |
if len(args) != 1:
|
| 130 |
print 'createTransaction requires 1 args'
|
123 |
print 'createTransaction requires 1 args'
|
| 131 |
sys.exit(1)
|
124 |
sys.exit(1)
|
| 132 |
pp.pprint(client.createTransaction(eval(args[0]),))
|
125 |
pp.pprint(client.createTransaction(eval(args[0]),))
|
| 133 |
|
126 |
|