fail2ban.client.configparserinc module
**************************************

class fail2ban.client.configparserinc.SafeConfigParserWithIncludes(share_config=None, *args, **kwargs)

   Bases: "ConfigParser"

      Class adds functionality to SafeConfigParser to handle included
      other configuration files (or may be urls, whatever in the
      future)

      File should have section [includes] and only 2 options
      implemented are 'files_before' and 'files_after' where files are
      listed 1 per line.

      Example:

   [INCLUDES] before = 1.conf

      3.conf

   after = 1.conf

      It is a simple implementation, so just basic care is taken about
      recursion. Includes preserve right order, ie new files are
      inserted to the list of read configs before original, and their
      includes correspondingly so the list should follow the leaves of
      the tree.

      I wasn't sure what would be the right way to implement generic
      (aka c++ template) so we could base at any >>*<<configparser
      class... so I will leave it for the future

   Attributes:
      **converters**
      **share_config**
   -[ Methods ]-

   +------------+--------------------------------------------------------------------------------------------+
   | "add_sect  | Create a new section in the configuration.                                                 |
   | ion"(sect  |                                                                                            |
   | ion)       |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "clear"()  |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "get"(sec  | Get an option value for a given section.                                                   |
   | tion,      |                                                                                            |
   | option,    |                                                                                            |
   | *[, raw,   |                                                                                            |
   | vars,      |                                                                                            |
   | fallback]) |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "get_ex"(  | Get an option value for a given section.                                                   |
   | section,   |                                                                                            |
   | option[,   |                                                                                            |
   | raw,       |                                                                                            |
   | vars])     |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "getint"(  |                                                                                            |
   | section,   |                                                                                            |
   | option,    |                                                                                            |
   | *[, raw,   |                                                                                            |
   | vars,      |                                                                                            |
   | fallback]) |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "has_opti  | Check for the existence of a given option in a given section.                              |
   | on"(secti  |                                                                                            |
   | on,        |                                                                                            |
   | option)    |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "has_sect  | Indicate whether the named section is present in the configuration.                        |
   | ion"(sect  |                                                                                            |
   | ion)       |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "items"([  | Return a list of (name, value) tuples for each option in a section.                        |
   | section,   |                                                                                            |
   | raw,       |                                                                                            |
   | vars])     |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "keys"()   |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "options"  | Return a list of option names for the given section name.                                  |
   | (section[, |                                                                                            |
   | withDefau  |                                                                                            |
   | lt])       |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "pop"(k[,  | If key is not found, d is returned if given, otherwise KeyError is raised.                 |
   | d])        |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "popitem"  | Remove a section from the parser and return it as a (section_name, section_proxy) tuple.   |
   | ()         |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "read"(fi  | Read and parse a filename or an iterable of filenames.                                     |
   | lenames[,  |                                                                                            |
   | get_inclu  |                                                                                            |
   | des])      |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "read_dic  | Read configuration from a dictionary.                                                      |
   | t"(dictio  |                                                                                            |
   | nary[,     |                                                                                            |
   | source])   |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "read_fil  | Like read() but the argument must be a file-like object.                                   |
   | e"(f[,     |                                                                                            |
   | source])   |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "read_str  | Read configuration from a given string.                                                    |
   | ing"(stri  |                                                                                            |
   | ng[,       |                                                                                            |
   | source])   |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "remove_o  | Remove an option.                                                                          |
   | ption"(se  |                                                                                            |
   | ction,     |                                                                                            |
   | option)    |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "remove_s  | Remove a file section.                                                                     |
   | ection"(s  |                                                                                            |
   | ection)    |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "sections  | Return a list of section names, excluding [DEFAULT]                                        |
   | "()        |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "set"(sec  | Set an option.                                                                             |
   | tion,      |                                                                                            |
   | option[,   |                                                                                            |
   | value])    |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "setdefau  |                                                                                            |
   | lt"(k[,d]) |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "update"(  | If E present and has a .keys() method, does:     for k in E: D[k] = E[k] If E present and  |
   | [E, ]**F)  | lacks .keys() method, does:     for (k, v) in E: D[k] = v In either case, this is followed |
   |            | by: for k, v in F.items(): D[k] = v                                                        |
   +------------+--------------------------------------------------------------------------------------------+
   | "values"() |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+
   | "write"(f  | Write an .ini-format representation of the configuration state.                            |
   | p[, space  |                                                                                            |
   | _around_d  |                                                                                            |
   | elimiters  |                                                                                            |
   | ])         |                                                                                            |
   +------------+--------------------------------------------------------------------------------------------+

   +-------------------+------------+
   | **defaults**      |            |
   +-------------------+------------+
   | **get_defaults**  |            |
   +-------------------+------------+
   | **get_sections**  |            |
   +-------------------+------------+
   | **getboolean**    |            |
   +-------------------+------------+
   | **getfloat**      |            |
   +-------------------+------------+
   | **merge_section** |            |
   +-------------------+------------+
   | **optionxform**   |            |
   +-------------------+------------+

   CONDITIONAL_RE = re.compile('^(\\w+)(\\?.+)$')

   SECTION_NAME = 'INCLUDES'

   SECTION_OPTNAME_CRE = re.compile('^([\\w\\-]+)/([^\\s>]+)$')

   SECTION_OPTSUBST_CRE = re.compile('%\\(([\\w\\-]+/([^\\)]+))\\)s')

   get_defaults()

   get_ex(section, option, raw=False, vars={})

      Get an option value for a given section.

      In opposite to *get*, it differentiate session-related option
      name like *sec/opt*.

   get_sections()

   merge_section(section, options, pref=None)

   options(section, withDefault=True)

      Return a list of option names for the given section name.

      Parameter *withDefault* controls the include of names from
      section *[DEFAULT]*

   read(filenames, get_includes=True)

      Read and parse a filename or an iterable of filenames.

      Files that cannot be opened are silently ignored; this is
      designed so that you can specify an iterable of potential
      configuration file locations (e.g. current directory, user's
      home directory, systemwide directory), and all existing
      configuration files in the iterable will be read.  A single
      filename may also be given.

      Return list of successfully read files.

   property share_config
