Renamed iter back to walk

This commit is contained in:
Jamie Hardt
2022-11-26 18:26:58 -08:00
parent af5c83b8fc
commit 4e061a85f1
3 changed files with 4 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ class TestWalk(unittest.TestCase):
info = wavinfo.WavInfoReader(test_file) info = wavinfo.WavInfoReader(test_file)
tested_data , tested_format = False, False tested_data , tested_format = False, False
for scope, key, value in info.iter(): for scope, key, value in info.walk():
if scope == 'fmt': if scope == 'fmt':
if key == 'channel_count': if key == 'channel_count':
tested_format = True tested_format = True

View File

@@ -52,7 +52,7 @@ def main():
'application': "wavinfo " + __version__, 'application': "wavinfo " + __version__,
'scopes': {} 'scopes': {}
} }
for scope, name, value in this_file.iter(): for scope, name, value in this_file.walk():
if scope not in ret_dict['scopes'].keys(): if scope not in ret_dict['scopes'].keys():
ret_dict['scopes'][scope] = {} ret_dict['scopes'][scope] = {}

View File

@@ -166,10 +166,10 @@ class WavInfoReader:
ixml_data = self._find_chunk_data(b'iXML', f, default_none=True) ixml_data = self._find_chunk_data(b'iXML', f, default_none=True)
return WavIXMLFormat(ixml_data.rstrip(b'\0')) if ixml_data else None return WavIXMLFormat(ixml_data.rstrip(b'\0')) if ixml_data else None
def iter(self) -> Generator[str,str,Any]: def walk(self) -> Generator[str,str,Any]: #FIXME: this should probably be named "iter()"
""" """
Walk all of the available metadata fields. Walk all of the available metadata fields.
:yields: tuples of the *scope*, *key*, and *value* of :yields: tuples of the *scope*, *key*, and *value* of
each metadatum. The *scope* value will be one of each metadatum. The *scope* value will be one of
"fmt", "data", "ixml", "bext", "info", "dolby", or "adm". "fmt", "data", "ixml", "bext", "info", "dolby", or "adm".