From c7e5a1969dc99fb7844efe3b32172a1bdd2210d8 Mon Sep 17 00:00:00 2001 From: WyattBlue Date: Mon, 11 Dec 2023 06:42:54 -0500 Subject: [PATCH] Remove --add option --- auto_editor/make_layers.py | 48 ++-------------------------- auto_editor/subcommands/test.py | 55 --------------------------------- auto_editor/utils/types.py | 1 - 3 files changed, 2 insertions(+), 102 deletions(-) diff --git a/auto_editor/make_layers.py b/auto_editor/make_layers.py index 5173113ae2..d95cb27400 100644 --- a/auto_editor/make_layers.py +++ b/auto_editor/make_layers.py @@ -10,20 +10,8 @@ from auto_editor.lang.palet import Lexer, Parser, env, interpret, is_boolarr from auto_editor.lib.data_structs import print_str from auto_editor.lib.err import MyError -from auto_editor.timeline import ( - ALayer, - ASpace, - TlAudio, - TlVideo, - VLayer, - VSpace, - audio_objects, - v1, - v3, - visual_objects, -) +from auto_editor.timeline import ASpace, TlAudio, TlVideo, VSpace, v1, v3 from auto_editor.utils.chunks import Chunks, chunkify, chunks_len, merge_chunks -from auto_editor.utils.cmdkw import ParserError, parse_with_palet from auto_editor.utils.func import mut_margin from auto_editor.utils.types import Args, CoerceError, time @@ -159,39 +147,7 @@ def make_timeline( ) v1_compatiable = None if inp is None else v1(inp, chunks) - tl = v3(inp, tb, sr, res, args.background, vclips, aclips, v1_compatiable) - - w, h = res - pool: VLayer = [] - apool: ALayer = [] - - env["start"] = 0 - env["end"] = tl.end - - for obj_attrs_str in args.add: - exploded = obj_attrs_str.split(":", 1) - obj_s = exploded[0] - attrs = "" if len(exploded) == 1 else exploded[1] - - try: - if obj_s in visual_objects: - dic_obj = parse_with_palet(attrs, visual_objects[obj_s][1], env) - pool.append(visual_objects[obj_s][0](**dic_obj)) - elif obj_s in audio_objects: - dic_obj = parse_with_palet(attrs, audio_objects[obj_s][1], env) - apool.append(audio_objects[obj_s][0](**dic_obj)) - else: - log.error(f"Unknown timeline object: '{obj_s}'") - except (ParserError, CoerceError) as e: - log.error(e) - - for vobj in pool: - tl.v.append([vobj]) - - for aobj in apool: - tl.a.append([aobj]) - - return tl + return v3(inp, tb, sr, res, args.background, vclips, aclips, v1_compatiable) def make_layers( diff --git a/auto_editor/subcommands/test.py b/auto_editor/subcommands/test.py index 4783da2c90..3e3c5ea07b 100644 --- a/auto_editor/subcommands/test.py +++ b/auto_editor/subcommands/test.py @@ -242,27 +242,6 @@ def example(): return out - def add_audio(): - pass - # run.main( - # ["example.mp4"], - # [ - # "--source", - # "snd:resources/wav/pcm-f32le.wav", - # "--add", - # 'audio:0.3sec,end,"snd",volume=0.3', - # ], - # ) - # return run.main( - # ["example.mp4"], - # [ - # "--source", - # "snd:resources/wav/pcm-f32le.wav", - # "--add", - # 'audio:2,40,"snd",3sec', - # ], - # ) - # PR #260 def high_speed_test(): return run.check(["example.mp4", "--video-speed", "99998"], "empty") @@ -393,36 +372,6 @@ def resolution_and_scale(): return out - def obj_makes_video(): - out = run.main( - ["resources/new-commentary.mp3"], - ["--add", 'rect:0,30,0,0,300,300,fill="blue"'], - "out.mp4", - ) - cn = checker.check(out) - assert len(cn.videos) == 1 - assert len(cn.audios) == 1 - assert cn.videos[0].width == 1920 - assert cn.videos[0].height == 1080 - assert cn.videos[0].fps == 30 - - return out - - def various_errors(): - run.check(["example.mp4", "--add", "rect:0,60", "--cut-out", "60,end"]) - - def render_video_objs(): - out = run.main( - ["resources/testsrc.mp4"], - [ - "--mark_as_loud", - "start,end", - "--add", - 'rect:0,30,0,200,100,300,fill="#43FA56"', - ], - ) - return out - def premiere(): results = set() for test_name in all_files: @@ -767,13 +716,9 @@ def palet_scripts(): json_tests, high_speed_test, video_speed, - obj_makes_video, multi_track_edit, concat_mux_tracks, concat_multiple_tracks, - render_video_objs, - various_errors, - add_audio, frame_rate, help_tests, version_test, diff --git a/auto_editor/utils/types.py b/auto_editor/utils/types.py index ed0aafc6e1..9e29ff1ae3 100644 --- a/auto_editor/utils/types.py +++ b/auto_editor/utils/types.py @@ -218,7 +218,6 @@ def resolution(val: str | None) -> tuple[int, int] | None: @dataclass class Args: - add: list[str] = field(default_factory=list) yt_dlp_location: str = "yt-dlp" download_format: str | None = None output_format: str | None = None