1
0
Fork 0
mirror of https://github.com/yavook/kiwi-scp.git synced 2024-11-24 21:52:59 +00:00

Removed Clutter

This commit is contained in:
Jörn-Michael Miehe 2021-11-13 01:12:27 +01:00
parent 2e37291a68
commit e7e6e5867a
3 changed files with 6 additions and 11 deletions

View file

@ -5,7 +5,7 @@ from typing import List, Tuple, Iterable, Any, Type
import click
from ..instance import Instance, Project, Services
from ..instance import Instance, Project
class KiwiCLI(click.MultiCommand):
@ -83,7 +83,7 @@ class KiwiCommand:
@classmethod
def run_for_new_project(cls, instance: Instance, project_name: str, **kwargs) -> None:
raise Exception
cls.print_error(f"Project '{project_name}' not in kiwi-scp instance at '{instance.directory}'!")
@classmethod
def run_for_existing_project(cls, instance: Instance, project: Project, **kwargs) -> None:

View file

@ -38,7 +38,7 @@ class CMD(KiwiCommand):
"""Initialize or reconfigure a kiwi-scp instance"""
@classmethod
def run_for_instance(cls, instance: Instance, output: Path = None, force: bool = None, **kwargs) -> None:
def run_for_instance(cls, instance: Instance, output: Path = None, force: bool = None) -> None:
if output is not None:
instance.directory = output

View file

@ -21,7 +21,7 @@ class CMD(KiwiCommand):
"""List projects in this instance, services inside a project or service(s) inside a project"""
@classmethod
def run_for_instance(cls, instance: Instance, show: bool = None, **kwargs) -> None:
def run_for_instance(cls, instance: Instance, show: bool = None) -> None:
if show:
KiwiCommand.print_header(f"Showing config for kiwi-scp instance at '{instance.directory}'.")
click.echo_via_pager(instance.config.kiwi_yml)
@ -34,7 +34,7 @@ class CMD(KiwiCommand):
)
@classmethod
def run_for_existing_project(cls, instance: Instance, project: Project, show: bool = None, **kwargs) -> None:
def run_for_existing_project(cls, instance: Instance, project: Project, show: bool = None) -> None:
if show:
KiwiCommand.print_header(f"Showing config for all services in project '{project.name}'.")
click.echo_via_pager(str(project.services))
@ -44,12 +44,7 @@ class CMD(KiwiCommand):
KiwiCommand.print_list(service.name for service in project.services.content)
@classmethod
def run_for_new_project(cls, instance: Instance, project_name: str, **kwargs) -> None:
KiwiCommand.print_error(f"Project '{project_name}' not in kiwi-scp instance at '{instance.directory}'!")
@classmethod
def run_for_services(cls, instance: Instance, project: Project, service_names: List[str], show: bool = None,
**kwargs) -> None:
def run_for_services(cls, instance: Instance, project: Project, service_names: List[str], show: bool = None) -> None:
services = project.services.filter_existing(service_names)
if show:
service_names = [service.name for service in services.content]