symconf.util module

class symconf.util.KVPair(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Bases: Action

symconf.util.absolute_path(path)[source]
Return type:

Path

symconf.util.color_text(text, *colorama_args)[source]

Colorama text helper function

Note: we attempt to preserve expected nested behavior by only resetting the groups (Fore, Back, Style) affected the styles passed in. This works when an outer call is changing styles in one group, and an inner call is changing styles in another, but not when affected groups overlap.

For example, if an outer call is setting the foreground color (e.g., Fore.GREEN), nested calls on the text being passed into the function can modify and reset the background or style with affecting the foreground. The primary use case here is styling a group of text a single color, but applying BRIGHT or DIM styles only to some text elements within. If we didn’t reset by group, the outer coloration request will be “canceled out” as soon as the first inner call is made (since the unconditional behavior just employs Style.RESET_ALL).

symconf.util.deep_update(mapping, *updating_mappings)[source]

Code adapted from pydantic

Return type:

dict

symconf.util.printc(text, *colorama_args)[source]
symconf.util.to_tilde_path(path)[source]

Abbreviate an absolute path by replacing HOME with “~”, if applicable.

Return type:

Path

symconf.util.xdg_config_path()[source]