Commits

Anonymous committed 58d2875

add property _isPrinting

Comments (0)

Files changed (1)

python/Configurable.py

       '_name',                # the (unqualified) component name
       '_inSetDefaults',       # currently setting default values
       '_isLocked',            # track configurable to be locking
+      '_isPrinting',          # inside __str__ to avoid setting of private AlgTools
       '_initok',              # used to enforce base class init
       '_setupok'              # for debugging purposes (temporary)
    )
     # set to True when locked, False otherwise
       self._isLocked = False
 
+    # set to True when inside __str__ (volatile - not stored on file)
+      self._isPrinting = False
+
     # for later, in case __init__ itself is overridden
       self._initok = True
 
       self._initok = True
       self._inSetDefaults = False
       self._isLocked = False
+      self._isPrinting = False
       for (n, v) in dct.items():
          setattr( self, n, v )
 
          else:
             return title
 
+    # avoid auto-setting private AlgTools while doing printout
+      self._isPrinting = True
+
     # print line to easily see start-of-configurable
       if indent > 0:
          headerIndent = (indent-1)*Configurable.indentUnit + headerLastIndentUnit
 
     # print line to easily see end-of-configurable. Note: No linesep!
       rep += Configurable._printFooter( indentStr, title )
+
+      self._isPrinting = False
       return rep