From 647f53d9fc1e2071a2e047d35e966cf0f2db4553 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 15 Feb 2023 17:46:56 +0100 Subject: [PATCH] Make the linter happy --- lib/dpx_puppettools/forge/mod_info.py | 16 +++++++--------- lib/dpx_puppettools/pfile_moduleinfo.py | 10 +++------- lib/dpx_puppettools/puppetfile.py | 3 +-- lib/dpx_puppettools/xlate.py | 12 ++++++------ 4 files changed, 17 insertions(+), 24 deletions(-) diff --git a/lib/dpx_puppettools/forge/mod_info.py b/lib/dpx_puppettools/forge/mod_info.py index 30f4810..6aed9a5 100644 --- a/lib/dpx_puppettools/forge/mod_info.py +++ b/lib/dpx_puppettools/forge/mod_info.py @@ -14,10 +14,8 @@ import logging import copy import warnings import datetime -import collections import time import os -import inspect from pathlib import Path @@ -47,14 +45,14 @@ from ..xlate import XLATOR from ..base_moduleinfo import BaseModuleInfo -from . import parse_forge_date, ForgeModuleInfoError, BaseForgeObject +from . import parse_forge_date, ForgeModuleInfoError from .mod_release_info import ModuleReleaseInfo from .mod_release_list import ModuleReleaseList from .cur_mod_release_info import CurrentModuleReleaseInfo from .owner_info import ForgeOwnerInfo -__version__ = '0.6.2' +__version__ = '0.6.3' LOG = logging.getLogger(__name__) @@ -638,7 +636,7 @@ class ForgeModuleInfo(BaseModuleInfo): if not data_file: data_file = self.forge_cache_file if not data_file: - msg = _("Could not evaluate name of the forge cache file.").format(fn) + msg = _("Could not evaluate name of the forge cache file.").format() raise ReadForgeModuleInfoError(msg) if not data_file.exists(): @@ -725,7 +723,7 @@ class ForgeModuleInfo(BaseModuleInfo): if not data_file: data_file = self.forge_cache_file if not data_file: - msg = _("Could not evaluate name of the forge cache file.").format(fn) + msg = _("Could not evaluate name of the forge cache file.").format() raise WriteForgeModuleInfoError(msg) forge_dir = data_file.parent @@ -782,7 +780,8 @@ class ForgeModuleInfo(BaseModuleInfo): LOG.error(msg) return None - module_info = ForgeModuleInfo(appname=appname, verbose=verbose, base_dir=base_dir, full_name=full_name) + module_info = ForgeModuleInfo( + appname=appname, verbose=verbose, base_dir=base_dir, full_name=full_name) module_info.apply_data(data) return module_info @@ -791,7 +790,6 @@ class ForgeModuleInfo(BaseModuleInfo): def retrieve_forge_data(self): url = "{url}/{name}".format(url=self.forge_uri, name=self.full_name) - module_info = None self.reset_all_data() @@ -807,7 +805,7 @@ class ForgeModuleInfo(BaseModuleInfo): response = session.request('GET', url, timeout=self.http_timeout) except (ConnectionError, ReadTimeout, ConnectTimeout) as e: msg = "{c} on getting module info for {m}: {e}".format( - c=e.__class__.__name__, m=full_name, e=e) + c=e.__class__.__name__, m=self.full_name, e=e) raise RetrieveForgeDataError(msg) if w: warn_class = w[-1].category.__name__ diff --git a/lib/dpx_puppettools/pfile_moduleinfo.py b/lib/dpx_puppettools/pfile_moduleinfo.py index c03d029..c0b51bd 100644 --- a/lib/dpx_puppettools/pfile_moduleinfo.py +++ b/lib/dpx_puppettools/pfile_moduleinfo.py @@ -12,20 +12,16 @@ from __future__ import absolute_import # Standard modules import logging import re -import copy -import warnings -import time -import datetime # Own modules -from fb_tools.common import pp, to_str, to_bool, is_sequence +from fb_tools.common import pp, to_str, to_bool from .xlate import XLATOR from .errors import BaseModuleInfoError from .base_moduleinfo import BaseModuleInfo -__version__ = '0.4.0' +__version__ = '0.4.1' LOG = logging.getLogger(__name__) @@ -570,7 +566,6 @@ class PuppetfileModuleInfo(BaseModuleInfo): if 'install_path' in definitions: module_info.install_path = definitions['install_path'] - module_info.initialized = True if verbose > 3: @@ -615,6 +610,7 @@ class PuppetfileModuleInfo(BaseModuleInfo): return ret + # ============================================================================= if __name__ == "__main__": diff --git a/lib/dpx_puppettools/puppetfile.py b/lib/dpx_puppettools/puppetfile.py index a7b505b..3d36b7d 100644 --- a/lib/dpx_puppettools/puppetfile.py +++ b/lib/dpx_puppettools/puppetfile.py @@ -20,7 +20,6 @@ from pathlib import Path # Third party modules import six -from fb_tools.common import pp, to_str, to_bool, is_sequence from fb_tools.obj import FbBaseObjectError, FbBaseObject # Own modules @@ -34,7 +33,7 @@ from .module_list import ModuleInfoDict from .xlate import XLATOR -__version__ = '1.4.0' +__version__ = '1.4.1' LOG = logging.getLogger(__name__) diff --git a/lib/dpx_puppettools/xlate.py b/lib/dpx_puppettools/xlate.py index 2dbe39b..14c4db0 100644 --- a/lib/dpx_puppettools/xlate.py +++ b/lib/dpx_puppettools/xlate.py @@ -35,7 +35,7 @@ DOMAIN = 'dpx_puppettools' LOG = logging.getLogger(__name__) -__version__ = '0.2.0' +__version__ = '0.2.1' __me__ = Path(__file__).resolve() __module_dir__ = __me__.parent @@ -52,6 +52,11 @@ DEFAULT_LOCALE = babel.core.default_locale() if not DEFAULT_LOCALE: DEFAULT_LOCALE = DEFAULT_LOCALE_DEF +SUPPORTED_LANGS = ( + 'de_DE', + 'en_US' +) + __mo_file__ = gettext.find(DOMAIN, str(LOCALE_DIR)) if not __mo_file__: @@ -76,11 +81,6 @@ else: CUR_BABEL_VERSION = LooseVersion(babel.__version__) NEWER_BABEL_VERSION = LooseVersion('2.6.0') -SUPPORTED_LANGS = ( - 'de_DE', - 'en_US' -) - _ = XLATOR.gettext -- 2.39.5