mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-07 21:04:00 +02:00
rework codes
This commit is contained in:
parent
614e3c584d
commit
ed33408833
1 changed files with 10 additions and 10 deletions
|
@ -12,9 +12,9 @@ def index():
|
|||
|
||||
@app.route('/code/<code>')
|
||||
def code(code):
|
||||
if code == 'RST':
|
||||
if code == 'R0000':
|
||||
return 'RESET received'
|
||||
if match('^\$[0-9]+$', code):
|
||||
if match('^\C[0-9]{4}$', code):
|
||||
amount = int(code[1:])
|
||||
return 'CREDIT %d received' % amount
|
||||
if match('^U[0-9]{4}$', code):
|
||||
|
@ -31,14 +31,14 @@ def admin():
|
|||
@app.route('/admin/barcode-generator.txt')
|
||||
def admin_barcodegeneratortxt():
|
||||
ret = []
|
||||
ret.append('Credit 20;$20')
|
||||
ret.append('Credit 50;$50')
|
||||
ret.append('Credit 100;$100')
|
||||
ret.append('Credit 200;$200')
|
||||
ret.append('Credit 500;$500')
|
||||
ret.append('Credit 1000;$1000')
|
||||
ret.append('Credit 2000;$2000')
|
||||
ret.append('RESET;RST')
|
||||
ret.append('Credit 20;C0020')
|
||||
ret.append('Credit 50;C0050')
|
||||
ret.append('Credit 100;C0100')
|
||||
ret.append('Credit 200;C0200')
|
||||
ret.append('Credit 500;C0500')
|
||||
ret.append('Credit 1000;C1000')
|
||||
ret.append('Credit 2000;C2000')
|
||||
ret.append('RESET;R0000')
|
||||
for (id,name) in sorted(users.iteritems(), key = lambda (k,v): (v,k)):
|
||||
ret.append('%s;U%d' % (name, id))
|
||||
response = Response(response = '\n'.join(ret) + '\n', content_type = 'text/plain')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue