Commit 3018c6751b3897665083d8ff13ad6825c829b301

  • avatar
  • arvind
  • Fri Feb 08 12:03:39 IST 2013
  • Tree SHA1: 3f77bd0
  • Parent SHA1: e922d3b (Module logging is to be imported in a specific order, otherwise it fails loading. +Indentation fixes.)
  • raw diff | raw patch
Code review
		 - Files are now handled the proper way.  Should not have relative references to files.
fetch.py
(4 / 2)
  
1818 else:
1919 return render_template('index.html')
2020
21 #fil = FileHandler(os.path.join(os.path.dirname(__file__),'logme'),mode='a')
22
2123@app.route('/editor', methods=['GET'])
2224def editor():
2325 if request.args.has_key('json'):
2426 filename = request.args['json']
2527 else:
2628 filename = 'test.json'
27 filename = os.path.join('static', filename)
29 filename = os.path.join(os.path.join(os.path.dirname(__file__),'static'), filename)
2830 try:
2931 f = open(filename, 'r')
3032 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')
3234 buf = f.read()
3335 f.close()
3436 return render_template('editor.html', json = buf)