ticker process closed when screen turned off
This commit is contained in:
parent
82d22d6468
commit
d9fad15db5
@ -1 +1 @@
|
||||
{"update_available": false, "first_boot": true}
|
||||
{"update_available": false, "first_boot": false}
|
20
server.py
20
server.py
@ -33,6 +33,7 @@ api_caller.sendline('A')
|
||||
displaying_screensaver = False
|
||||
uploading = False
|
||||
screensaver_p = None
|
||||
ticker_stopped = False
|
||||
professional = json.load(open('csv/display_settings.json', 'r'))[0] == "Professional"
|
||||
|
||||
command = 300
|
||||
@ -174,12 +175,18 @@ def start():
|
||||
global ticker
|
||||
global api_caller
|
||||
global professional
|
||||
global ticker_stopped
|
||||
if displaying_screensaver:
|
||||
screensaver_p.close()
|
||||
ticker = pexpect.spawn("sudo -E python3 stockTicker.py")
|
||||
#api_caller = pexpect.spawn("sudo -E taskset -c 3 python3 api_caller.py")
|
||||
api_caller = pexpect.spawn("sudo -E taskset -c 3 python3 database_caller.py")
|
||||
displaying_screensaver = False
|
||||
|
||||
if ticker_stopped:
|
||||
ticker = pexpect.spawn("sudo -E python3 stockTicker.py")
|
||||
ticker_stopped = False
|
||||
|
||||
api_caller.sendline('A')
|
||||
|
||||
ticker.sendline('K')
|
||||
@ -194,11 +201,21 @@ def stop():
|
||||
global ticker
|
||||
global api_caller
|
||||
global professional
|
||||
if not displaying_screensaver:
|
||||
global ticker_stopped
|
||||
|
||||
ticker.sendline('K')
|
||||
|
||||
if not displaying_screensaver:
|
||||
ticker.close()
|
||||
else:
|
||||
screensaver_p.close()
|
||||
|
||||
if not ticker_stopped:
|
||||
|
||||
time.sleep(2) # give time for leds to turn off
|
||||
ticker.close()
|
||||
ticker_stopped = True
|
||||
|
||||
|
||||
if displaying_screensaver:
|
||||
screensaver_p.close()
|
||||
@ -206,6 +223,7 @@ def stop():
|
||||
#api_caller = pexpect.spawn("sudo -E taskset -c 3 python3 api_caller.py")
|
||||
api_caller = pexpect.spawn("sudo -E taskset -c 3 python3 database_caller.py")
|
||||
displaying_screensaver = False
|
||||
|
||||
return index()
|
||||
|
||||
@app.route("/update", methods=['PUT','POST'])
|
||||
|
Loading…
Reference in New Issue
Block a user