From: Frank Brehm Date: Thu, 14 Mar 2019 17:18:49 +0000 (+0100) Subject: Applying flake8 rules to some files X-Git-Tag: 1.6.4^2~26 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=d05346b4d68c1a87793a3c37be59be369a9f428d;p=pixelpark%2Fpuppetmaster-webhooks.git Applying flake8 rules to some files --- diff --git a/lib/webhooks/base_module_info.py b/lib/webhooks/base_module_info.py index d4d93a5..2689dab 100644 --- a/lib/webhooks/base_module_info.py +++ b/lib/webhooks/base_module_info.py @@ -11,22 +11,16 @@ from __future__ import absolute_import # Standard modules import logging import re -import copy -import warnings -import time -import datetime # Third party modules -import requests -import pytz # Own modules -from fb_tools.common import pp, to_str, to_bool, is_sequence +from fb_tools.common import to_str from fb_tools.obj import FbBaseObjectError, FbBaseObject from .xlate import XLATOR -__version__ = '0.2.1' +__version__ = '0.2.2' LOG = logging.getLogger(__name__) @@ -76,7 +70,7 @@ class BaseModuleInfo(FbBaseObject): match = self.re_split_name.match(_full_name) if not match: - raise ModuleInfoError( + raise BaseModuleInfoError( _("Could not analyze given full module name {!r}.").format( full_name)) @@ -210,6 +204,7 @@ class BaseModuleInfo(FbBaseObject): module_info.initialized = self.initialized return module_info + # ============================================================================= if __name__ == "__main__": diff --git a/lib/webhooks/get_forge_modules.py b/lib/webhooks/get_forge_modules.py index ed0459e..862f30d 100644 --- a/lib/webhooks/get_forge_modules.py +++ b/lib/webhooks/get_forge_modules.py @@ -44,8 +44,6 @@ from .module_list import ModuleInfoDict from .module_meta_info import ModuleMetadata -from .puppetfile import Puppetfile, PuppetfileError - from .forge.mod_info import ForgeModuleInfo from .forge.mod_dict import ForgeModuleDict @@ -202,10 +200,6 @@ class GetForgeModulesApp(BaseHookApp): if self.do_forge: self.get_forge_information() - #if self.verbose > 2: - # LOG.debug("Found modules:\n{}".format(pp(self.modules.as_list()))) - - #self.write_cache_file() self.forge_modules.write_file() print() diff --git a/lib/webhooks/module_info.py b/lib/webhooks/module_info.py index 66d8173..e15f95e 100644 --- a/lib/webhooks/module_info.py +++ b/lib/webhooks/module_info.py @@ -22,13 +22,12 @@ import pytz # Own modules from fb_tools.common import pp, to_str, to_bool, is_sequence -from fb_tools.obj import FbBaseObjectError, FbBaseObject from .xlate import XLATOR from .base_module_info import BaseModuleInfoError, BaseModuleInfo -__version__ = '1.4.1' +__version__ = '1.4.2' LOG = logging.getLogger(__name__) diff --git a/lib/webhooks/module_meta_info.py b/lib/webhooks/module_meta_info.py index 2852477..654f452 100644 --- a/lib/webhooks/module_meta_info.py +++ b/lib/webhooks/module_meta_info.py @@ -13,21 +13,17 @@ from __future__ import absolute_import import logging import re import copy -import warnings -import time -import datetime -import copy import json # Third party modules # Own modules -from fb_tools.common import pp, to_str, to_bool, is_sequence +from fb_tools.common import pp, to_str, is_sequence from fb_tools.obj import FbBaseObjectError, FbBaseObject from .xlate import XLATOR -__version__ = '0.5.3' +__version__ = '0.5.4' LOG = logging.getLogger(__name__) @@ -83,7 +79,7 @@ class ModuleDependency(object): # ------------------------------------------------------------------------- def __copy__(self): - new = cls(name=self.name, requirement=self.requirement) + new = self.__class__(name=self.name, requirement=self.requirement) return new @@ -136,7 +132,7 @@ class ModuleOsSupport(object): # ------------------------------------------------------------------------- def __copy__(self): - new = cls(name=self.name, releases=copy.copy(self.releases)) + new = self.__class__(name=self.name, releases=copy.copy(self.releases)) return new