Callback to create tempdir in cache
This commit is contained in:
parent
85bc8b61df
commit
6760e38d93
@ -25,7 +25,8 @@ from .config import (
|
|||||||
)
|
)
|
||||||
from .config_data import MINIMUM_FONT_SIZE
|
from .config_data import MINIMUM_FONT_SIZE
|
||||||
from .constants import (
|
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 (
|
from .fast_data_types import (
|
||||||
CLOSE_BEING_CONFIRMED, IMPERATIVE_CLOSE_REQUESTED, NO_CLOSE_REQUESTED,
|
CLOSE_BEING_CONFIRMED, IMPERATIVE_CLOSE_REQUESTED, NO_CLOSE_REQUESTED,
|
||||||
@ -1379,6 +1380,10 @@ class Boss:
|
|||||||
with suppress(FileNotFoundError):
|
with suppress(FileNotFoundError):
|
||||||
os.remove(path)
|
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:
|
def set_update_check_process(self, process: Optional[PopenType] = None) -> None:
|
||||||
if self.update_check_process is not None:
|
if self.update_check_process is not None:
|
||||||
with suppress(Exception):
|
with suppress(Exception):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user