]> Frank Brehm's Git Trees - pixelpark/puppet-tools.git/commitdiff
Fixing method __repr__() of class BaseModuleInfo
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 8 Feb 2023 10:05:05 +0000 (11:05 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 8 Feb 2023 10:05:05 +0000 (11:05 +0100)
lib/dpx_puppettools/base_moduleinfo.py

index b8acbca850ece19e3357aa6e0cccc3e200e7475a..88f9180e33658dc74db0fcce363d75f6b2adfb54 100644 (file)
@@ -20,7 +20,7 @@ from fb_tools.obj import FbBaseObjectError, FbBaseObject
 from .errors import PuppetToolsError, ModuleInitError
 from .xlate import XLATOR
 
-__version__ = '0.1.0'
+__version__ = '0.1.1'
 
 LOG = logging.getLogger(__name__)
 
@@ -135,7 +135,22 @@ class BaseModuleInfo(FbBaseObject):
 
     # -------------------------------------------------------------------------
     def __repr__(self):
-        return str(self)
+        """Typecasting into a string for reproduction."""
+        out = "<%s(" % (self.__class__.__name__)
+
+        fields = []
+        fields.append("appname={!r}".format(self.appname))
+        fields.append("verbose={!r}".format(self.verbose))
+        fields.append("version={!r}".format(self.version))
+        fields.append("base_dir={!r}".format(self.base_dir))
+        if self.full_name_orig:
+            fields.append("full_name={!r}".format(self.full_name_orig))
+        else:
+            fields.append("full_name={!r}".format(self.full_name))
+        fields.append("initialized={!r}".format(self.initialized))
+
+        out += ", ".join(fields) + ")>"
+        return out
 
     # -------------------------------------------------------------------------
     def __eq__(self, other):