Skip to content

Commit

Permalink
chore: Fix mypy linter errors and warnings (#226)
Browse files Browse the repository at this point in the history
A newer linter complains about our codec enums:

> streamer/bitrate_configuration.py:40: error: Enum members must be left
unannotated [misc]
> streamer/bitrate_configuration.py:40: note: See
https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members

And also this shows up in Python 3.12:

> streamer/periodconcat_node.py:128: SyntaxWarning: invalid escape
sequence '\{'
>  namespace_matches = re.search('\{([^}]*)\}', concat_mpd.tag)
  • Loading branch information
joeyparrish authored Jan 15, 2025
1 parent 7dce18b commit 3e78b77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions streamer/bitrate_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ def validate(value: str) -> None:


class AudioCodec(enum.Enum):

AAC: str = 'aac'
OPUS: str = 'opus'
AC3: str = 'ac3'
EAC3: str = 'eac3'
FLAC: str = 'flac'
AAC = 'aac'
OPUS = 'opus'
AC3 = 'ac3'
EAC3 = 'eac3'
FLAC = 'flac'

def is_hardware_accelerated(self) -> bool:
"""Returns True if this codec is hardware accelerated."""
Expand Down
2 changes: 1 addition & 1 deletion streamer/periodconcat_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def find(elem: ElementTree.Element, *args: str) -> ElementTree.Element:
self._pipeline_config.dash_output)).getroot()

# Get the default namespace.
namespace_matches = re.search('\{([^}]*)\}', concat_mpd.tag)
namespace_matches = re.search(r'\{([^}]*)\}', concat_mpd.tag)
assert namespace_matches is not None, 'Unable to find the default namespace.'
default_dash_namespace = namespace_matches.group(1)

Expand Down

0 comments on commit 3e78b77

Please sign in to comment.