Skip to content

Commit

Permalink
Reorganize controllers into dedicated folder
Browse files Browse the repository at this point in the history
Move the controllers into a controller directory. This removes the need
to identify the type of information contained in a particular module by
its filename.

Move bin/ammo to ammo/bin/ammo. This cleans up the base directory of the
repository.

Delete the base level __init__.py. This provides a clear boundary
between the ammo module and tests.
  • Loading branch information
cyberrumor committed Dec 13, 2024
1 parent cec2e30 commit 7eacb02
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion bin/ammo → ammo/bin/ammo
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import argparse
from pathlib import Path

from ammo.game_controller import GameController
from ammo.ui import UI
from ammo.controller.game import GameController

parser = argparse.ArgumentParser(description="Manage mods for Bethesda games.")

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions ammo/bethesda_controller.py → ammo/controller/bethesda.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
dataclass,
field,
)
from .mod_controller import (
from .mod import (
ModController,
Game,
)
from .component import (
from ammo.component import (
Mod,
Download,
Plugin,
Expand Down
6 changes: 3 additions & 3 deletions ammo/fomod_controller.py → ammo/controller/fomod.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from pathlib import Path
from xml.etree import ElementTree
from functools import reduce
from .ui import Controller
from .component import Mod
from .lib import normalize
from ammo.ui import Controller
from ammo.component import Mod
from ammo.lib import normalize


@dataclass
Expand Down
6 changes: 3 additions & 3 deletions ammo/game_controller.py → ammo/controller/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
field,
)
from pathlib import Path
from .mod_controller import (
from .mod import (
Game,
ModController,
)
from .bethesda_controller import (
from .bethesda import (
BethesdaController,
BethesdaGame,
)
from .ui import (
from ammo.ui import (
Controller,
UI,
)
Expand Down
11 changes: 5 additions & 6 deletions ammo/mod_controller.py → ammo/controller/mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,20 @@
from enum import (
EnumMeta,
)
from .ui import (
from ammo.ui import (
UI,
Controller,
)
from .tool_controller import ToolController
from .fomod_controller import FomodController
from .component import (
from ammo.component import (
Mod,
Download,
)
from .lib import (
from ammo.lib import (
normalize,
NO_EXTRACT_DIRS,
)

from .tool import ToolController
from .fomod import FomodController

log = logging.getLogger(__name__)

Expand Down
6 changes: 3 additions & 3 deletions ammo/tool_controller.py → ammo/controller/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from enum import (
EnumMeta,
)
from .ui import Controller
from .component import Download
from .lib import NO_EXTRACT_DIRS
from ammo.ui import Controller
from ammo.component import Download
from ammo.lib import NO_EXTRACT_DIRS


class Tool:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
description="A simple terminal based mod organizer for Linux.",
author="cyberrumor",
url="https://github.com/cyberrumor/ammo",
packages=["ammo"],
scripts=["bin/ammo"],
packages=["ammo", "ammo/controller"],
scripts=["ammo/bin/ammo"],
)
4 changes: 2 additions & 2 deletions test/bethesda/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import shutil
from pathlib import Path

from ammo.bethesda_controller import (
from ammo.controller.bethesda import (
BethesdaController,
BethesdaGame,
)
from ammo.fomod_controller import FomodController
from ammo.controller.fomod import FomodController
from ammo.component import Mod


Expand Down

0 comments on commit 7eacb02

Please sign in to comment.