|
|
|
@ -51,7 +51,15 @@ def select_ui(win, args):
|
|
|
|
|
pass
|
|
|
|
|
if args.kiosk:
|
|
|
|
|
subprocess.call(['systemctl', 'poweroff'])
|
|
|
|
|
return True # exited as expected
|
|
|
|
|
|
|
|
|
|
def retry(fun):
|
|
|
|
|
last_return = False
|
|
|
|
|
while not last_return:
|
|
|
|
|
try:
|
|
|
|
|
last_return = fun()
|
|
|
|
|
except:
|
|
|
|
|
pass # TODO save log file with error
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
|
parser = argparse.ArgumentParser(add_help=False)
|
|
|
|
@ -66,7 +74,12 @@ def main():
|
|
|
|
|
parts = [part.replace('_', ' ') for part in parts]
|
|
|
|
|
print(str(' - '.join(parts)))
|
|
|
|
|
return
|
|
|
|
|
def run():
|
|
|
|
|
curses.wrapper(select_ui, args)
|
|
|
|
|
if args.kiosk:
|
|
|
|
|
retry(run)
|
|
|
|
|
else:
|
|
|
|
|
run()
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
main()
|
|
|
|
|