-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path__init__.py
More file actions
50 lines (41 loc) · 1.55 KB
/
Copy path__init__.py
File metadata and controls
50 lines (41 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"""A CLI for Vuforia Web Services."""
from importlib.metadata import PackageNotFoundError, version
import click
from beartype import beartype
from vws_cli.commands import (
add_target,
delete_target,
get_database_summary_report,
get_duplicate_targets,
get_target_record,
get_target_summary_report,
list_targets,
update_target,
wait_for_target_processed,
)
_CONTEXT_SETTINGS = {"help_option_names": ["-h", "--help"]}
try:
__version__ = version(distribution_name=__name__)
except PackageNotFoundError: # pragma: no cover
# When pkg_resources and git tags are not available,
# for example in a PyInstaller binary,
# we write the file ``_setuptools_scm_version.py`` on ``pip install``.
from ._setuptools_scm_version import __version__
@click.group(name="vws", context_settings=_CONTEXT_SETTINGS)
# We set the ``version`` parameter because in PyInstaller binaries,
# ``pkg_resources`` is not available.
#
# Click uses ``pkg_resources`` to determine the version if it is not given.
@click.version_option(version=__version__)
@beartype
def vws_group() -> None:
"""Manage a Vuforia Web Services cloud database."""
vws_group.add_command(cmd=add_target)
vws_group.add_command(cmd=delete_target)
vws_group.add_command(cmd=get_database_summary_report)
vws_group.add_command(cmd=get_duplicate_targets)
vws_group.add_command(cmd=get_target_record)
vws_group.add_command(cmd=get_target_summary_report)
vws_group.add_command(cmd=list_targets)
vws_group.add_command(cmd=update_target)
vws_group.add_command(cmd=wait_for_target_processed)