Commit 5c5d01a9b21e182ca7e61d157f6c03b91953e503

  • avatar
  • arvind
  • Wed Mar 27 17:11:06 IST 2013
Fixing fetch.py
			 - Added missing import and a return statement
fetch.py
(6 / 3)
  
66import logging
77from logging import FileHandler
88import pymongo
9import os
910
10
1111app = Flask(__name__)
1212
1313@app.route('/', methods=['GET'])
2424 collection = db['data']
2525 ret = {}
2626 x = 0
27 for i in collection.find({'url':request.args['url']}):
27 resource = "default"
28 if request.args.has_key('res'):
29 resource = request.args['res']
30 for i in collection.find({'res':resource}):
2831 del(i['_id'])
2932 ret[x] = i
3033 x = x + 1
31 jsonify(ret)
34 return jsonify(ret)
3235
3336
3437#Log the errors, don't depend on apache to log it for you.