INNER CODE UNIT · Python

text

mpenning/ciscoconfparse · ciscoconfparse/ccp_abc.py:397

    def text(self, newtext=None):
        """Set self.text, self.indent, self.line_id (and all comments' self.parent)"""
        # FIXME - children do not associate correctly if this is used as-is...
        if not isinstance(newtext, str):
            error = f"text=`{newtext}` is an invalid config line"
            logger.critical(error)
            raise InvalidParameters(error)

        # escape braces since single braces could be misunderstood as
        # f-string or string.format() delimiters...
        #
        # Sometimes brace escaping is not required... we need better fencing
        # around safe_escape_curly_braces()
        if False:
            newtext = self.safe_escape_curly_braces(newtext)

        # Calculate the newtext indent here...
        newtext_ = newtext.rstrip()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…