morpheus.cli.utils#
Misc. utilities for the CLI
Functions
|
Returns the config from a click context |
|
Returns a list of keys for the given enum. |
|
Returns a dict of enum members for the given enum. |
Returns a list of all available logging levels in string format |
|
|
If |
Returns the pipeline from a click context |
|
|
Returns True if the given class is an enum. |
|
Determines if the given |
|
Parses a string into an enum value. |
|
Click callback that parses a command line value into a logging level |
|
Decorator ensuring that a click.Context object is passed as the first argument to the decorated function |
Ensures the click.Context has |
|
|
Converts a string to a FileType enum member |
Removes keyword arguments that have a None value |
Classes
|
A specialization of the |
- get_package_relative_file(filename)[source]#
If
filenameis a relative path, and does not exist, attempt to locate the file relative to the directory of themorpheuspackage, if it exists return the abolute path of the file found. Otherwise returnsfilenameunchanged.
- is_pybind_enum(cls)[source]#
Determines if the given
clsis an enum. C++ enums exposed via pybind11 do not inherit from Enum, but do expose the__members__convention. https://docs.python.org/3.10/library/enum.html?highlight=__members__#iteration
- parse_enum(_, _2, value, enum_class, case_sensitive=True)[source]#
Parses a string into an enum value.
- parse_log_level(ctx, param, value)[source]#
Click callback that parses a command line value into a logging level
- prepare_command(parse_config=False)[source]#
Decorator ensuring that a click.Context object is passed as the first argument to the decorated function
- show_defaults(f)[source]#
Ensures the click.Context has
show_defaultsset to True. (Seems like a bug currently)