Commit 5d87a98c authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

add a drawword route in the server

not yet used in the client
parent cc8daba4
Pipeline #7295 passed with stage
in 1 minute and 57 seconds
#!/usr/bin/python3 #!/usr/bin/python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2018 Laboratoire de Recherche et Développement de # Copyright (C) 2018-2019 Laboratoire de Recherche et Développement de
# l'Epita. # l'Epita.
# #
# This application is free software; you can redistribute it and/or # This application is free software; you can redistribute it and/or
...@@ -643,7 +643,16 @@ def compare(ltlformula, method='GET'): ...@@ -643,7 +643,16 @@ def compare(ltlformula, method='GET'):
return jsonify(result) return jsonify(result)
if __name__ == '__main__': @app.route('/api/drawword/<path:word>')
app.run(debug=True, use_reloader=True, use_debugger=False) @cachecontrol()
def drawword(word, method='GET'):
result = {}
try:
w = spot.parse_word(word)
except SyntaxError as e:
return jsonify({'parse_error': str(e)})
return jsonify({'svg': w.as_svg()})
if __name__ == '__main__':
app.run(debug=True, use_reloader=True, use_debugger=False)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment