# Path: peekaboo/exceptions.py
# class PeekabooConfigException(PeekabooException):
#     pass
# 
# Path: peekaboo/toolbox/cortex.py
# class tlp(enum.Enum):
#     WHITE = 0
#     GREEN = 1
#     AMBER = 2
#     RED = 3


import re
import sys
import logging
import configparser
from peekaboo.exceptions import PeekabooConfigException
from peekaboo.toolbox.cortex import tlp
        @type known_options: list(string)

        @returns: None
        @raises PeekabooConfigException: if any unknown options are found. """
        try:
            section_options = map(
                # account for option.1 list syntax
                lambda x: x.split('.')[0],
                self.options(section))
        except configparser.NoSectionError:
            # a non-existant section can have no non-allowed options :)
            return

        option_diff = set(section_options) - set(known_options)
        if option_diff:
            raise PeekabooConfigException(
                'Unknown config option(s) found in section %s: %s'
                % (section, ', '.join(option_diff)))


class PeekabooConfig(PeekabooConfigParser):
    """ This class represents the Peekaboo configuration. """
    def __init__(self, config_file=None, log_level=None):
        """ Initialise the configuration with defaults, overwrite with command
        line options and finally read the configuration file. """
        # hard defaults: The idea here is that every config option has a
        # default that would in principle enable Peekaboo to run. Code using
        # the option should still cope with no or an empty value being handed
        # to it.
        self.user = 'peekaboo'

# Path: peekaboo/exceptions.py
# class PeekabooConfigException(PeekabooException):
#     pass
# 
# Path: peekaboo/toolbox/cortex.py
# class tlp(enum.Enum):
#     WHITE = 0
#     GREEN = 1
#     AMBER = 2
#     RED = 3


# Path: peekaboo/config.py
import re
import sys
import logging
import configparser
from peekaboo.exceptions import PeekabooConfigException
from peekaboo.toolbox.cortex import tlp

        @type known_options: list(string)

        @returns: None
        @raises PeekabooConfigException: if any unknown options are found. """
        try:
            section_options = map(
                # account for option.1 list syntax
                lambda x: x.split('.')[0],
                self.options(section))
        except configparser.NoSectionError:
            # a non-existant section can have no non-allowed options :)
            return

        option_diff = set(section_options) - set(known_options)
        if option_diff:
            raise PeekabooConfigException(
                'Unknown config option(s) found in section %s: %s'
                % (section, ', '.join(option_diff)))


class PeekabooConfig(PeekabooConfigParser):
    """ This class represents the Peekaboo configuration. """
    def __init__(self, config_file=None, log_level=None):
        """ Initialise the configuration with defaults, overwrite with command
        line options and finally read the configuration file. """
        # hard defaults: The idea here is that every config option has a
        # default that would in principle enable Peekaboo to run. Code using
        # the option should still cope with no or an empty value being handed
        # to it.
        self.user = 'peekaboo'

        self.group = None