first boot message improvements

This commit is contained in:
Your Name
2022-02-15 18:33:32 +00:00
parent 044f48103f
commit 4ad87bdfed
2 changed files with 30 additions and 26 deletions

View File

@@ -46,20 +46,19 @@ CSV_FOLDER = 'csv/new/'
ALLOWED_EXTENSIONS = {'csv', 'png'}
ticker = pexpect.spawn("sudo -E python3 stockTicker.py")
ticker.sendline('*') # run by default
time.sleep(8)
time.sleep(2) # give the ticker time to initialise
system_info = json.load(open('csv/system_info.json'))
ticker.sendline('*') # run startup gif by default
time.sleep(8)
if system_info['first_boot']: # let startup message display
time.sleep(10)
ticker.sendline('-')
system_info['first_boot'] = False
json.dump(system_info, open('csv/system_info.json', 'w'))
ticker.sendline('A') # run by default
else:
ticker.sendline('A') # run by default
def allowed_file(filename):
return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS