]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Make the linter happy with lib/pp_admintools/config/mirror_ldap.py
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 14 Jun 2023 07:54:48 +0000 (09:54 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 14 Jun 2023 07:54:48 +0000 (09:54 +0200)
lib/pp_admintools/config/mirror_ldap.py

index 8ff5c6e617067846c9529652744ec88f16256df3..539b075afbaa36d9240a0d08dfaa52542f38dc90 100644 (file)
 from __future__ import absolute_import
 
 # Standard module
+# import copy
 import logging
 import re
-# import copy
-
 from collections.abc import Mapping
 
 # Third party modules
@@ -21,14 +20,12 @@ from fb_tools.common import is_sequence
 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
@@ -57,7 +54,7 @@ class MirrorLdapConfiguration(LdapConfiguration):
             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 = {}
 
@@ -84,11 +81,11 @@ class MirrorLdapConfiguration(LdapConfiguration):
 
     # -------------------------------------------------------------------------
     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)
 
@@ -101,10 +98,10 @@ class MirrorLdapConfiguration(LdapConfiguration):
 
         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
 
@@ -124,13 +121,13 @@ class MirrorLdapConfiguration(LdapConfiguration):
         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
 
@@ -149,7 +146,7 @@ class MirrorLdapConfiguration(LdapConfiguration):
 
 
 # =============================================================================
-if __name__ == "__main__":
+if __name__ == '__main__':
 
     pass