INNER CODE UNIT · Python

is_switchport

mpenning/ciscoconfparse · ciscoconfparse/ccp_abc.py:210

    def is_switchport(self, value):
        raise NotImplementedError()

    # On BaseCfgLine()
    @logger.catch(reraise=True)
    def set_comment_bool(self):
        """Set the .is_comment attribute for this object."""
        delimiters = set(self.comment_delimiter)
        ## Use this instead of a regex... nontrivial speed enhancement
        tmp = self.text.lstrip()
        for delimit_char in delimiters:
            if len(tmp) > 0 and (delimit_char == tmp[len(delimit_char) - 1]):
                self.is_comment = True
                break
            else:
                self.is_comment = False
        return self.is_comment

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…