Skip to content

autonomy.cli.utils.click_utils

Usefule click utils.

image_profile_flag

def image_profile_flag(default: str = ImageProfiles.PRODUCTION,
                       mark_default: bool = True) -> Callable

Choice of one flag between: '--local/--remote'.

abci_spec_format_flag

def abci_spec_format_flag(
        default: str = FSMSpecificationLoader.OutputFormats.YAML,
        mark_default: bool = True) -> Callable

Flags for abci spec outputs formats.

chain_selection_flag

def chain_selection_flag(
    default: ChainType = ChainType.LOCAL,
    mark_default: bool = True,
    help_string_format:
    str = "To use {} chain profile to interact with the contracts"
) -> Callable

Flags for abci spec outputs formats.

sys_path_patch

@contextlib.contextmanager
def sys_path_patch(path: Path) -> Generator

Patch sys.path variable with new import path at highest priority.

PathArgument Objects

class PathArgument(click.Path)

Path parameter for CLI.

convert

def convert(value: Any, param: Optional[click.Parameter],
            ctx: Optional[click.Context]) -> Optional[Path]

Convert path string to pathlib.Path

NFTArgument Objects

class NFTArgument(click.ParamType)

NFT parameter for minting tools.

get_metavar

def get_metavar(param: click.Parameter) -> str

Get metavar

convert

def convert(value: Any, param: Optional[click.Parameter],
            ctx: Optional[click.Context]) -> Optional[Union[Path, IPFSHash]]

Convert path string to pathlib.Path

image_author_option

def image_author_option(fn: Callable) -> Callable

Wrap function with clik option for image-author