diff --git a/src/kiwi-config.py b/src/kiwi-config.py index c399ab0..0b47176 100755 --- a/src/kiwi-config.py +++ b/src/kiwi-config.py @@ -1,6 +1,9 @@ #!/usr/bin/env python3 + +# system import logging +# local import kiwi diff --git a/src/kiwi/__init__.py b/src/kiwi/__init__.py index 2f4a363..f53a9c1 100644 --- a/src/kiwi/__init__.py +++ b/src/kiwi/__init__.py @@ -1,3 +1,4 @@ +# local from .parser import Parser from .runner import Runner diff --git a/src/kiwi/_constants.py b/src/kiwi/_constants.py index e16de2c..8524233 100644 --- a/src/kiwi/_constants.py +++ b/src/kiwi/_constants.py @@ -1,3 +1,4 @@ +# system import os KIWI_ROOT = os.getenv('KIWI_ROOT', ".") diff --git a/src/kiwi/config.py b/src/kiwi/config.py index 22cf12d..c238766 100644 --- a/src/kiwi/config.py +++ b/src/kiwi/config.py @@ -1,9 +1,11 @@ +# system import copy import logging -import re import os +import re import yaml +# local from ._constants import KIWI_ROOT, KIWI_CONF_NAME ########### diff --git a/src/kiwi/parser.py b/src/kiwi/parser.py index 858fed9..497e520 100644 --- a/src/kiwi/parser.py +++ b/src/kiwi/parser.py @@ -1,3 +1,4 @@ +# system import argparse diff --git a/src/kiwi/runner.py b/src/kiwi/runner.py index 75cc6bc..37b08da 100644 --- a/src/kiwi/runner.py +++ b/src/kiwi/runner.py @@ -1,5 +1,7 @@ +# system import logging +# local from .config import LoadedConfig from .parser import Parser from .subcommands import * diff --git a/src/kiwi/subcommands/__init__.py b/src/kiwi/subcommands/__init__.py index 5219579..63c7d4c 100644 --- a/src/kiwi/subcommands/__init__.py +++ b/src/kiwi/subcommands/__init__.py @@ -1,9 +1,10 @@ +# local from .init import InitCommand -from .show import ShowCommand from .logs import LogsCommand +from .show import ShowCommand __all__ = [ 'InitCommand', - 'ShowCommand', - 'LogsCommand' + 'LogsCommand', + 'ShowCommand' ] diff --git a/src/kiwi/subcommands/_subcommand.py b/src/kiwi/subcommands/_subcommand.py index d6c890d..f8d6dd7 100644 --- a/src/kiwi/subcommands/_subcommand.py +++ b/src/kiwi/subcommands/_subcommand.py @@ -1,3 +1,4 @@ +# parent from ..parser import Parser @@ -14,5 +15,3 @@ class SubCommand: def run(self, config, args): pass - - diff --git a/src/kiwi/subcommands/init.py b/src/kiwi/subcommands/init.py index 12cb9f8..d1545c5 100644 --- a/src/kiwi/subcommands/init.py +++ b/src/kiwi/subcommands/init.py @@ -1,9 +1,11 @@ +# system import logging import os +# parent (display purposes only) from .._constants import KIWI_CONF_NAME -from ..config import DefaultConfig +# local from ._subcommand import SubCommand @@ -37,6 +39,8 @@ class InitCommand(SubCommand): logging.info(f"Initializing kiwi-config instance in '{os.getcwd()}'") if args.force and os.path.isfile(KIWI_CONF_NAME): + from ..config import DefaultConfig + logging.warning(f"Overwriting existing '{KIWI_CONF_NAME}'!") config = DefaultConfig.get() diff --git a/src/kiwi/subcommands/logs.py b/src/kiwi/subcommands/logs.py index 5755611..1928233 100644 --- a/src/kiwi/subcommands/logs.py +++ b/src/kiwi/subcommands/logs.py @@ -1,5 +1,7 @@ +# system import logging +# local from ._subcommand import SubCommand from .utils.dockercommand import DockerCommand diff --git a/src/kiwi/subcommands/show.py b/src/kiwi/subcommands/show.py index 3cb9069..672df0a 100644 --- a/src/kiwi/subcommands/show.py +++ b/src/kiwi/subcommands/show.py @@ -1,3 +1,4 @@ +# local from ._subcommand import SubCommand diff --git a/src/kiwi/subcommands/utils/dockercommand.py b/src/kiwi/subcommands/utils/dockercommand.py index 0a52b4e..5d5a28d 100644 --- a/src/kiwi/subcommands/utils/dockercommand.py +++ b/src/kiwi/subcommands/utils/dockercommand.py @@ -1,5 +1,7 @@ +# system import subprocess +# local from .executable import Executable diff --git a/src/kiwi/subcommands/utils/executable.py b/src/kiwi/subcommands/utils/executable.py index f71802b..2c1c56f 100644 --- a/src/kiwi/subcommands/utils/executable.py +++ b/src/kiwi/subcommands/utils/executable.py @@ -1,5 +1,6 @@ -import os +# system import logging +import os import subprocess