From 514cfe0e75cd32630813793f9a1b5714df1e2463 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Thu, 9 Nov 2023 11:29:22 -0800 Subject: [PATCH] backed out of breaking change --- wavinfo/__main__.py | 2 +- wavinfo/wave_reader.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/wavinfo/__main__.py b/wavinfo/__main__.py index 8a5e2d4..0fd7428 100644 --- a/wavinfo/__main__.py +++ b/wavinfo/__main__.py @@ -38,7 +38,7 @@ def main(): (options, args) = parser.parse_args(sys.argv) for arg in args[1:]: try: - this_file = WavInfoReader(f=arg) + this_file = WavInfoReader(path=arg) if options.adm: if this_file.adm: sys.stdout.write(this_file.adm.xml_str()) diff --git a/wavinfo/wave_reader.py b/wavinfo/wave_reader.py index 3bb68aa..6c7c506 100644 --- a/wavinfo/wave_reader.py +++ b/wavinfo/wave_reader.py @@ -35,7 +35,7 @@ class WavInfoReader: Parse a WAV audio file for metadata. """ - def __init__(self, f, info_encoding='latin_1', bext_encoding='ascii'): + def __init__(self, path, info_encoding='latin_1', bext_encoding='ascii'): """ Create a new reader object. @@ -80,21 +80,21 @@ class WavInfoReader: #: RIFF cues markers, labels, and notes. self.cues: Optional[WavCuesReader] = None - if hasattr(f, 'read'): - self.get_wav_info(f) + if hasattr(path, 'read'): + self.get_wav_info(path) self.url = 'about:blank' - self.path = repr(f) + self.path = repr(path) else: - absolute_path = os.path.abspath(f) + absolute_path = os.path.abspath(path) #: `file://` url for the file. self.url: str = pathlib.Path(absolute_path).as_uri() self.path = absolute_path - with open(f, 'rb') as f: - self.get_wav_info(f) + with open(path, 'rb') as path: + self.get_wav_info(path) def get_wav_info(self, wavfile): chunks = parse_chunk(wavfile)