| Line 20... |
Line 20... |
| 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 createPromotion(string name, string ruleExecutionSrc, i64 startOn, i64 endOn)'
|
24 |
print ' void createPromotion(string name, string ruleExecutionSrc, i64 startOn, i64 endOn)'
|
| - |
|
25 |
print ' Coupon getCoupon(string couponCode)'
|
| - |
|
26 |
print ' bool isGiftVoucher(string couponCode)'
|
| 25 |
print ' getAllPromotions()'
|
27 |
print ' getAllPromotions()'
|
| 26 |
print ' Promotion getPromotionById(i64 promotionId)'
|
28 |
print ' Promotion getPromotionById(i64 promotionId)'
|
| 27 |
print ' void generateCouponsForPromotion(i64 promotionId, string couponCode)'
|
29 |
print ' void generateCouponsForPromotion(i64 promotionId, string couponCode)'
|
| 28 |
print ' Cart applyCoupon(string couponCode, i64 cartId)'
|
30 |
print ' Cart applyCoupon(string couponCode, i64 cartId)'
|
| 29 |
print ' void trackCouponUsage(string couponCode, i64 transactionId, i64 userId)'
|
31 |
print ' void trackCouponUsage(string couponCode, i64 transactionId, i64 userId)'
|
| Line 91... |
Line 93... |
| 91 |
if len(args) != 4:
|
93 |
if len(args) != 4:
|
| 92 |
print 'createPromotion requires 4 args'
|
94 |
print 'createPromotion requires 4 args'
|
| 93 |
sys.exit(1)
|
95 |
sys.exit(1)
|
| 94 |
pp.pprint(client.createPromotion(args[0],args[1],eval(args[2]),eval(args[3]),))
|
96 |
pp.pprint(client.createPromotion(args[0],args[1],eval(args[2]),eval(args[3]),))
|
| 95 |
|
97 |
|
| - |
|
98 |
elif cmd == 'getCoupon':
|
| - |
|
99 |
if len(args) != 1:
|
| - |
|
100 |
print 'getCoupon requires 1 args'
|
| - |
|
101 |
sys.exit(1)
|
| - |
|
102 |
pp.pprint(client.getCoupon(args[0],))
|
| - |
|
103 |
|
| - |
|
104 |
elif cmd == 'isGiftVoucher':
|
| - |
|
105 |
if len(args) != 1:
|
| - |
|
106 |
print 'isGiftVoucher requires 1 args'
|
| - |
|
107 |
sys.exit(1)
|
| - |
|
108 |
pp.pprint(client.isGiftVoucher(args[0],))
|
| - |
|
109 |
|
| 96 |
elif cmd == 'getAllPromotions':
|
110 |
elif cmd == 'getAllPromotions':
|
| 97 |
if len(args) != 0:
|
111 |
if len(args) != 0:
|
| 98 |
print 'getAllPromotions requires 0 args'
|
112 |
print 'getAllPromotions requires 0 args'
|
| 99 |
sys.exit(1)
|
113 |
sys.exit(1)
|
| 100 |
pp.pprint(client.getAllPromotions())
|
114 |
pp.pprint(client.getAllPromotions())
|