From e922d3bf5acdc767fa17ddc2ac7302665488cae6 Mon Sep 17 00:00:00 2001 From: Arvind Date: Fri, 8 Feb 2013 11:39:32 +0530 Subject: [PATCH] Module logging is to be imported in a specific order, otherwise it fails loading. +Indentation fixes. --- fetch.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/fetch.py b/fetch.py index 13b935e..f9df8c7 100644 --- a/fetch.py +++ b/fetch.py @@ -2,6 +2,7 @@ from flask import Flask from flask import request from flask import render_template from flask import make_response +import logging from logging import FileHandler import json import pymongo @@ -23,14 +24,14 @@ def editor(): filename = request.args['json'] else: filename = 'test.json' - filename = os.path.join('static', filename) - try: - f = open(filename, 'r') - except: - f = open('static/test.json', 'r') - buf = f.read() - f.close() - return render_template('editor.html', json = buf) + filename = os.path.join('static', filename) + try: + f = open(filename, 'r') + except: + f = open('static/test.json', 'r') + buf = f.read() + f.close() + return render_template('editor.html', json = buf) @app.route('/saveJSON', methods=['POST']) def saveJSON(): -- 1.7.10.4