def __init__(self, max_workers=None, cap_time=None):
if max_workers is None:
max_workers = Downloader.MAX_WORKERS
if cap_time is None:
cap_time = Downloader.CAP_TIME
super(Downloader, self).__init__()
self.is_paused = False
self.cap_time = cap_time
self.executor = ThreadPoolExecutor(max_workers=max_workers)
self._futures = []
Clock.schedule_interval(self._check_executor, 1 / 60.)
if not exists(CACHE_DIR):
makedirs(CACHE_DIR)
评论列表
文章目录