]> Frank Brehm's Git Trees - pixelpark/puppetmaster-webhooks.git/commitdiff
Adding method __copy__() to class BaseModuleInfo
authorFrank Brehm <frank.brehm@pixelpark.com>
Tue, 26 Feb 2019 15:42:31 +0000 (16:42 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Tue, 26 Feb 2019 15:42:31 +0000 (16:42 +0100)
lib/webhooks/base_module_info.py

index 462493ed0541d5eb42920c377b25b5780c868a2f..d4d93a5196b7ffca567b82b7661d027e2afb87ce 100644 (file)
@@ -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__":