From ee81d0eaf5833e2c4a8c58ee1c738859ffdbd530 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 26 Feb 2019 16:42:31 +0100 Subject: [PATCH] Adding method __copy__() to class BaseModuleInfo --- lib/webhooks/base_module_info.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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__": -- 2.39.5