diff --git a/src/tbc_video_export/__main__.py b/src/tbc_video_export/__main__.py index 7b2da7e..bee6bdf 100644 --- a/src/tbc_video_export/__main__.py +++ b/src/tbc_video_export/__main__.py @@ -28,7 +28,7 @@ async def _run() -> None: try: config = Config() - opts = opts_parser.parse_opts(config) + parser, opts = opts_parser.parse_opts(config) log.set_verbosity(opts) files = FileHelper(opts, config) @@ -38,6 +38,8 @@ async def _run() -> None: files, ) + opts_parser.validate_opts(state, parser, opts) + handler = ProcessHandler(state) logging.getLogger("console").info( diff --git a/src/tbc_video_export/opts/opts_parser.py b/src/tbc_video_export/opts/opts_parser.py index ffa9b1a..cddae8e 100644 --- a/src/tbc_video_export/opts/opts_parser.py +++ b/src/tbc_video_export/opts/opts_parser.py @@ -16,9 +16,12 @@ from typing import Any from tbc_video_export.config import Config + from tbc_video_export.program_state import ProgramState -def parse_opts(config: Config, args: list[str] | None = None) -> Opts: +def parse_opts( + config: Config, args: list[str] | None = None +) -> tuple[argparse.ArgumentParser, Opts]: """Parse program opts.""" parser = argparse.ArgumentParser( prog=consts.APPLICATION_NAME, @@ -205,18 +208,17 @@ def parse_opts(config: Config, args: list[str] | None = None) -> Opts: opts_ffmpeg.add_ffmpeg_opts(config, parser) opts = parser.parse_intermixed_args(args, namespace=Opts()) - _validate_opts(config, parser, opts) + return (parser, opts) - return opts - -def _validate_opts(config: Config, parser: argparse.ArgumentParser, opts: Opts) -> None: +def validate_opts( + state: ProgramState, parser: argparse.ArgumentParser, opts: Opts +) -> None: """Validate any nonsensical opt combinations.""" _validate_line_opts(parser, opts) - _validate_video_system(parser, opts) + _validate_video_system(state, parser, opts) _validate_ansi_support(opts) - _validate_luma_only_opts(config, parser, opts) - _validate_verbosity_opts(opts) + _validate_luma_only_opts(state, parser, opts) def _validate_line_opts(parser: argparse.ArgumentParser, opts: Opts) -> None: @@ -241,9 +243,11 @@ def _validate_line_opts(parser: argparse.ArgumentParser, opts: Opts) -> None: ) -def _validate_video_system(parser: argparse.ArgumentParser, opts: Opts) -> None: +def _validate_video_system( + state: ProgramState, parser: argparse.ArgumentParser, opts: Opts +) -> None: # check video system incompatible opts - match opts.video_system: + match state.video_system: case VideoSystem.PAL | VideoSystem.PAL_M: if opts.oftest: parser.error( @@ -267,9 +271,6 @@ def _validate_video_system(parser: argparse.ArgumentParser, opts: Opts) -> None: "arguments --simple-pal: not allowed when --video-system is ntsc" ) - case _: - pass - def _validate_ansi_support(opts: Opts) -> None: # check if ansi is supported on Windows and disable progress if not @@ -291,36 +292,28 @@ def _validate_ansi_support(opts: Opts) -> None: def _validate_luma_only_opts( - config: Config, parser: argparse.ArgumentParser, opts: Opts + state: ProgramState, parser: argparse.ArgumentParser, opts: Opts ) -> None: # check luma only redundant opts if opts.luma_only or opts.luma_4fsc: if opts.chroma_decoder is not None: parser.error( - "arguments --chroma-decoder: not allowed when --luma-only or " + "arguments --chroma-decoder: not allowed with --luma-only or " "--luma-4fsc (redundant)" ) - if opts.profile != config.get_default_profile(ProfileType.DEFAULT).name: + if opts.profile != state.config.get_default_profile(ProfileType.DEFAULT).name: parser.error( - "arguments --profile: not allowed when --luma-only or " - "--luma-4fsc (redundant)" + "arguments --profile: not allowed with --luma-only or " + "--luma-4fsc (redundant), try --profile-luma" ) - elif opts.profile_luma != config.get_default_profile(ProfileType.LUMA).name: + elif opts.profile_luma != state.config.get_default_profile(ProfileType.LUMA).name: parser.error( - "arguments --profile-luma: not allowed when not --luma-only or " - "--luma-4fsc (redundant)" + "arguments --profile-luma: only allowed with --luma-only or --luma-4fsc" ) -def _validate_verbosity_opts(opts: Opts) -> None: - # verbosity - # disable debug logging to console if progress is displayed or quiet enabled - if opts.debug and opts.no_progress: - logging.getLogger("console").setLevel(logging.DEBUG) - - class _ActionDumpConfig(argparse.Action): def __init__(self, config: Config, nargs: int = 0, **kwargs: Any) -> None: self._config = config diff --git a/tests/test_verbosity_opts.py b/tests/test_verbosity_opts.py index 7beb8ff..7077514 100644 --- a/tests/test_verbosity_opts.py +++ b/tests/test_verbosity_opts.py @@ -26,7 +26,7 @@ def setUp(self) -> None: # noqa: D102 self.parse_opts = partial(opts_parser.parse_opts, self.config) def test_quiet_mode(self) -> None: # noqa: D102 - opts = self.parse_opts([str(self.path),"pal_svideo", "-q"]) + _, opts = self.parse_opts([str(self.path), "pal_svideo", "-q"]) self.files = FileHelper(opts, self.config) log.set_verbosity(opts) @@ -36,8 +36,8 @@ def test_quiet_mode(self) -> None: # noqa: D102 self.assertEqual(logging.getLogger("console").level, logging.ERROR) def test_debug_mode(self) -> None: # noqa: D102 - opts = self.parse_opts( - [str(self.path),"pal_svideo", "-d", "--no-progress", "--no-debug-log"] + _, opts = self.parse_opts( + [str(self.path), "pal_svideo", "-d", "--no-progress", "--no-debug-log"] ) self.files = FileHelper(opts, self.config) log.set_verbosity(opts) @@ -48,7 +48,9 @@ def test_debug_mode(self) -> None: # noqa: D102 # self.assertGreater(len(logging.getLogger("console").handlers), 1) def test_show_process_output(self) -> None: # noqa: D102 - opts = self.parse_opts([str(self.path),"pal_svideo", "--show-process-output"]) + _, opts = self.parse_opts( + [str(self.path), "pal_svideo", "--show-process-output"] + ) self.files = FileHelper(opts, self.config) log.set_verbosity(opts) diff --git a/tests/test_wrappers_ffmpeg.py b/tests/test_wrappers_ffmpeg.py index 4b88ec3..5e94d28 100644 --- a/tests/test_wrappers_ffmpeg.py +++ b/tests/test_wrappers_ffmpeg.py @@ -27,7 +27,7 @@ def setUp(self) -> None: # noqa: D102 def test_ffmpeg_audio_track_opts(self) -> None: # noqa: D102 audio_track = "tests/files/audio.flac" - opts = self.parse_opts( + _, opts = self.parse_opts( [str(self.path), "pal_svideo", "--audio-track", "tests/files/audio.flac"] ) self.files = FileHelper(opts, self.config) @@ -53,7 +53,7 @@ def test_ffmpeg_audio_track_opts(self) -> None: # noqa: D102 def test_ffmpeg_audio_track_advanced_opts(self) -> None: # noqa: D102 audio_track = "tests/files/audio.flac" - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "pal_svideo", @@ -107,7 +107,7 @@ def test_ffmpeg_audio_track_advanced_opts(self) -> None: # noqa: D102 ) def test_ffmpeg_metadata_opts(self) -> None: # noqa: D102 - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "pal_svideo", diff --git a/tests/test_wrappers_ldtools.py b/tests/test_wrappers_ldtools.py index 796fe6d..ef00d59 100644 --- a/tests/test_wrappers_ldtools.py +++ b/tests/test_wrappers_ldtools.py @@ -35,7 +35,7 @@ def setUp(self) -> None: # noqa: D102 self.pipe = PipeFactory.create_dummy_pipe() def test_process_vbi_default_opts(self) -> None: # noqa: D102 - opts = self.parse_opts( + _, opts = self.parse_opts( [str(self.path), "pal_svideo", "--threads", "4", "--process-vbi"] ) self.files = FileHelper(opts, self.config) @@ -62,7 +62,7 @@ def test_process_vbi_custom_json(self) -> None: # noqa: D102 Path(__file__).parent, "files", "ntsc_svideo.tbc.json" ) - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "pal_svideo", @@ -93,7 +93,7 @@ def test_process_vbi_custom_json(self) -> None: # noqa: D102 ) def test_dropout_correct_default_opts(self) -> None: # noqa: D102 - opts = opts_parser.parse_opts( + _, opts = opts_parser.parse_opts( self.config, [str(self.path), "pal_svideo", "--threads", "4"] ) self.files = FileHelper(opts, self.config) @@ -118,7 +118,7 @@ def test_dropout_correct_default_opts(self) -> None: # noqa: D102 ) def test_decoder_invalid_videosystem(self) -> None: # noqa: D102 - opts = self.parse_opts( + _, opts = self.parse_opts( [str(self.path), "pal_svideo", "--chroma-decoder", "ntsc2d"] ) self.files = FileHelper(opts, self.config) @@ -137,7 +137,7 @@ def test_decoder_invalid_videosystem(self) -> None: # noqa: D102 def test_decoder_letterbox_pal(self) -> None: # noqa: D102 path = Path.joinpath(Path(__file__).parent, "files", "pal_svideo") - opts = self.parse_opts([str(path), "pal_svideo", "--letterbox"]) + _, opts = self.parse_opts([str(path), "pal_svideo", "--letterbox"]) self.files = FileHelper(opts, self.config) state = ProgramState(opts, self.config, self.files) @@ -159,7 +159,7 @@ def test_decoder_letterbox_pal(self) -> None: # noqa: D102 def test_decoder_letterbox_ntsc(self) -> None: # noqa: D102 path = Path.joinpath(Path(__file__).parent, "files", "ntsc_svideo") - opts = self.parse_opts([str(path), "ntsc_svideo", "--letterbox"]) + _, opts = self.parse_opts([str(path), "ntsc_svideo", "--letterbox"]) self.files = FileHelper(opts, self.config) state = ProgramState(opts, self.config, self.files) @@ -181,7 +181,7 @@ def test_decoder_letterbox_ntsc(self) -> None: # noqa: D102 def test_decoder_letterbox_palm(self) -> None: # noqa: D102 path = Path.joinpath(Path(__file__).parent, "files", "palm_svideo") - opts = self.parse_opts([str(path), "palm_svideo", "--letterbox"]) + _, opts = self.parse_opts([str(path), "palm_svideo", "--letterbox"]) self.files = FileHelper(opts, self.config) state = ProgramState(opts, self.config, self.files) @@ -198,7 +198,7 @@ def test_decoder_letterbox_palm(self) -> None: # noqa: D102 def test_decoder_vbi_pal(self) -> None: # noqa: D102 path = Path.joinpath(Path(__file__).parent, "files", "pal_svideo") - opts = self.parse_opts([str(path), "pal_svideo", "--vbi"]) + _, opts = self.parse_opts([str(path), "pal_svideo", "--vbi"]) self.files = FileHelper(opts, self.config) state = ProgramState(opts, self.config, self.files) @@ -217,7 +217,7 @@ def test_decoder_vbi_pal(self) -> None: # noqa: D102 def test_decoder_vbi_ntsc(self) -> None: # noqa: D102 path = Path.joinpath(Path(__file__).parent, "files", "ntsc_svideo") - opts = self.parse_opts([str(path), "ntsc_svideo", "--vbi"]) + _, opts = self.parse_opts([str(path), "ntsc_svideo", "--vbi"]) self.files = FileHelper(opts, self.config) state = ProgramState(opts, self.config, self.files) @@ -239,7 +239,7 @@ def test_decoder_vbi_ntsc(self) -> None: # noqa: D102 def test_decoder_vbi_palm(self) -> None: # noqa: D102 path = Path.joinpath(Path(__file__).parent, "files", "palm_svideo") - opts = self.parse_opts([str(path), "palm_svideo", "--vbi"]) + _, opts = self.parse_opts([str(path), "palm_svideo", "--vbi"]) self.files = FileHelper(opts, self.config) state = ProgramState(opts, self.config, self.files) @@ -261,7 +261,7 @@ def test_decoder_vbi_palm(self) -> None: # noqa: D102 def test_decoder_nr_gain_svideo(self) -> None: # noqa: D102 path = Path.joinpath(Path(__file__).parent, "files", "pal_svideo") tbc_json = Path.joinpath(Path(__file__).parent, "files", "pal_svideo.tbc.json") - opts = opts_parser.parse_opts( + _, opts = opts_parser.parse_opts( self.config, [ str(path), @@ -338,7 +338,7 @@ def test_decoder_nr_gain_cvbs(self) -> None: # noqa: D102 tbc_json = Path.joinpath( Path(__file__).parent, "files", "pal_composite.tbc.json" ) - opts = opts_parser.parse_opts( + _, opts = opts_parser.parse_opts( self.config, [ str(path), diff --git a/tests/test_wrappers_ntsc_composite.py b/tests/test_wrappers_ntsc_composite.py index c56caf2..33dc0ea 100644 --- a/tests/test_wrappers_ntsc_composite.py +++ b/tests/test_wrappers_ntsc_composite.py @@ -32,14 +32,14 @@ def setUp(self) -> None: # noqa: D102 self.pipe = PipeFactory.create_dummy_pipe() def test_videosystem(self) -> None: # noqa: D102 - opts = self.parse_opts( + _, opts = self.parse_opts( [str(self.path), "ntsc_composite", "--input-tbc-json", str(self.tbc_json)] ) self.files = FileHelper(opts, self.config) self.assertTrue(self.files.tbc_json.video_system, VideoSystem.NTSC) def test_default_decoder_ntsc_cvbs(self) -> None: # noqa: D102 - opts = opts_parser.parse_opts( + _, opts = opts_parser.parse_opts( self.config, [ str(self.path), @@ -126,7 +126,7 @@ def test_ffmpeg_opts_ntsc_cvbs(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = opts_parser.parse_opts( + _, opts = opts_parser.parse_opts( self.config, [ str(self.path), @@ -243,7 +243,7 @@ def test_ffmpeg_opts_ntsc_cvbs_luma(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "ntsc_composite", @@ -356,7 +356,7 @@ def test_ffmpeg_opts_ntsc_cvbs_luma_4fsc(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "ntsc_composite", diff --git a/tests/test_wrappers_ntsc_composite_ld.py b/tests/test_wrappers_ntsc_composite_ld.py index 4616a31..d457e0e 100644 --- a/tests/test_wrappers_ntsc_composite_ld.py +++ b/tests/test_wrappers_ntsc_composite_ld.py @@ -34,7 +34,7 @@ def setUp(self) -> None: # noqa: D102 self.maxDiff = 99999 def test_videosystem(self) -> None: # noqa: D102 - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "ntsc_composite_ld", @@ -46,7 +46,7 @@ def test_videosystem(self) -> None: # noqa: D102 self.assertTrue(self.files.tbc_json.video_system, VideoSystem.NTSC) def test_ld_detect(self) -> None: # noqa: D102 - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "ntsc_composite_ld", @@ -58,7 +58,7 @@ def test_ld_detect(self) -> None: # noqa: D102 self.assertTrue(self.files.is_combined_ld) def test_default_decoder_ntsc_ld(self) -> None: # noqa: D102 - opts = opts_parser.parse_opts( + _, opts = opts_parser.parse_opts( self.config, [ str(self.path), @@ -144,7 +144,7 @@ def test_ffmpeg_opts_ntsc_ld(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = opts_parser.parse_opts( + _, opts = opts_parser.parse_opts( self.config, [ str(self.path), @@ -261,7 +261,7 @@ def test_ffmpeg_opts_ntsc_ld_luma(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "ntsc_composite_ld", @@ -374,7 +374,7 @@ def test_ffmpeg_opts_ntsc_ld_luma_4fsc(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "ntsc_composite_ld", diff --git a/tests/test_wrappers_ntsc_svideo.py b/tests/test_wrappers_ntsc_svideo.py index 5ad4a35..aaaa8a7 100644 --- a/tests/test_wrappers_ntsc_svideo.py +++ b/tests/test_wrappers_ntsc_svideo.py @@ -32,12 +32,12 @@ def setUp(self) -> None: # noqa: D102 self.pipe = PipeFactory.create_dummy_pipe() def test_videosystem(self) -> None: # noqa: D102 - opts = self.parse_opts([str(self.path), "ntsc_svideo"]) + _, opts = self.parse_opts([str(self.path), "ntsc_svideo"]) self.files = FileHelper(opts, self.config) self.assertTrue(self.files.tbc_json.video_system, VideoSystem.PAL) def test_decoder_default_luma_decoder_ntsc_svideo(self) -> None: # noqa: D102 - opts = self.parse_opts([str(self.path), "ntsc_svideo", "--threads", "4"]) + _, opts = self.parse_opts([str(self.path), "ntsc_svideo", "--threads", "4"]) self.files = FileHelper(opts, self.config) state = ProgramState(opts, self.config, self.files) @@ -65,7 +65,7 @@ def test_decoder_default_luma_decoder_ntsc_svideo(self) -> None: # noqa: D102 ) def test_decoder_default_chroma_decoder_ntsc_svideo(self) -> None: # noqa: D102 - opts = self.parse_opts([str(self.path), "ntsc_svideo", "--threads", "4"]) + _, opts = self.parse_opts([str(self.path), "ntsc_svideo", "--threads", "4"]) self.files = FileHelper(opts, self.config) state = ProgramState(opts, self.config, self.files) @@ -143,7 +143,7 @@ def test_ffmpeg_opts_ntsc_svideo(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = self.parse_opts([str(self.path), "ntsc_svideo", "--threads", "4"]) + _, opts = self.parse_opts([str(self.path), "ntsc_svideo", "--threads", "4"]) self.files = FileHelper(opts, self.config) state = ProgramState(opts, self.config, self.files) @@ -250,7 +250,7 @@ def test_ffmpeg_opts_ntsc_svideo_luma(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "ntsc_svideo", @@ -363,7 +363,7 @@ def test_ffmpeg_opts_ntsc_svideo_luma_4fsc(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "ntsc_svideo", diff --git a/tests/test_wrappers_pal_composite_.py b/tests/test_wrappers_pal_composite_.py index 646d28e..733e14f 100644 --- a/tests/test_wrappers_pal_composite_.py +++ b/tests/test_wrappers_pal_composite_.py @@ -32,14 +32,14 @@ def setUp(self) -> None: # noqa: D102 self.pipe = PipeFactory.create_dummy_pipe() def test_videosystem_pal(self) -> None: # noqa: D102 - opts = self.parse_opts( + _, opts = self.parse_opts( [str(self.path), "pal_composite", "--input-tbc-json", str(self.tbc_json)] ) self.files = FileHelper(opts, self.config) self.assertTrue(self.files.tbc_json.video_system, VideoSystem.PAL) def test_decoder_default_decoder_opts_pal(self) -> None: # noqa: D102 - opts = opts_parser.parse_opts( + _, opts = opts_parser.parse_opts( self.config, [ str(self.path), @@ -125,7 +125,7 @@ def test_default_ffmpeg_opts_cvbs_pal(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = opts_parser.parse_opts( + _, opts = opts_parser.parse_opts( self.config, [ str(self.path), @@ -242,7 +242,7 @@ def test_ffmpeg_opts_pal_cvbs_luma(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "pal_composite", @@ -355,7 +355,7 @@ def test_ffmpeg_opts_pal_cvbs_luma_4fsc(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "pal_composite", diff --git a/tests/test_wrappers_pal_composite_ld.py b/tests/test_wrappers_pal_composite_ld.py index c2ecf53..e4db8f0 100644 --- a/tests/test_wrappers_pal_composite_ld.py +++ b/tests/test_wrappers_pal_composite_ld.py @@ -32,21 +32,21 @@ def setUp(self) -> None: # noqa: D102 self.pipe = PipeFactory.create_dummy_pipe() def test_videosystem(self) -> None: # noqa: D102 - opts = self.parse_opts( + _, opts = self.parse_opts( [str(self.path), "pal_composite_ld", "--input-tbc-json", str(self.tbc_json)] ) self.files = FileHelper(opts, self.config) self.assertTrue(self.files.tbc_json.video_system, VideoSystem.PAL) def test_ld_detect(self) -> None: # noqa: D102 - opts = self.parse_opts( + _, opts = self.parse_opts( [str(self.path), "pal_composite_ld", "--input-tbc-json", str(self.tbc_json)] ) self.files = FileHelper(opts, self.config) self.assertTrue(self.files.is_combined_ld) def test_default_decoder_pal_ld(self) -> None: # noqa: D102 - opts = opts_parser.parse_opts( + _, opts = opts_parser.parse_opts( self.config, [ str(self.path), @@ -132,7 +132,7 @@ def test_ffmpeg_opts_pal_ld(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = opts_parser.parse_opts( + _, opts = opts_parser.parse_opts( self.config, [ str(self.path), @@ -249,7 +249,7 @@ def test_ffmpeg_opts_pal_ld_luma(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "pal_composite_ld", @@ -362,7 +362,7 @@ def test_ffmpeg_opts_pal_ld_luma_4fsc(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "pal_composite_ld", diff --git a/tests/test_wrappers_pal_svideo.py b/tests/test_wrappers_pal_svideo.py index d5403e5..4e44e84 100644 --- a/tests/test_wrappers_pal_svideo.py +++ b/tests/test_wrappers_pal_svideo.py @@ -32,12 +32,12 @@ def setUp(self) -> None: # noqa: D102 self.pipe = PipeFactory.create_dummy_pipe() def test_videosystem(self) -> None: # noqa: D102 - opts = self.parse_opts([str(self.path), "pal_svideo"]) + _, opts = self.parse_opts([str(self.path), "pal_svideo"]) self.files = FileHelper(opts, self.config) self.assertTrue(self.files.tbc_json.video_system, VideoSystem.PAL) def test_decoder_default_luma_decoder_pal_svideo(self) -> None: # noqa: D102 - opts = self.parse_opts([str(self.path), "pal_svideo", "--threads", "4"]) + _, opts = self.parse_opts([str(self.path), "pal_svideo", "--threads", "4"]) self.files = FileHelper(opts, self.config) state = ProgramState(opts, self.config, self.files) @@ -64,7 +64,7 @@ def test_decoder_default_luma_decoder_pal_svideo(self) -> None: # noqa: D102 ) def test_decoder_default_chroma_decoder_pal_svideo(self) -> None: # noqa: D102 - opts = self.parse_opts([str(self.path), "pal_svideo", "--threads", "4"]) + _, opts = self.parse_opts([str(self.path), "pal_svideo", "--threads", "4"]) self.files = FileHelper(opts, self.config) state = ProgramState(opts, self.config, self.files) @@ -141,7 +141,7 @@ def test_ffmpeg_opts_pal_svideo(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = self.parse_opts([str(self.path), "pal_svideo", "--threads", "4"]) + _, opts = self.parse_opts([str(self.path), "pal_svideo", "--threads", "4"]) self.files = FileHelper(opts, self.config) state = ProgramState(opts, self.config, self.files) @@ -248,7 +248,7 @@ def test_ffmpeg_opts_pal_svideo_luma(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "pal_svideo", @@ -361,7 +361,7 @@ def test_ffmpeg_opts_pal_svideo_luma_4fsc(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "pal_svideo", diff --git a/tests/test_wrappers_palm_svideo.py b/tests/test_wrappers_palm_svideo.py index b0f3351..03cf6bd 100644 --- a/tests/test_wrappers_palm_svideo.py +++ b/tests/test_wrappers_palm_svideo.py @@ -32,12 +32,12 @@ def setUp(self) -> None: # noqa: D102 self.pipe = PipeFactory.create_dummy_pipe() def test_videosystem(self) -> None: # noqa: D102 - opts = self.parse_opts([str(self.path), "palm_svideo"]) + _, opts = self.parse_opts([str(self.path), "palm_svideo"]) self.files = FileHelper(opts, self.config) self.assertTrue(self.files.tbc_json.video_system, VideoSystem.PAL) def test_decoder_default_luma_decoder_palm_svideo(self) -> None: # noqa: D102 - opts = self.parse_opts([str(self.path), "palm_svideo", "--threads", "4"]) + _, opts = self.parse_opts([str(self.path), "palm_svideo", "--threads", "4"]) self.files = FileHelper(opts, self.config) state = ProgramState(opts, self.config, self.files) @@ -64,7 +64,7 @@ def test_decoder_default_luma_decoder_palm_svideo(self) -> None: # noqa: D102 ) def test_decoder_default_chroma_decoder_palm_svideo(self) -> None: # noqa: D102 - opts = self.parse_opts([str(self.path), "palm_svideo", "--threads", "4"]) + _, opts = self.parse_opts([str(self.path), "palm_svideo", "--threads", "4"]) self.files = FileHelper(opts, self.config) state = ProgramState(opts, self.config, self.files) @@ -141,7 +141,7 @@ def test_ffmpeg_opts_palm_svideo(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = self.parse_opts([str(self.path), "palm_svideo", "--threads", "4"]) + _, opts = self.parse_opts([str(self.path), "palm_svideo", "--threads", "4"]) self.files = FileHelper(opts, self.config) state = ProgramState(opts, self.config, self.files) @@ -248,7 +248,7 @@ def test_ffmpeg_opts_palm_svideo_luma(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "palm_svideo", @@ -361,7 +361,7 @@ def test_ffmpeg_opts_palm_svideo_luma_4fsc(self) -> None: MaxSlicesCount : 24 ErrorDetectionType : Per slice """ # noqa: E501 - opts = self.parse_opts( + _, opts = self.parse_opts( [ str(self.path), "palm_svideo",