Skip to content

Commit

Permalink
squishy: cli: Switched from dynamic action collection to a static ini…
Browse files Browse the repository at this point in the history
…tialization for now
  • Loading branch information
lethalbit committed Oct 15, 2023
1 parent f097878 commit ffc6795
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions squishy/cli.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# SPDX-License-Identifier: BSD-3-Clause
import logging as log
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter, Namespace
from pathlib import Path
import logging as log
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter, Namespace

from rich import traceback
from rich.logging import RichHandler
from rich import traceback
from rich.logging import RichHandler

from . import actions, config
from .core.collect import collect_members, predicate_action
from . import config
from .actions.applet import Applet as ActionApplet
from .actions.cache import Cache as ActionCache
from .actions.provision import Provision as ActionProvision

__all__ = (
'main',
Expand Down Expand Up @@ -89,10 +90,10 @@ def main() -> int:
init_dirs()
setup_logging()

ACTIONS = collect_members(
Path(actions.__path__[0]),
predicate_action,
f'{actions.__name__}.'
ACTIONS = (
{ 'name': 'applet', 'instance': ActionApplet() },
{ 'name': 'cache', 'instance': ActionCache() },
{ 'name': 'provision', 'instance': ActionProvision() }
)

parser = ArgumentParser(
Expand Down

0 comments on commit ffc6795

Please sign in to comment.