Package pology :: Module config

Module config

Access the user configuration of Pology.

The location and the syntax of the configuration file is described in the user manual, at doc/user/common.docbook#sec-cmconfig.

At every place where the user configuration is sourced, the API documentation should state which sections and fields (with their types) are accessed, how they are used, and what is the behavior when they are not set.


Author: Chusslove Illich (Часлав Илић) <caslav.ilic@gmx.net>

License: GPLv3

Classes
  section
Section of the configuration.
Functions
bool
has_section(name)
Check if the section of the configuration exists already.
bool
strbool(value)
Parse the string specification of a boolean value.
Variables
  __package__ = 'pology'
Function Details

has_section(name)

 

Check if the section of the configuration exists already.

Parameters:
  • name (string) - name of the section
Returns: bool
True if the section exists, False otherwise

strbool(value)

 

Parse the string specification of a boolean value.

Values considered false are: "0", "no", "false", "off"; and True: 1, "yes", "true", "on". String is stripped of leading and trailing whitespace and lowercased before matching.

If the string matches none of the expected logical specifiers, None is returned.

Parameters:
  • value (string) - string to parse
Returns: bool
parsed boolean