From 3bc4e5baae51ef622a2cac98f677487cf9342286 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Sat, 28 Jan 2017 21:18:19 -0800 Subject: basic python compiling --- src/bin/mt-webface.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/bin/mt-webface.rs') diff --git a/src/bin/mt-webface.rs b/src/bin/mt-webface.rs index 4d26d21..8ddcf2e 100644 --- a/src/bin/mt-webface.rs +++ b/src/bin/mt-webface.rs @@ -21,6 +21,7 @@ use pencil::method::{Get, Post}; use regex::Regex; use modelthing::transpile_scheme::TranspileScheme; use modelthing::transpile_js::{TranspileJS, TranspileJSODE}; +use modelthing::transpile_python::{TranspilePython, TranspilePythonODE}; use modelthing::repr_latex::{ReprLaTeX, ReprVarsHTML}; /* @@ -111,9 +112,11 @@ fn model_repr(r: &mut Request) -> PencilResult { match modelthing::load_model_entry(model_path.as_path()) { Ok(me) => { match format { - "scheme" => Ok(Response::from(me.ast.transpile_scheme().unwrap())), "javascript" => Ok(Response::from(me.ast.transpile_js().unwrap())), "javascript_ode" => Ok(Response::from(me.ast.transpile_js_ode().unwrap())), + "python" => Ok(Response::from(me.ast.transpile_python().unwrap())), + "python_ode" => Ok(Response::from(me.ast.transpile_python_ode().unwrap())), + "scheme" => Ok(Response::from(me.ast.transpile_scheme().unwrap())), "latex" => Ok(Response::from(me.ast.repr_latex().unwrap())), _ => abort(403), } -- cgit v1.2.3