From 10c349c52580d17805e067edfa4707cd7ee7c09d Mon Sep 17 00:00:00 2001 From: Sanj Date: Mon, 12 Mar 2012 13:24:35 +0530 Subject: [PATCH] start turning schedule into list of lists in import_atlas --- chaloBEST/imports/import_atlas.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chaloBEST/imports/import_atlas.py b/chaloBEST/imports/import_atlas.py index 5e11ef1..0cbb67c 100644 --- a/chaloBEST/imports/import_atlas.py +++ b/chaloBEST/imports/import_atlas.py @@ -91,7 +91,7 @@ def groupUnique(): d = { 'from': row[7], 'to': row[10], - 'span': row[13], + 'span': row[13], #FIXME: what are you doing if span is null? 'is_full': False, # 'schedule': row[28], # 'rows': { @@ -101,14 +101,14 @@ def groupUnique(): matchedRow = isNotUnique(d, outDict[key]) schedule = row[-5] if matchedRow is not None: - outDict[key][matchedRow]['rows'][schedule] = row + outDict[key][matchedRow]['rows'][schedule].append(row) else: if isLargestSpan(d, routes[key]): d['is_full'] = True outDict[key].append(d) if not outDict[key][-1].has_key('rows'): outDict[key][-1]['rows'] = {} - outDict[key][-1]['rows'][schedule] = row + outDict[key][-1]['rows'][schedule] = [row] outFile = open(join(PROJECT_ROOT, "../db_csv_files/uniqueRoutes.json"), "w") outFile.write(json.dumps(outDict, indent=2))