diff options
| author | 2019-03-25 11:52:41 -0700 | |
|---|---|---|
| committer | 2019-03-25 11:52:41 -0700 | |
| commit | 3f679bf41341a2b2546ae667998bd5ea5d80e3fe (patch) | |
| tree | 4ee747716f2998b55ae72ca87de17c2dbcfb2fa2 /snekbox.py | |
| parent | Merge remote-tracking branch 'remotes/origin/master' into rmq_removal (diff) | |
Add docstrings to routes
Diffstat (limited to 'snekbox.py')
| -rw-r--r-- | snekbox.py | 6 | 
1 files changed, 6 insertions, 0 deletions
| @@ -109,11 +109,15 @@ log = app.logger  @app.route('/')  def index(): +    """Return a page with a form for inputting code to be executed.""" +      return render_template('index.html')  @app.route('/result', methods=["POST", "GET"])  def result(): +    """Execute code and return a page displaying the results.""" +      if request.method == "POST":          code = request.form["Code"]          output = snekbox.python3(code) @@ -122,6 +126,8 @@ def result():  @app.route('/input', methods=["POST"])  def code_input(): +    """Execute code and return the results.""" +      body = request.get_json()      output = snekbox.python3(body["code"])      return jsonify(input=body["code"], output=output) | 
