mirror of
https://github.com/PotentiaRobotics/robot-gui.git
synced 2025-04-20 19:00:16 -04:00
if(invalid){don't send;}
This commit is contained in:
parent
5fe0a0ef59
commit
91b6386172
6
app.py
6
app.py
|
@ -20,7 +20,8 @@ def homepage():
|
||||||
def sendData():
|
def sendData():
|
||||||
|
|
||||||
rot = request.form.get("rot")
|
rot = request.form.get("rot")
|
||||||
|
try:
|
||||||
|
rot = int(rot)
|
||||||
print("Activated")
|
print("Activated")
|
||||||
import socket
|
import socket
|
||||||
s=socket.socket()
|
s=socket.socket()
|
||||||
|
@ -33,7 +34,8 @@ def sendData():
|
||||||
s.close()
|
s.close()
|
||||||
rece = "Confirm Sent: "+rece.decode("ASCII")
|
rece = "Confirm Sent: "+rece.decode("ASCII")
|
||||||
return render_template("index.html", conf=rece)
|
return render_template("index.html", conf=rece)
|
||||||
|
except ValueError:
|
||||||
|
return render_template("index.html", conf='Invalid Input "'+rot+'"')
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(debug=True)
|
app.run(debug=True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user