|
|
@ -51,7 +51,15 @@ def select_ui(win, args):
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
if args.kiosk:
|
|
|
|
if args.kiosk:
|
|
|
|
subprocess.call(['systemctl', 'poweroff'])
|
|
|
|
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():
|
|
|
|
def main():
|
|
|
|
parser = argparse.ArgumentParser(add_help=False)
|
|
|
|
parser = argparse.ArgumentParser(add_help=False)
|
|
|
@ -66,7 +74,12 @@ def main():
|
|
|
|
parts = [part.replace('_', ' ') for part in parts]
|
|
|
|
parts = [part.replace('_', ' ') for part in parts]
|
|
|
|
print(str(' - '.join(parts)))
|
|
|
|
print(str(' - '.join(parts)))
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
def run():
|
|
|
|
curses.wrapper(select_ui, args)
|
|
|
|
curses.wrapper(select_ui, args)
|
|
|
|
|
|
|
|
if args.kiosk:
|
|
|
|
|
|
|
|
retry(run)
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
run()
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|
|
|
|
main()
|
|
|
|