From 287ac21841119fe2c41b939abaa36563f51cc05e Mon Sep 17 00:00:00 2001 From: Zen <46526140+master-of-zen@users.noreply.github.com> Date: Fri, 14 May 2021 07:16:54 +0300 Subject: [PATCH] separate main package and cli --- av1an.py | 2 +- cli/__init__.py | 1 + cli/__main__.py | 19 +++++++++++++++++++ setup.py | 2 +- 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 cli/__init__.py create mode 100644 cli/__main__.py diff --git a/av1an.py b/av1an.py index 9926bf4..cf3ed94 100755 --- a/av1an.py +++ b/av1an.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 if __name__ == "__main__": - from av1an.__main__ import main + from cli.__main__ import main main() diff --git a/cli/__init__.py b/cli/__init__.py new file mode 100644 index 0000000..8d1c8b6 --- /dev/null +++ b/cli/__init__.py @@ -0,0 +1 @@ + diff --git a/cli/__main__.py b/cli/__main__.py new file mode 100644 index 0000000..573d999 --- /dev/null +++ b/cli/__main__.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +from av1an.arg_parse import Args +from av1an.manager import Manager +from av1an.startup.setup import startup_check + + +def main(): + """ + Running Av1an CLI + """ + parser = Args() + project = parser.get_project() + startup_check(project) + manager = Manager.Main(project) + manager.run() + + +if __name__ == "__main__": + main() diff --git a/setup.py b/setup.py index dc1df19..63ca8fc 100755 --- a/setup.py +++ b/setup.py @@ -49,7 +49,7 @@ setuptools.setup( py_modules=["av1an"], rust_extensions=[RustExtension("av1an.av1an", "Cargo.toml", binding=Binding.PyO3)], include_package_data=True, - entry_points={"console_scripts": ["av1an=av1an:main"]}, + entry_points={"console_scripts": ["av1an=cli:main"]}, classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License",