scrolling news headlines added

This commit is contained in:
Neythen
2021-05-21 14:24:37 +01:00
parent 7486ac1125
commit b0f106c64f
17 changed files with 195 additions and 72 deletions

View File

@@ -229,8 +229,8 @@ def AddLogo():
@app.route("/matrix", methods=['POST'])
def matrix():
global LastCommand
if "Run Display" in request.form:
global LastCommand
if "Run Stocks" in request.form:
pass
print('run display')
#stock_ticker.runStockTicker(command, DelayTime, speedTime)
@@ -240,13 +240,24 @@ def matrix():
#child.sendline('sent from server')
#process = Popen(["sudo", "-E", "python3", "stockTicker.py"], stdin=PIPE, stdout=PIPE, stderr=PIPE)
ticker.sendline('K')
ticker.sendline('S')
print('back in flask')
LastCommand = 'Run display'
elif "Stop Display (at next refresh)" in request.form:
if "Run News" in request.form:
pass
print('run display')
ticker.sendline('K')
ticker.sendline('N')
print('back in flask')
LastCommand = 'Run display'
elif "Stop Display (at next refresh)" in request.form:
pass
print('run display')
#ticker.kill()
@@ -256,14 +267,14 @@ def matrix():
ticker.sendline('K')
except:
print("none running")
elif "Shutdown the pi" in request.form:
elif "Shutdown the pi" in request.form:
pass
try:
LastCommand = 'shutdown'
os.system("sudo shutdown now")
except:
print("couldn't shutdown")
return hello()
return hello()
if __name__ == "__main__":
app.run(host='0.0.0.0', port=1024, debug=False) # the debuggger causes flickering