From 0701ce3ee25650b90f38295f43327b44def6f27d Mon Sep 17 00:00:00 2001 From: julian Date: Sun, 18 Jan 2009 19:15:06 +0100 Subject: [PATCH] [svn r8187] Got rid of data relating to specific machines --- troggle/parsers/surveys.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/troggle/parsers/surveys.py b/troggle/parsers/surveys.py index 1fc5edb65..5582bf887 100644 --- a/troggle/parsers/surveys.py +++ b/troggle/parsers/surveys.py @@ -2,12 +2,12 @@ import sys import os import urllib import types -sys.path.append('C:\\Expo\\expoweb') +#sys.path.append('C:\\Expo\\expoweb') from troggle import * -os.environ['DJANGO_SETTINGS_MODULE']='troggle.settings' +#os.environ['DJANGO_SETTINGS_MODULE']='troggle.settings' import troggle.settings as settings import troggle.expo.models as models -import fileAbstraction +import troggle.expo.fileAbstraction as fileAbstraction #import settings #import expo.models as models @@ -15,16 +15,8 @@ import csv import re import datetime -def openFileOrWeb(name): - try: - f = open(os.path.join(settings.FILES, name)) - except: - f = urllib.urlopen(settings.FILES + "download/" + name) - return f.readlines() - -surveytab = openFileOrWeb("Surveys.csv") - -dialect=csv.Sniffer().sniff(reduce(lambda x, y: x + "\n" + y, surveytab)) +surveytab = fileAbstraction.readFile("Surveys.csv") +dialect=csv.Sniffer().sniff(surveytab) surveyreader = csv.reader(surveytab,dialect=dialect) print surveyreader headers = surveyreader.next()