Callback to create tempdir in cache

This commit is contained in:
Kovid Goyal 2020-12-29 10:00:34 +05:30
parent 85bc8b61df
commit 6760e38d93
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -25,7 +25,8 @@ from .config import (
)
from .config_data import MINIMUM_FONT_SIZE
from .constants import (
appname, config_dir, is_macos, kitty_exe, supports_primary_selection
appname, cache_dir, config_dir, is_macos, kitty_exe,
supports_primary_selection
)
from .fast_data_types import (
CLOSE_BEING_CONFIRMED, IMPERATIVE_CLOSE_REQUESTED, NO_CLOSE_REQUESTED,
@ -1379,6 +1380,10 @@ class Boss:
with suppress(FileNotFoundError):
os.remove(path)
def create_temp_dir_in_cache(self, prefix: Optional[str] = None, suffix: Optional[str] = None) -> str:
from tempfile import mkdtemp
return mkdtemp(prefix=prefix, suffix=suffix, dir=cache_dir())
def set_update_check_process(self, process: Optional[PopenType] = None) -> None:
if self.update_check_process is not None:
with suppress(Exception):