25 params[
'res'] = period
44 params[
'res'] = period
53 return xml.dom.minidom.parseString(d)
61 els = doc.getElementsByTagName(
'Param')
64 fname = e.firstChild.data
65 abbr = atts[
'name'].value
66 unit = atts[
'units'].value
71 decstring =
'%s: %%s %s' % (fname, unit)
72 result[abbr] = decstring
82 latlong = places.getLatLong(location)
108 object.__init__(self)
111 reptime = int(r.firstChild.data)/60
112 stime =
'%02d:00' % reptime
113 self.
_data[
'time'] = stime
115 for k
in atts.keys():
117 self.
_data[k] = constants.WEATHER_TYPES[int(atts[k].value)]
119 self.
_data[k] = decoder[k] % atts[k].value
123 self.
_data[
'day'] = day
126 return self.
_data[
'time'] < other._data[
'time']
132 result.append(
'%s: %s, %s: %s' % (
'Date', data[
'day'],
'Time', data[
'time'] ))
137 result.append(
'\t\t%s' % data[k])
138 return '\n'.join(result)
150 object.__init__(self)
153 obsData = doc.getElementsByTagName(
'DV')
154 obsDataDate = obsData[0].attributes[
'dataDate'].value[:-1].split(
'T')
155 self.
_date = obsDataDate[0]
156 self.
_time = obsDataDate[1]
157 periods = doc.getElementsByTagName(
'Period')
158 for period
in periods:
159 date = period.attributes[
'value'].value[:-1]
160 obs = doc.getElementsByTagName(
'Rep')
164 self._reps.append(rep)
169 observations = property(_getObs)