from __future__ import absolute_import
# Standard module
+# import copy
import logging
import re
-# import copy
-
from collections.abc import Mapping
# Third party modules
from fb_tools.multi_config import DEFAULT_ENCODING
# Own modules
+from .ldap import LdapConfigError, LdapConfiguration
from .. import DEFAULT_CONFIG_DIR
from .. import pp
-
-from .ldap import LdapConfigError, LdapConfiguration
-
from ..xlate import XLATOR
-__version__ = '0.2.1'
+__version__ = '0.2.2'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
append_appname_to_stems=True, additional_stems=None, config_dir=DEFAULT_CONFIG_DIR,
additional_config_file=None, additional_cfgdirs=None, encoding=DEFAULT_ENCODING,
ensure_privacy=False, use_chardet=True, initialized=False):
-
+ """Initialize the MirrorLdapConfiguration object."""
self.entries_keep = {}
self.transform = {}
# -------------------------------------------------------------------------
def eval_section(self, section_name):
-
+ """Evaluate a particular configuration section."""
sn = section_name.lower()
if self.verbose > 1:
- LOG.debug(_("Evaluating configuration section {sn!r} ...").format(sn=sn))
+ LOG.debug(_('Evaluating configuration section {sn!r} ...').format(sn=sn))
super(MirrorLdapConfiguration, self).eval_section(section_name)
section = self.cfg[section_name]
if self.verbose > 4:
- LOG.debug("Section:\n" + pp(section))
+ LOG.debug('Section:\n' + pp(section))
if not isinstance(section, Mapping):
- LOG.warning(_("Section {sn!r} is not a {what}.").format(
+ LOG.warning(_('Section {sn!r} is not a {what}.').format(
sn=section_name, what='Mapping (dict)'))
return
sn = str(section_name) + '/' + str(sub_section_name)
if self.verbose > 2:
- LOG.debug(_("Evaluating configuration section {sn!r} ...").format(sn=sn))
+ LOG.debug(_('Evaluating configuration section {sn!r} ...').format(sn=sn))
if self.verbose > 2:
- LOG.debug("Section:\n" + pp(sub_section))
+ LOG.debug('Section:\n' + pp(sub_section))
if not isinstance(sub_section, Mapping):
- LOG.warning(_("Section {sn!r} is not a {what}.").format(
+ LOG.warning(_('Section {sn!r} is not a {what}.').format(
sn=sn, what='Mapping (dict)'))
return
# =============================================================================
-if __name__ == "__main__":
+if __name__ == '__main__':
pass