Skip to content

Commit

Permalink
correct item tag for multi-day reports
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Jan 16, 2013
1 parent e6673fe commit 25fdc45
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion contrib/cocorahs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ class CocorahsIO(XmlNetIO):
'responsefields': "all"
}
root_tag = 'Cocorahs'
item_tag = 'DailyPrecipReports/DailyPrecipReport'

@property
def item_tag(self):
if self.type == "Daily":
return 'DailyPrecipReports/DailyPrecipReport'
elif self.type == "MultiDay":
return 'MultiDayPrecipReports/MultiDayPrecipReport'
raise Exception("%s is not a valid report type!" % self.type)

def load(self):
fmt = '%m/%d/%Y'
Expand Down

0 comments on commit 25fdc45

Please sign in to comment.