diff options
author | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-05-13 05:37:41 +0100 |
---|---|---|
committer | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-05-13 05:37:41 +0100 |
commit | da154a736b2bd9c690f0e7bcbb9c06c7cb1859e2 (patch) | |
tree | fbe9955b10c069bbb4c642f3595e8a54e94fd2fb /parsers/surveys.py | |
parent | 0f15fd20127f72f400470ccb05e62573a80fb68e (diff) | |
download | troggle-da154a736b2bd9c690f0e7bcbb9c06c7cb1859e2.tar.gz troggle-da154a736b2bd9c690f0e7bcbb9c06c7cb1859e2.tar.bz2 troggle-da154a736b2bd9c690f0e7bcbb9c06c7cb1859e2.zip |
[svn] Got rid of data relating to specific machines
Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8187 by julian @ 1/18/2009 6:15 PM
Diffstat (limited to 'parsers/surveys.py')
-rw-r--r-- | parsers/surveys.py | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/parsers/surveys.py b/parsers/surveys.py index 1fc5edb..5582bf8 100644 --- a/parsers/surveys.py +++ b/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()
|