index.py 文件源码

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

项目:krpcScripts 作者: jwvanderbeck 项目源码 文件源码
def _get_pages(self, locations, req):
        """Yields (page, page_url) from the given locations, skipping
        locations that have errors, and adding download/homepage links"""
        pending_queue = Queue()
        for location in locations:
            pending_queue.put(location)
        done = []
        seen = set()
        threads = []
        for i in range(min(10, len(locations))):
            t = threading.Thread(target=self._get_queued_page, args=(req, pending_queue, done, seen))
            t.setDaemon(True)
            threads.append(t)
            t.start()
        for t in threads:
            t.join()
        return done
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号