pathspec.py 文件源码

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

项目:bob 作者: BobBuildTool 项目源码 文件源码
def __iter__(self):
        stack = [ (self.__graphRoot, chain(self.__pkgRoot.getDirectDepSteps(),
                                           self.__pkgRoot.getIndirectDepSteps())) ]
        yield (self.__graphRoot, self.__pkgRoot)
        done = set([self.__graphRoot.key()])

        while stack:
            try:
                childPkg = next(stack[-1][1]).getPackage()
                childNode = stack[-1][0][childPkg.getName()].node
                if childNode.key() not in done:
                    done.add(childNode.key())
                    yield (childNode, childPkg)
                    stack.append( (childNode, chain(childPkg.getDirectDepSteps(),
                                                    childPkg.getIndirectDepSteps())) )
            except StopIteration:
                stack.pop()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号