summaryrefslogtreecommitdiff
path: root/examples/ndfd
diff options
context:
space:
mode:
authorpab <devnull@localhost>2009-07-26 22:46:06 +0000
committerpab <devnull@localhost>2009-07-26 22:46:06 +0000
commit822158b91348127ee0d953582e55979920e5804b (patch)
treeb90a51ee0572622b29d9a2bf4e68f2c7cf15e6f0 /examples/ndfd
parent3d95181374112ba342125957b491f9f4a81d6484 (diff)
Correct for plurality fix after removing outdated generated file
Diffstat (limited to 'examples/ndfd')
-rw-r--r--examples/ndfd/forecast.py48
-rw-r--r--examples/ndfd/genbindings.sh2
2 files changed, 26 insertions, 24 deletions
diff --git a/examples/ndfd/forecast.py b/examples/ndfd/forecast.py
index 1f7d3f8..26eda95 100644
--- a/examples/ndfd/forecast.py
+++ b/examples/ndfd/forecast.py
@@ -33,26 +33,28 @@ data = r.data()
for i in range(len(data.location())):
loc = data.location()[i]
- for j in range(len(loc.location_key())):
- key = loc.location_key()[j]
- print '%s [%s %s]' % (key, loc.point()[j].latitude(), loc.point()[j].longitude())
- for p in data.parameters():
- if p.applicable_location() != key:
- continue
- mint = maxt = None
- for t in p.temperature():
- if 'maximum' == t.type():
- maxt = t
- elif 'minimum' == t.type():
- mint = t
- print '%s (%s): %s' % (t.name()[0], t.units(), " ".join([ str(_v) for _v in t.content() ]))
- time_layout = None
- for tl in data.time_layout():
- if tl.layout_key() == mint.time_layout():
- time_layout = tl
- break
- for ti in range(len(time_layout.start_valid_time())):
- start = time_layout.start_valid_time()[ti].value()
- end = time_layout.end_valid_time()[ti]
- print '%s: min %s, max %s' % (time.strftime('%A, %B %d %Y', start.timetuple()),
- mint.value()[ti].value(), maxt.value()[ti].value())
+ print type(loc)
+ print type(loc.location_key())
+ print loc._ElementMap['location-key']._description()
+ key = loc.location_key()
+ print '%s [%s %s]' % (loc.location_key(), loc.point().latitude(), loc.point().longitude())
+ for p in data.parameters():
+ if p.applicable_location() != loc.location_key():
+ continue
+ mint = maxt = None
+ for t in p.temperature():
+ if 'maximum' == t.type():
+ maxt = t
+ elif 'minimum' == t.type():
+ mint = t
+ print '%s (%s): %s' % (t.name()[0], t.units(), " ".join([ str(_v) for _v in t.content() ]))
+ time_layout = None
+ for tl in data.time_layout():
+ if tl.layout_key() == mint.time_layout():
+ time_layout = tl
+ break
+ for ti in range(len(time_layout.start_valid_time())):
+ start = time_layout.start_valid_time()[ti].value()
+ end = time_layout.end_valid_time()[ti]
+ print '%s: min %s, max %s' % (time.strftime('%A, %B %d %Y', start.timetuple()),
+ mint.value_()[ti].value(), maxt.value_()[ti].value())
diff --git a/examples/ndfd/genbindings.sh b/examples/ndfd/genbindings.sh
index 194a97d..f008d43 100644
--- a/examples/ndfd/genbindings.sh
+++ b/examples/ndfd/genbindings.sh
@@ -3,7 +3,7 @@ export PYTHONPATH
URI='http://www.weather.gov/forecasts/xml/DWMLgen/schema/DWML.xsd'
PREFIX='DWML'
-rm -rf raw
+rm -rf raw ${PREFIX}.py
mkdir -p raw
touch raw/__init__.py
../../scripts/pyxbgen \