mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2026-10-01 17:27:42 +00:00
Ruff
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
|
||||
@@ -65,9 +65,12 @@ indent-width = 4
|
||||
[tool.ruff.lint]
|
||||
fixable = ['ALL']
|
||||
ignore = [
|
||||
'FA100', #Add `from __future__ import annotations` to simplify `typing.Optional`
|
||||
'UP022', # Prefer `capture_output` over sending `stdout` and `stderr` to `PIPE`
|
||||
'SIM115', # Use a context manager for opening files
|
||||
'UP031', #Use format specifiers instead of percent format
|
||||
'C408', # Unnecessary `dict()` call (rewrite as a literal)
|
||||
'C417' # Unnecessary `map()` usage (rewrite using a generator expression)
|
||||
]
|
||||
|
||||
# [tool.pylint]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Probe WAVE Files for iXML, Broadcast-WAVE and other metadata.
|
||||
"""
|
||||
|
||||
__all__ = ["WavInfoReader", "WavInfoEOFError"]
|
||||
__all__ = ["WavInfoEOFError", "WavInfoReader"]
|
||||
|
||||
from .riff_parser import WavInfoEOFError
|
||||
from .wave_reader import WavInfoReader
|
||||
|
||||
+10
-6
@@ -31,7 +31,11 @@ class MetaBrowser(Cmd):
|
||||
prompt = "(wavinfo) "
|
||||
|
||||
metadata: Union[List, Dict]
|
||||
path: List[str] = []
|
||||
path: List[str]
|
||||
|
||||
def preloop(self) -> None:
|
||||
self.path = []
|
||||
return super().preloop()
|
||||
|
||||
@property
|
||||
def cwd(self):
|
||||
@@ -91,7 +95,7 @@ class MetaBrowser(Cmd):
|
||||
else:
|
||||
print(f"Index {argv[0]} does not exist")
|
||||
elif isinstance(self.cwd, dict):
|
||||
if argv[0] in self.cwd.keys():
|
||||
if argv[0] in self.cwd:
|
||||
self.path = self.path + [argv[0]]
|
||||
else:
|
||||
print(f'Key "{argv[0]}" does not exist')
|
||||
@@ -177,12 +181,14 @@ def main():
|
||||
else:
|
||||
ret_dict = {
|
||||
"filename": arg,
|
||||
"run_date": datetime.datetime.now().isoformat(),
|
||||
"run_date": datetime.datetime.now(
|
||||
tz=datetime.timezone.utc
|
||||
).isoformat(),
|
||||
"application": f"wavinfo {version}",
|
||||
"scopes": {},
|
||||
}
|
||||
for scope, name, value in this_file.walk():
|
||||
if scope not in ret_dict["scopes"].keys():
|
||||
if scope not in ret_dict["scopes"]:
|
||||
ret_dict["scopes"][scope] = {}
|
||||
|
||||
ret_dict["scopes"][scope][name] = value
|
||||
@@ -198,8 +204,6 @@ def main():
|
||||
file=sys.stderr,
|
||||
)
|
||||
continue
|
||||
except Exception as e:
|
||||
raise e
|
||||
|
||||
if len(interactive_dict) > 0:
|
||||
cli = MetaBrowser()
|
||||
|
||||
@@ -178,22 +178,16 @@ class DolbyDigitalPlusMetadata:
|
||||
Per ATSC/A52 § 5.4.2.12, this is not in use and always 0xFF.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
class MixLevel(int):
|
||||
"""
|
||||
§ 4.3.6.2
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
class DialnormLevel(int):
|
||||
"""
|
||||
§ 4.3.4.4
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
class RoomType(Enum):
|
||||
"""
|
||||
`roomtyp` 4.3.6.3
|
||||
|
||||
Reference in New Issue
Block a user