Commit e922d3bf5acdc767fa17ddc2ac7302665488cae6
- Diff rendering mode:
- inline
- side by side
fetch.py
(9 / 8)
  | |||
2 | 2 | from flask import request | |
3 | 3 | from flask import render_template | |
4 | 4 | from flask import make_response | |
5 | import logging | ||
5 | 6 | from logging import FileHandler | |
6 | 7 | import json | |
7 | 8 | import pymongo | |
… | … | ||
24 | 24 | filename = request.args['json'] | |
25 | 25 | else: | |
26 | 26 | filename = 'test.json' | |
27 | filename = os.path.join('static', filename) | ||
28 | try: | ||
29 | f = open(filename, 'r') | ||
30 | except: | ||
31 | f = open('static/test.json', 'r') | ||
32 | buf = f.read() | ||
33 | f.close() | ||
34 | return render_template('editor.html', json = buf) | ||
27 | filename = os.path.join('static', filename) | ||
28 | try: | ||
29 | f = open(filename, 'r') | ||
30 | except: | ||
31 | f = open('static/test.json', 'r') | ||
32 | buf = f.read() | ||
33 | f.close() | ||
34 | return render_template('editor.html', json = buf) | ||
35 | 35 | ||
36 | 36 | @app.route('/saveJSON', methods=['POST']) | |
37 | 37 | def saveJSON(): |