From d9841a80fd37a322206c8d14fd67407b9e8f73ff Mon Sep 17 00:00:00 2001 From: WyattBlue Date: Sat, 11 Jan 2025 20:57:40 -0500 Subject: [PATCH] Rename subcommands to cmds for shorter filepaths --- auto_editor/__main__.py | 19 ++++--------------- auto_editor/{subcommands => cmds}/__init__.py | 0 auto_editor/{subcommands => cmds}/cache.py | 0 auto_editor/{subcommands => cmds}/desc.py | 0 auto_editor/{subcommands => cmds}/info.py | 0 auto_editor/{subcommands => cmds}/levels.py | 0 auto_editor/{subcommands => cmds}/palet.py | 0 auto_editor/{subcommands => cmds}/repl.py | 0 auto_editor/{subcommands => cmds}/subdump.py | 0 auto_editor/{subcommands => cmds}/test.py | 0 pyproject.toml | 8 ++++---- 11 files changed, 8 insertions(+), 19 deletions(-) rename auto_editor/{subcommands => cmds}/__init__.py (100%) rename auto_editor/{subcommands => cmds}/cache.py (100%) rename auto_editor/{subcommands => cmds}/desc.py (100%) rename auto_editor/{subcommands => cmds}/info.py (100%) rename auto_editor/{subcommands => cmds}/levels.py (100%) rename auto_editor/{subcommands => cmds}/palet.py (100%) rename auto_editor/{subcommands => cmds}/repl.py (100%) rename auto_editor/{subcommands => cmds}/subdump.py (100%) rename auto_editor/{subcommands => cmds}/test.py (100%) diff --git a/auto_editor/__main__.py b/auto_editor/__main__.py index 5276647f99..8f6b272564 100755 --- a/auto_editor/__main__.py +++ b/auto_editor/__main__.py @@ -286,21 +286,10 @@ def get_domain(url: str) -> str: def main() -> None: - subcommands = ( - "test", - "info", - "levels", - "subdump", - "desc", - "repl", - "palet", - "cache", - ) - - if len(sys.argv) > 1 and sys.argv[1] in subcommands: - obj = __import__( - f"auto_editor.subcommands.{sys.argv[1]}", fromlist=["subcommands"] - ) + commands = ("test", "info", "levels", "subdump", "desc", "repl", "palet", "cache") + + if len(sys.argv) > 1 and sys.argv[1] in commands: + obj = __import__(f"auto_editor.cmds.{sys.argv[1]}", fromlist=["cmds"]) obj.main(sys.argv[2:]) return diff --git a/auto_editor/subcommands/__init__.py b/auto_editor/cmds/__init__.py similarity index 100% rename from auto_editor/subcommands/__init__.py rename to auto_editor/cmds/__init__.py diff --git a/auto_editor/subcommands/cache.py b/auto_editor/cmds/cache.py similarity index 100% rename from auto_editor/subcommands/cache.py rename to auto_editor/cmds/cache.py diff --git a/auto_editor/subcommands/desc.py b/auto_editor/cmds/desc.py similarity index 100% rename from auto_editor/subcommands/desc.py rename to auto_editor/cmds/desc.py diff --git a/auto_editor/subcommands/info.py b/auto_editor/cmds/info.py similarity index 100% rename from auto_editor/subcommands/info.py rename to auto_editor/cmds/info.py diff --git a/auto_editor/subcommands/levels.py b/auto_editor/cmds/levels.py similarity index 100% rename from auto_editor/subcommands/levels.py rename to auto_editor/cmds/levels.py diff --git a/auto_editor/subcommands/palet.py b/auto_editor/cmds/palet.py similarity index 100% rename from auto_editor/subcommands/palet.py rename to auto_editor/cmds/palet.py diff --git a/auto_editor/subcommands/repl.py b/auto_editor/cmds/repl.py similarity index 100% rename from auto_editor/subcommands/repl.py rename to auto_editor/cmds/repl.py diff --git a/auto_editor/subcommands/subdump.py b/auto_editor/cmds/subdump.py similarity index 100% rename from auto_editor/subcommands/subdump.py rename to auto_editor/cmds/subdump.py diff --git a/auto_editor/subcommands/test.py b/auto_editor/cmds/test.py similarity index 100% rename from auto_editor/subcommands/test.py rename to auto_editor/cmds/test.py diff --git a/pyproject.toml b/pyproject.toml index 3bd487829e..ccbc2d16b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,10 +32,10 @@ homepage = "https://auto-editor.com" [project.scripts] "auto-editor" = "auto_editor.__main__:main" -aedesc = "auto_editor.subcommands.desc:main" -aeinfo = "auto_editor.subcommands.info:main" -aesubdump = "auto_editor.subcommands.subdump:main" -aelevels = "auto_editor.subcommands.levels:main" +aedesc = "auto_editor.cmds.desc:main" +aeinfo = "auto_editor.cmds.info:main" +aesubdump = "auto_editor.cmds.subdump:main" +aelevels = "auto_editor.cmds.levels:main" [tool.mypy] warn_unused_ignores = true