INNER CODE UNIT · Python
_get_image_loading_executor
yurijmikhalevich/rclip · rclip/main.py:108
def _get_image_loading_executor(self) -> ThreadPoolExecutor:
if self._image_loading_executor is None:
self._image_loading_executor = ThreadPoolExecutor(max_workers=self._image_loading_workers)
return self._image_loading_executor
def _is_excluded(self, filepath: str, directory: str) -> bool:
relative_path = os.path.relpath(filepath, directory)
if self._skip_hidden and any(part.startswith(".") for part in relative_path.split(os.path.sep)):
return True
return self._exclude_dir_regex.match(os.path.join(".", os.path.dirname(relative_path))) is not None
def _shutdown_image_loading_executor(self) -> None:
if self._image_loading_executor is None:
return
self._image_loading_executor.shutdown(wait=True)
self._image_loading_executor = None
def close(self) -> None: