from __future__ import absolute_import import logging import re import sys from .config import _parse_config # init module logger logger = logging.getLogger('ARC.ConfigReference') logger.setLevel(logging.WARNING) log_handler_stderr = logging.StreamHandler() log_handler_stderr.setFormatter( logging.Formatter('[%(asctime)s] [%(name)s] [%(levelname)s] [%(process)d] [%(message)s]')) logger.addHandler(log_handler_stderr) _reference_config = {} _reference_default_lines = {} # An ordered list of blocks. With python3-only the keys of _reference_config can be used instead _reference_blocks = [] __default_config = {} __default_blocks = [] __regexes = { 'block': re.compile(r'^#\s*\[(?P[^:\[\]]+(?P:[^\[\]]+)?)\]\s*$'), 'default': re.compile(r'^##\s*default:(?P.*)\s*$'), 'skip': re.compile(r'^(?:## .*|\s*)$'), 'option': re.compile(r'^#(?P