configuration.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:ceph-medic 作者: ceph 项目源码 文件源码
def _compile_patterns(self):
        """
        Compiles the regexes based on the original implementation of the parser (``InventoryParser``)
        and sets the to ``self.patterns``
        """
        self.patterns['section'] = re.compile(
            r'''^\[
                    ([^:\]\s]+)             # group name
                    (?::(\w+))?             # optional tag name :
                \]
                \s*                         # ignore trailing whitespace
                (?:\#.*)?                   # and/or a comment till the
                $                           # end of the line
            ''', re.X
        )

        self.patterns['groupname'] = re.compile(
            r'''^
                ([^:\]\s]+)
                \s*                         # ignore trailing whitespace
                (?:\#.*)?                   # and/or a comment till the
                $                           # end of the line
            ''', re.X
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号