From: Frank Brehm Date: Tue, 13 Jun 2023 12:35:28 +0000 (+0200) Subject: Make the linter happy with lib/pp_admintools/config/__init__.py X-Git-Tag: 0.10.0^2~19 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=c6f111705e5ac0ec293728552c3b188989fd7033;p=pixelpark%2Fpp-admin-tools.git Make the linter happy with lib/pp_admintools/config/__init__.py --- diff --git a/lib/pp_admintools/config/__init__.py b/lib/pp_admintools/config/__init__.py index 28514ba..2deb3b3 100644 --- a/lib/pp_admintools/config/__init__.py +++ b/lib/pp_admintools/config/__init__.py @@ -1,36 +1,34 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- """ +@summary: A module for providing a configuration for different things in this module. + @author: Frank Brehm @contact: frank.brehm@pixelpark.com @copyright: © 2023 by Frank Brehm, Berlin -@summary: A module for providing a configuration for different things in this module. """ from __future__ import absolute_import # Standard module +import copy import logging -import pwd -import socket import os -import copy +import pwd import re +import socket # Third party modules - -from fb_tools.multi_config import MultiConfigError, BaseMultiConfig -from fb_tools.multi_config import DEFAULT_ENCODING - from fb_tools import MailAddress +from fb_tools.multi_config import BaseMultiConfig +from fb_tools.multi_config import DEFAULT_ENCODING +from fb_tools.multi_config import MultiConfigError # Own modules - from ..errors import PpError - from ..xlate import XLATOR CONFIG_DIR = 'pixelpark' -__version__ = '0.2.2' +__version__ = '0.2.3' LOG = logging.getLogger(__name__) VALID_MAIL_METHODS = ('smtp', 'sendmail') DEFAULT_DOMAIN = 'pixelpark.com' @@ -42,8 +40,7 @@ _ = XLATOR.gettext # ============================================================================= class PpConfigurationError(PpError, MultiConfigError): - """Base error class for all exceptions happened during - evaluation of configuration.""" + """Base error class for all exceptions happened during evaluation of configuration.""" pass @@ -92,7 +89,7 @@ class PpBaseConfiguration(BaseMultiConfig): append_appname_to_stems=True, config_dir=CONFIG_DIR, additional_stems=None, additional_cfgdirs=None, encoding=DEFAULT_ENCODING, additional_config_file=None, ensure_privacy=False, use_chardet=True, raise_on_error=True, initialized=False): - + """Initialize the PpBaseConfiguration object.""" self.mail_recipients = copy.copy(self.default_mail_recipients) self.mail_from = self.default_mail_from_complete self.mail_cc = copy.copy(self.default_mail_cc) @@ -115,7 +112,7 @@ class PpBaseConfiguration(BaseMultiConfig): # ------------------------------------------------------------------------- def as_dict(self, short=True): """ - Transforms the elements of the object into a dict + Transform the elements of the object into a dict. @param short: don't include local properties in resulting dict. @type short: bool @@ -123,7 +120,6 @@ class PpBaseConfiguration(BaseMultiConfig): @return: structure as dict @rtype: dict """ - res = super(PpBaseConfiguration, self).as_dict(short=short) res['default_mail_recipients'] = self.default_mail_recipients @@ -144,7 +140,7 @@ class PpBaseConfiguration(BaseMultiConfig): # ============================================================================= -if __name__ == "__main__": +if __name__ == '__main__': pass