Python examples: Fix keys iterator argument

This commit is contained in:
Shahram Najm 2019-03-11 12:24:43 +00:00
parent cbba3b30d5
commit 25595620b8
3 changed files with 7 additions and 7 deletions

View File

@ -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)

View File

@ -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:

View File

@ -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()