Permalink
Browse files

fix the static file path

fix the static file path
  • Loading branch information...
1 parent 13f553c commit 76ad70f6646d172384e86630c947bd020a2af22a @claytantor claytantor committed Feb 4, 2013
Showing with 9 additions and 6 deletions.
  1. +5 −1 README.md
  2. +4 −5 fiveoneoheat/fiveoneoheat/util/dataloader.py
View
@@ -21,4 +21,8 @@ Green, Yellow and Red - those are the colors of the placards that will be posted
Pass (green), Conditional Pass (yellow), and Closed (red) placards will rank the food safety status of food facilities inspected after July 1, 2012. Initially, foodservice operations at restaurants, school cafeterias, healthcare facilities, commissaries, supermarkets and bakeries will receive placards after a routine inspection is conducted. Mobile food and prepackaged facilities will be posted later in the year. The placards are to be posted at or near the entrance of the facility in public view.
-http://www.acgov.org/aceh/food/grading.htm
+http://www.acgov.org/aceh/food/grading.htm
+
+Requirements
+-------------
+https://github.com/aparo/pyes
@@ -3,11 +3,10 @@
import csv, sys
import uuid
import re
-import time
-from datetime import timedelta
import hashlib
from isounidecode import unidecode
from pyes import *
+from django.conf import settings
class DataLoader():
@@ -31,10 +30,10 @@ def clean_place_data(self):
['grade','STRING'],
['address','STRING']]
- infile = '/Users/claygraham/data/github/510eat/fiveoneoheat/static/data/alameda_county_restaurants_inspections_n.csv'
+ infile = '{0}/data/alameda_county_restaurants_inspections_n.csv'.format(settings.STATICFILES_DIRS[0])
f = open(infile, 'U')
- outfile = '/Users/claygraham/data/github/510eat/fiveoneoheat/static/data/alameda_county_restaurants_inspections_cleaned.json'
+ outfile = '{0}/data/alameda_county_restaurants_inspections_cleaned.json'.format(settings.STATICFILES_DIRS[0])
fout = open(outfile, 'w')
#for each row in the csv
@@ -104,7 +103,7 @@ def clean_place_data(self):
fout.close()
def load_inspections(self):
- infile = '/Users/claygraham/data/github/510eat/fiveoneoheat/static/data/alameda_county_restaurants_inspections_cleaned.json'
+ infile = '{0}/data/alameda_county_restaurants_inspections_cleaned.json'.format(settings.STATICFILES_DIRS[0])
#load_index_json(self, infile, index_id, mapping_id, mapping=None, delete_index=True)
self.load_index_json(
infile=infile,

0 comments on commit 76ad70f

Please sign in to comment.