plugin-barcode: exit delay() when input on stdin

This commit is contained in:
Sebastian Lohff 2012-06-15 02:02:36 +02:00
parent 16cd3639c1
commit 1972d80d8e
1 changed files with 4 additions and 2 deletions

View File

@ -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.')