lib.configdirs

Resolver for the directory holding the user configuration (items, logics, structs, scenes, functions…).

With config_etc (the default) these directories live below <conf>/etc, otherwise directly below <conf>, where <conf> is the --config_dir directory or the base directory. SmartHome and lib.backup (which also runs from the command line without a SmartHome instance) resolve the setting and the directory through this module.

lib.configdirs.read_config_etc(extern_conf_dir, cmdline=False)[Quellcode]

Return the effective config_etc setting, reading etc/smarthome.yaml below extern_conf_dir.

Parameter:
  • extern_conf_dir (str) – configuration base directory (contains etc)

  • cmdline (bool) – True if --config_etc was given on the command line

Rückgabetyp:

bool

lib.configdirs.resolve_config_etc(cmdline, configured=None)[Quellcode]

Return the effective config_etc setting.

Parameter:
  • cmdline (bool) – True if --config_etc was given on the command line; it overrides configured

  • configured (object) – config_etc value from etc/smarthome.yaml, None if the key is absent

Rückgabetyp:

bool

lib.configdirs.user_conf_dir(extern_conf_dir, config_etc)[Quellcode]

Return the directory that contains the user config directories.

Parameter:
  • extern_conf_dir (str) – configuration base directory (contains etc)

  • config_etc (bool) – effective config_etc setting

Rückgabetyp:

str