mirror of https://github.com/ecmwf/eccodes.git
Python examples: Fix keys iterator argument
This commit is contained in:
parent
cbba3b30d5
commit
25595620b8
|
@ -39,7 +39,7 @@ def example():
|
|||
|
||||
while codes_keys_iterator_next(iterid):
|
||||
keyname = codes_keys_iterator_get_name(iterid)
|
||||
keyval = codes_get_string(iterid, keyname)
|
||||
keyval = codes_get_string(gid, keyname)
|
||||
print("%s = %s" % (keyname, keyval))
|
||||
|
||||
codes_keys_iterator_delete(iterid)
|
||||
|
|
|
@ -44,7 +44,7 @@ def do_print(namespace, INPUT):
|
|||
f1 = True
|
||||
while codes_keys_iterator_next(iterid):
|
||||
keyname = codes_keys_iterator_get_name(iterid)
|
||||
keyval = codes_get_string(iterid, keyname)
|
||||
keyval = codes_get_string(gid, keyname)
|
||||
if not f1:
|
||||
print(',')
|
||||
else:
|
||||
|
|
|
@ -23,11 +23,11 @@ def example():
|
|||
f = open(INPUT, 'rb')
|
||||
|
||||
while 1:
|
||||
bid = gts_new_from_file(f)
|
||||
if bid is None:
|
||||
gid = gts_new_from_file(f)
|
||||
if gid is None:
|
||||
break
|
||||
|
||||
iterid = codes_keys_iterator_new(bid)
|
||||
iterid = codes_keys_iterator_new(gid)
|
||||
|
||||
# Different types of keys can be skipped
|
||||
# codes_skip_computed(iterid)
|
||||
|
@ -36,11 +36,11 @@ def example():
|
|||
|
||||
while codes_keys_iterator_next(iterid):
|
||||
keyname = codes_keys_iterator_get_name(iterid)
|
||||
keyval = codes_get_string(iterid, keyname)
|
||||
keyval = codes_get_string(gid, keyname)
|
||||
print("%s = %s" % (keyname, keyval))
|
||||
|
||||
codes_keys_iterator_delete(iterid)
|
||||
codes_release(bid)
|
||||
codes_release(gid)
|
||||
|
||||
f.close()
|
||||
|
||||
|
|
Loading…
Reference in New Issue