config

The config module reads the Natlink config file (natlink.ini), as used by other modules, especially the loader.

class LogLevel(value)[source]

An enumeration.

not with envvariables, but special:

if NATLINK_USERDIR is set: return this, but… it should end with “.natlink” if NATLINK_USERDIR is NOT set: return Path.home()/’.natlink’

expand_path(input_path: str) str[source]

expand path if it starts with “~” or has environment variables (%XXXX%)

Paths can be:

  • the name of a python package, to be found along sys.path (typically in site-packages)

  • natlink_userdir/…: the directory where natlink.ini is is searched for, either %(NATLINK_USERDIR) or ~/.natlink

  • ~/…: the home directory

  • some environment variable: this environment variable is expanded.

The Documents directory can be found by “~Documents”…

When nothing to expand, return input