Commit 3018c6751b3897665083d8ff13ad6825c829b301
- Diff rendering mode:
- inline
- side by side
fetch.py
(4 / 2)
  | |||
18 | 18 | else: | |
19 | 19 | return render_template('index.html') | |
20 | 20 | ||
21 | #fil = FileHandler(os.path.join(os.path.dirname(__file__),'logme'),mode='a') | ||
22 | |||
21 | 23 | @app.route('/editor', methods=['GET']) | |
22 | 24 | def editor(): | |
23 | 25 | if request.args.has_key('json'): | |
24 | 26 | filename = request.args['json'] | |
25 | 27 | else: | |
26 | 28 | filename = 'test.json' | |
27 | filename = os.path.join('static', filename) | ||
29 | filename = os.path.join(os.path.join(os.path.dirname(__file__),'static'), filename) | ||
28 | 30 | try: | |
29 | 31 | f = open(filename, 'r') | |
30 | 32 | except: | |
31 | f = open('static/test.json', 'r') | ||
33 | f = open(os.path.join(os.path.join(os.path.dirname(__file__), 'static'), 'test.json'), 'r') | ||
32 | 34 | buf = f.read() | |
33 | 35 | f.close() | |
34 | 36 | return render_template('editor.html', json = buf) |