INNER CODE UNIT · Python

text

mpenning/ciscoconfparse · ciscoconfparse/ccp_abc.py:390

    def text(self):
        """Get the self.text attribute"""
        return self._text

    # On BaseCfgLine()
    @text.setter
    @logger.catch(reraise=True)
    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...
        #

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…