From: Frank Brehm Date: Tue, 26 Feb 2019 15:42:31 +0000 (+0100) Subject: Adding method __copy__() to class BaseModuleInfo X-Git-Tag: 1.6.4^2~45 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=ee81d0eaf5833e2c4a8c58ee1c738859ffdbd530;p=pixelpark%2Fpuppetmaster-webhooks.git Adding method __copy__() to class BaseModuleInfo --- diff --git a/lib/webhooks/base_module_info.py b/lib/webhooks/base_module_info.py index 462493e..d4d93a5 100644 --- a/lib/webhooks/base_module_info.py +++ b/lib/webhooks/base_module_info.py @@ -26,7 +26,7 @@ from fb_tools.obj import FbBaseObjectError, FbBaseObject from .xlate import XLATOR -__version__ = '0.1.1' +__version__ = '0.2.1' LOG = logging.getLogger(__name__) @@ -197,6 +197,18 @@ class BaseModuleInfo(FbBaseObject): return res + # ------------------------------------------------------------------------- + def __copy__(self): + + module_info = BaseModuleInfo( + name=self.name, vendor=self.vendor, + appname=self.appname, verbose=self.verbose, base_dir=self.base_dir) + + if self.full_name_orig: + module_info.full_name_orig = self.full_name_orig + + module_info.initialized = self.initialized + return module_info # ============================================================================= if __name__ == "__main__":