]> Frank Brehm's Git Trees - pixelpark/puppetmaster-webhooks.git/commitdiff
Applying flake8 rules to some files
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 14 Mar 2019 17:18:49 +0000 (18:18 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 14 Mar 2019 17:18:49 +0000 (18:18 +0100)
lib/webhooks/base_module_info.py
lib/webhooks/get_forge_modules.py
lib/webhooks/module_info.py
lib/webhooks/module_meta_info.py

index d4d93a5196b7ffca567b82b7661d027e2afb87ce..2689dab2a2cb7b0cf0cf2126d2e0a4078ef164fc 100644 (file)
@@ -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__":
 
index ed0459e99d0129854ab6e31763b96f4a02ea9a6c..862f30d5a6e589399416252e0567df4f4ec15dad 100644 (file)
@@ -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()
index 66d8173f5b24c57d31d9388a615ca130b228a195..e15f95e44ab4985e66a872d443a77ae378cb9a89 100644 (file)
@@ -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__)
 
index 28524770fd3834ea9f95c0f8b131a2c3091b251e..654f4527fcf462d4c114b72182697f0b0e8703ac 100644 (file)
@@ -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