ycleptic.src.walkers module

Recursive functions that traverse the attribute tree for setting values

ycleptic.src.walkers.dwalk(D: dict, I: dict)[source]

Recursively process the user’s config-dict I by walking recursively through it along with the default config-specification dict D

Parameters:
  • D (dict) – The attribute specification dictionary to walk through.

  • I (dict) – The user’s config dictionary to be processed.

ycleptic.src.walkers.lwalk(D: dict, L: list[dict])[source]

Recursively processes a list of items L by walking recursively through it along with the default config-specification dict D

Parameters:
  • D (dict) – The attribute specification dictionary.

  • L (list of dict) – The list of dictionary items to be processed against D.

ycleptic.src.walkers.make_def(L: list[dict], H: dict, *args)[source]

Recursively generates YAML-format default user-config hierarchy with default attribute values

Parameters:
  • L (list of dict) – The list of attributes to traverse (the “base config”)

  • H (dict) – The dictionary to populate with default values (the “user config”)

  • args (tuple) – The current attribute names to traverse in the hierarchy.

ycleptic.src.walkers.mwalk(D1: dict, D2: dict)[source]

Recursively updates the base config D1 with base config D2. This is used when reading a user dotfile that defines a partial base config in addition to whatever the user app base config defines.

Parameters:
  • D1 (dict) – The base config dictionary to be updated.

  • D2 (dict) – The base config dictionary that contains the new values to merge into D1. This is typically the user dotfile that defines a partial base config.