msticpy.config.mp_config_control module

MP Config Control Class.

class msticpy.config.mp_config_control.MpConfigControls(mp_config_def, mp_config)

Bases: object

Msticpy configuration and settings database.

Return an instance of MpConfigControls.

Parameters:
  • mp_config_def (Dict[str, Any]) – Msticpy config setting definitions.

  • mp_config (Dict[str, Any]) – Msticpy Settings dictionary

del_control(path)

Delete the control stored at path.

Parameters:

path (str)

del_value(path, keep_ctrl=False)

Delete setting item at path.

Parameters:
  • path (str)

  • keep_ctrl (bool)

get_control(path)

Return the control stored at path.

Parameters:

path (str)

Return type:

Any

get_defn(path)

Return the setting definition at path.

Parameters:

path (str)

Return type:

dict[str, Any] | tuple[str, Any]

get_value(path)

Return setting value at path.

Parameters:

path (str)

Return type:

Any

populate_ctrl_values(path)

Populate control at path from settings at path.

Parameters:

path (str)

rename_path(old_path, new_path)

Rename a setting from old_path to new_path.

Parameters:
  • old_path (str)

  • new_path (str)

save_ctrl_values(path)

Save the values in the control at path to settings.

Parameters:

path (str)

set_control(path, control)

Set the control stored at path.

Parameters:

path (str)

set_value(path, value)

Set setting value at path to value.

Parameters:
  • path (str)

  • value (Any)

validate_all_settings(show_all=False)

Validate settings against definitions.

Parameters:

show_all (bool, optional) – Show success validations as well as failures, by default False

Returns:

List of validation results: bool - True == valid status - validation result description

Return type:

List[ValidtnResult]

validate_setting(path, defn_path=None, show_all=False)

Validate settings against definitions for a specific path.

Parameters:
  • path (str) – The setting path

  • defn_path (Optional[str], optional) – The definition path, by default None Unless, specified this is the same as the setting path

  • show_all (bool, optional) – Return successful as well as failed validation results , by default False

Returns:

List of validation results: bool - True == valid status - validation result description

Return type:

List[ValidtnResult]

class msticpy.config.mp_config_control.ValidationResult(result, status)

Bases: tuple

Create new instance of ValidationResult(result, status)

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

result

Alias for field number 0

status

Alias for field number 1

msticpy.config.mp_config_control.get_mpconfig_definitions()

Return the current msticpyconfig definition dictionary.

Returns:

msticpyconfig definition dictionary

Return type:

Dict[str, Any]

Raises:

ValueError: – Could not load definitions from resources/mpconfig_defaults.yaml