plugin-barcode: exit delay() when input on stdin
This commit is contained in:
parent
16cd3639c1
commit
1972d80d8e
|
@ -93,8 +93,10 @@ def delay(what, seconds):
|
|||
sys.stdout.write('\r')
|
||||
sys.stdout.write('%s in %d Sekunden... ' % (what, i))
|
||||
sys.stdout.flush()
|
||||
time.sleep(1)
|
||||
|
||||
(read_list, _, _) = select([sys.stdin], [], [], 1)
|
||||
if len(read_list) > 0:
|
||||
# input on stdin, quit delay
|
||||
return
|
||||
|
||||
def warn_balance():
|
||||
print('Kontostand im Minus, bitte Geld aufladen.')
|
||||
|
|
Loading…
Reference in New Issue