mirror of
https://github.com/yavook/kiwi-scp.git
synced 2024-11-25 05:53:00 +00:00
move pass_instance decorator
This commit is contained in:
parent
69a0938daf
commit
829938e44f
3 changed files with 7 additions and 4 deletions
|
@ -2,6 +2,8 @@ import os
|
||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
|
from ..instance import Instance
|
||||||
|
|
||||||
|
|
||||||
class KiwiCLI(click.MultiCommand):
|
class KiwiCLI(click.MultiCommand):
|
||||||
"""Command Line Interface spread over multiple files in this directory"""
|
"""Command Line Interface spread over multiple files in this directory"""
|
||||||
|
@ -23,3 +25,6 @@ class KiwiCLI(click.MultiCommand):
|
||||||
except ImportError:
|
except ImportError:
|
||||||
return
|
return
|
||||||
return mod.cmd
|
return mod.cmd
|
||||||
|
|
||||||
|
|
||||||
|
pass_instance = click.make_pass_decorator(Instance, ensure=True)
|
||||||
|
|
|
@ -5,9 +5,10 @@ from pathlib import Path
|
||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
|
from .cli import pass_instance
|
||||||
from .._constants import KIWI_CONF_NAME
|
from .._constants import KIWI_CONF_NAME
|
||||||
from ..config import KiwiConfig
|
from ..config import KiwiConfig
|
||||||
from ..instance import Instance, pass_instance
|
from ..instance import Instance
|
||||||
from ..misc import user_query
|
from ..misc import user_query
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,3 @@ class Instance:
|
||||||
for service in services
|
for service in services
|
||||||
if service.name in service_names
|
if service.name in service_names
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
pass_instance = click.make_pass_decorator(Instance, ensure=True)
|
|
||||||
|
|
Loading…
Reference in a new issue