moic.cli.utils package¶
Submodules¶
moic.cli.utils.base module¶
Module for base Moic cli utils function
-
moic.cli.utils.base.get_plugin_autocomplete(autocompleter: str)[source]¶ Get the autocomplete method corresponding to the resource type within the given plugin
Parameters: autocompleter (str) – Resource name to autocomplete Returns: The autocompletion function Return type: func
-
moic.cli.utils.base.get_plugin_command(command: str, method: str)[source]¶ Get a command from a plugin base on the plugin name If the command or the method in the command doesn’t exists, it will exit with a error message
Parameters: - command (str) – The command group used
- method (str) – The command inside the group
Returns: The function which should be called
Return type: func
-
moic.cli.utils.base.get_plugin_custom_commands(plugin: str)[source]¶ Get the list of custom commands and custom group defined in the plugin
Parameters: plugin (str) – Plugin name Returns: List of custom command to add to Moic Return type: list
-
moic.cli.utils.base.get_plugin_instance(plugin: str)[source]¶ Get the instance class within the given plugin
Parameters: plugin (str) – Plugin name Returns: The plugin Instance Return type: class
-
moic.cli.utils.base.get_plugin_validator(validator: str)[source]¶ Get the validator corresponding to the resource type within the given plugin
Parameters: validator (str) – The validator type name Returns: The validator function Return type: func
-
moic.cli.utils.base.get_template(project: str, type: str) → str[source]¶ Get template for a given project and type
Parameters: - project (str) – A project name
- type (str) – A issue type name
Returns: Path to the corresponding template
Return type: str
-
moic.cli.utils.base.print_comments(comments: list, prefix: str = '', oneline: bool = False)[source]¶
-
moic.cli.utils.base.print_issue(issue, prefix: str = '', oneline: bool = False, subtasks: bool = False, last: bool = True) → None[source]¶ Print an issue
Parameters: - issue – Issue to print
- prefix (str) – Prefix to display before each issue line
- oneline (bool) – If set to true each issue will be printed on one line
- subtasks (bool) – If set to true it will display the issue’s subtasks
Returns: None
-
moic.cli.utils.base.print_issues(issues: list, prefix: str = '', oneline: bool = False, subtasks: bool = False) → None[source]¶ Print issue list
Parameters: - issues (list) – List of issues to print
- prefix (str) – Prefix to display before each issue line
- oneline (bool) – If set to true each issue will be printed on one line
- subtasks (bool) – If set to true it will display the issue’s subtasks
Returns: None
-
moic.cli.utils.base.print_status(status) → None[source]¶ Print a Status
Parameters: status – Status to print Returns: None
-
moic.cli.utils.base.sort_issue_per_status(issues: list, project: str = None) → list[source]¶ Sort an issue liste based on the project defined workflow It will call the dedicated plugin function
Parameters: - issues (list) – The list of issues to sort
- project (str) – The project key
Returns: The sorted issues list
Return type: list
Module contents¶
Module for cli utils function