scrolling news headlines added
This commit is contained in:
21
server.py
21
server.py
@@ -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
|
||||
|
Reference in New Issue
Block a user