wiz.command_line¶
-
wiz.command_line.CONTEXT_SETTINGS= {'help_option_names': ['-h', '--help'], 'max_content_width': 90}¶ Click default context for all commands.
-
wiz.command_line.display_registries(paths)[source]¶ Display paths for each registry.
Example:
>>> display_registries(paths) [0] /path/to/registry-1 [1] /path/to/registry-2
Parameters: paths – List of registry paths.
-
wiz.command_line.display_definition(definition)[source]¶ Display definition.
Example:
>>> display_definition(definition) path: /path/to/foo.json registry: /path/to/registry identifier: Foo version: 0.1.0 description: Description of Foo install-location: /path/to/foo system: os: el >= 7, < 8 arch: x86_64 command: foo: FooExe environ: PATH: ${INSTALL_LOCATION}/bin:${PATH} LD_LIBRARY_PATH: ${INSTALL_LOCATION}/lib:${LD_LIBRARY_PATH}
Parameters: definition – Instance of wiz.definition.Definition.
-
wiz.command_line.display_command_mapping(command_mapping, package_mapping, registries, all_versions=False, with_system=False)[source]¶ Display command mapping.
Example:
>>> display_command_mapping( ... command_mapping, package_mapping, registries, all_versions=True ... ) Command Version System Registry Description ------- ------- ------------------- -------- ------------------ fooExe 1.0.0 noarch 0 Description of Foo fooExe 0.1.0 noarch 0 Description of Foo python 3.6.6 linux : el >= 6, <7 1 Python interpreter python 2.7.4 linux : el >= 6, <7 1 Python interpreter
Parameters: - command_mapping –
Mapping which associates all available commands with a package definition. It should be in the form of:
{ "fooExe": "foo", ... }
- package_mapping –
Mapping which associates each package definition with an identifier, a version and a system label. It should be in the form of:
{ "foo": { "1.1.0": { "linux : el >=6, <7": <Definition(identifier="foo")>, "linux : el >=7, <8": <Definition(identifier="foo")>, "0.1.0": { "linux : el >=6, <7": <Definition(identifier="foo")>, ... }, ... }
- registries – List of registry paths from which definitions were fetched.
- all_versions – Indicate whether all package definition versions should be displayed. Default is False, which means that only the latest version will be displayed.
- with_system – Indicate whether the package system should be displayed. Default is False.
- command_mapping –
-
wiz.command_line.display_package_mapping(package_mapping, registries, all_versions=False, with_system=False)[source]¶ Display package mapping
Example:
>>> display_command_mapping( ... package_mapping, registries, all_versions=True ... ) Package Version System Registry Description -------- ------- ------------------- -------- ------------------ foo 1.0.0 noarch 0 Description of Foo foo 0.1.0 noarch 0 Description of Foo bar [V1] 0.1.0 linux 0 Description of Bar bar [V2] 0.1.0 linux 0 Description of Bar bar [V3] 0.1.0 linux 0 Description of Bar python 3.6.6 linux : el >= 6, <7 0 Python interpreter python 2.7.4 linux : el >= 6, <7 0 Python interpreter
Parameters: - package_mapping –
Mapping which associates each package definition with an identifier, a version and a system label. It should be in the form of:
{ "foo": { "1.1.0": { "linux : el >=6, <7": <Definition(identifier="foo")>, "linux : el >=7, <8": <Definition(identifier="foo")>, "0.1.0": { "linux : el >=6, <7": <Definition(identifier="foo")>, ... }, ... }
- registries – List of registry paths from which definitions were fetched.
- all_versions – Indicate whether all package definition versions should be displayed. Default is False, which means that only the latest version will be displayed.
- with_system – Indicate whether the package system should be displayed. Default is False.
- package_mapping –
-
wiz.command_line.display_resolved_context(context)[source]¶ Display resolved context mapping.
Example:
>>> display_resolved_context(context) Package Version Registry Description ------- ------- -------- ------------------- foo 0.1.0 0 Description of Foo. bar 1.1.0 0 Description of Bar. Command Value ------- ------ foo fooExe Environment Variable Environment Value -------------------- -------------------- HOME /usr/people/john-doe LD_LIBRARY_PATH /path/to/foo/lib /path/to/bar/lib PATH /path/to/foo/bin /path/to/bar/bin /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin USER john-doe
Parameters: context – Context mapping as resolved by wiz.resolve_context().