Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
bug fix for ESI
Browse files Browse the repository at this point in the history
  • Loading branch information
billyz313 committed Jan 31, 2019
1 parent 9700216 commit 9d93bb0
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
import json
import datetime

dataName = None

def getESIDate(item):
if item['name'] == 'esi4week':
print "dataName: ", dataName
if item['name'] == dataName:
return item

def getDatePattern(url):
Expand All @@ -27,7 +30,11 @@ def processYearByDirectory(dataType,year, inputdir):
:param inputdir:
'''
###Process the incoming data

global dataName
if dataType == 29:
dataName = 'esi4week'
else:
dataName = 'esi12week'
filePattern = None
with open('/data/data/cserv/www/html/json/stats.json', 'r+') as f:
data = json.load(f)
Expand Down Expand Up @@ -58,10 +65,6 @@ def processYearByDirectory(dataType,year, inputdir):
index = indexer.getIndexBasedOnDate(day,month,year)
print "Index:",index
try:
if dataType == 29:
dataName = 'esi4week'
else:
dataName = 'esi12week'
changed = False
with open('/data/data/cserv/www/html/json/stats.json', 'r+') as f:
data = json.load(f)
Expand Down

0 comments on commit 9d93bb0

Please sign in to comment.