fileset.py 文件源码

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

项目:pygrunt 作者: elementbound 项目源码 文件源码
def add(self, *args):
        added = 0

        for pattern in args:
            try:
                files = self._glob(pattern)
                files = self._process_str_paths(files)
            except NotImplementedError:
                # self._glob says "Non-relative patterns are unsupported"
                # Check if it exists and add it
                files = Path(pattern)
                if files.exists():
                    files = [files]
                else:
                    files = None

            if not files:
                # TODO: Proper handling of this?
                print('Include pattern did not match:', pattern)
            else:
                for file in files:
                    if file not in self._data:
                        self._data.append(file)
                        added += 1

        return added
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号