formic.py 文件源码

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

项目:formic 作者: scottbelden 项目源码 文件源码
def _preprocess(argument):
        """Receives the argument (from the constructor), and normalizes it
        into a list of Pattern objects."""
        pattern_set = PatternSet()
        if argument is not None:
            if isinstance(argument, basestring):
                argument = [argument]

            for glob in argument:
                if isinstance(glob, basestring):
                    patterns = Pattern.create(glob)
                    pattern_set.extend(patterns)

                elif isinstance(glob, Pattern):
                    pattern_set.append(glob)

        return pattern_set
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号