Source code for fastiot.cli.commands.print

from enum import Enum
from typing import Optional, List

import typer
from fastiot.cli.model.project import ProjectContext

from fastiot.cli.typer_app import app, DEFAULT_CONTEXT_SETTINGS


[docs]class ToPrint(str, Enum): project_namespace = 'project_namespace' library_package = 'library_package' library_setup_py_dir = 'library_setup_py_dir' services = 'services' deployments = 'deployments' integration_test_deployment = 'integration_test_deployment' test_package = 'test_package' npm_test_dir = 'npm_test_dir'
_name_help = """ Name can be any of:\n * project_namespace ... prints the project namespace.\n * library_package ... prints the specified library package.\n * library_setup_py_dir ... prints the library directory which includes the setup.py. If unset, nothing will be printed.\n * services ... prints all services which can be built.\n * deployments ... prints all deploy configs.\n * integration_test_deployment ... prints the name of the test integration deployment.\n * test_package ... prints the package for testing.\n * npm_test_dir ... prints the npm dir for testing.\n """
[docs]def check_name(name: str): included = True try: ToPrint(name) except ValueError: included = False if included is False: raise typer.BadParameter(f"Parameter for name is not valid: '{name}'") return name
def _name_completion() -> List[str]: return [e.value for e in ToPrint]