eval scheme: fix few crashes caused by invalid json serialization
This commit is contained in:
parent
40c9655424
commit
fcda05dfc6
3
app.py
3
app.py
|
@ -13,6 +13,7 @@ from sensors import sensors
|
||||||
import phasectrl
|
import phasectrl
|
||||||
from time import perf_counter, sleep
|
from time import perf_counter, sleep
|
||||||
|
|
||||||
|
from scm import stringify
|
||||||
|
|
||||||
def create_app():
|
def create_app():
|
||||||
app = Flask('hakkoso')
|
app = Flask('hakkoso')
|
||||||
|
@ -91,7 +92,7 @@ def handle_new_client():
|
||||||
@socketio.on('eval scheme')
|
@socketio.on('eval scheme')
|
||||||
def eval_scheme(code):
|
def eval_scheme(code):
|
||||||
output = phasectrl.safe_eval(code, statemachine.env, notify=False)
|
output = phasectrl.safe_eval(code, statemachine.env, notify=False)
|
||||||
socketio.emit('eval output', output)
|
socketio.emit('eval output', stringify(output, quote=False))
|
||||||
|
|
||||||
@socketio.on('get sensors history')
|
@socketio.on('get sensors history')
|
||||||
def send_sensors_history(elements=1000):
|
def send_sensors_history(elements=1000):
|
||||||
|
|
Loading…
Reference in New Issue