diff --git a/main.py b/main.py index b8692c1..d636b4e 100755 --- a/main.py +++ b/main.py @@ -79,15 +79,11 @@ def shutdown() -> NoReturn: sys.exit() -if __name__ == "__main__": +def run(config): if sys.version_info.major != 3 or sys.version_info.minor != 10: print("Hey! Congratulations, you've made it so far (which is pretty rare with no Python 3.10). Unfortunately, this program only works on Python 3.10. Please install Python 3.10 and try again.") sys.exit() ffmpeg_install() - directory = Path().absolute() - config = settings.check_toml( - f"{directory}/utils/.config.template.toml", f"{directory}/config.toml" - ) config is False and sys.exit() if ( @@ -130,3 +126,11 @@ if __name__ == "__main__": f'Config: {config["settings"]}' ) raise err + + +if __name__ == "__main__": + directory = Path().absolute() + config = settings.check_toml( + f"{directory}/utils/.config.template.toml", f"{directory}/config.toml" + ) + run(config) \ No newline at end of file diff --git a/video_generator.py b/video_generator.py index d8a6036..acfc9b8 100644 --- a/video_generator.py +++ b/video_generator.py @@ -2,8 +2,6 @@ import os, shutil from moviepy.editor import concatenate_videoclips, VideoFileClip from main import run -# This class must be run from the top level, not from inside the containing directory - class VideoGenerator(): def __init__(self, config): self.config = config