Subversion Repositories SmartDukaan

Rev

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

Rev 7092 Rev 7746
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 '  i64 removeAllCouponsByPromotionId(i64 promotionId)'
25
  print '  Coupon getCoupon(string couponCode)'
26
  print '  Coupon getCoupon(string couponCode)'
26
  print '  bool isGiftVoucher(string couponCode)'
27
  print '  bool isGiftVoucher(string couponCode)'
27
  print '  bool isCodApplicable(string couponCode)'
28
  print '  bool isCodApplicable(string couponCode)'
28
  print '   getAllPromotions()'
29
  print '   getAllPromotions()'
29
  print '  Promotion getPromotionById(i64 promotionId)'
30
  print '  Promotion getPromotionById(i64 promotionId)'
Line 99... Line 100...
99
  if len(args) != 4:
100
  if len(args) != 4:
100
    print 'createPromotion requires 4 args'
101
    print 'createPromotion requires 4 args'
101
    sys.exit(1)
102
    sys.exit(1)
102
  pp.pprint(client.createPromotion(args[0],args[1],eval(args[2]),eval(args[3]),))
103
  pp.pprint(client.createPromotion(args[0],args[1],eval(args[2]),eval(args[3]),))
103
 
104
 
-
 
105
elif cmd == 'removeAllCouponsByPromotionId':
-
 
106
  if len(args) != 1:
-
 
107
    print 'removeAllCouponsByPromotionId requires 1 args'
-
 
108
    sys.exit(1)
-
 
109
  pp.pprint(client.removeAllCouponsByPromotionId(eval(args[0]),))
-
 
110
 
104
elif cmd == 'getCoupon':
111
elif cmd == 'getCoupon':
105
  if len(args) != 1:
112
  if len(args) != 1:
106
    print 'getCoupon requires 1 args'
113
    print 'getCoupon requires 1 args'
107
    sys.exit(1)
114
    sys.exit(1)
108
  pp.pprint(client.getCoupon(args[0],))
115
  pp.pprint(client.getCoupon(args[0],))