moic.cli package¶
Subpackages¶
- moic.cli.commands package
- moic.cli.completion package
- moic.cli.utils package
- moic.cli.validators package
Submodules¶
moic.cli.base module¶
Module for Moic configuration
Configuration file is stored under CONF_DIR and contains the following architecture
- default:
- contexts:
- name: my_context type: <plugin> login: my_login
current_context: my_context
-
class
moic.cli.base.CustomSettings[source]¶ Bases:
objectClass representing the current settings. It’s a subtree of global_settings containing only the configuration contained into the current context
-
drill_down(conf: dict, keys: list) → str[source]¶ Drill down into the configuration tree when the search key is composite For example : key.subkey.subsubkey
Parameters: - conf (dict) – The configuration to drill down
- keys (list) – The keys list which should be used to browse the conf
Returns: The value of the key in the conf
Return type: str
-
-
class
moic.cli.base.MoicInstance[source]¶ Bases:
objectMoicInstance Class represents the main class of the tool which should be herited by other Issuer Instance, such as MoicJiraInstance
-
add_context(force: bool = False) → None[source]¶ Add a new context in the configuration
Parameters: force (bool) – If True it doesn’t check the current configuration before
-
custom_config_label= 'Would you like to run custom configuration'¶
-
delete_context(context_name: str) → None[source]¶ Delete the given context from the contexts list. If it’s the current_context, set the current context to ‘’
Parameters: context_name (str) – The context name which should be deleted
-
instance= None¶
-
session¶ Property which retrieve the session to interact with the issuer
-
set_current_context(context_name: str) → None[source]¶ Set the current configuration context to use when executing commands
Parameters: context_name (str) – The context name which should be present in the contexts list
-
-
moic.cli.base.merge_config(a: dict, b: dict, path: str = None) → dict[source]¶ Merge two config dict together
Parameters: - a (dict) – The main config dict
- b (dict) – The secondary config dict which should be merged into a
- path (str) – The path where to merde
Returns: The merged dict
Return type: dict
-
moic.cli.base.merge_contexts(current_contexts: list, new_contexts: list) → list[source]¶ Merge two context list based on the context.name key It will update exiting contexts with new values and append non existing contexts
Parameters: - current_contexts (list) – The context list present in the configuration
- new_contexts (list) – The new context list to merge into the configuration
Returns: The aggregated context list
Return type: list
Module contents¶
Moic Cli Package