catch control-c action.
This commit is contained in:
@ -6,6 +6,7 @@ import validators
|
||||
|
||||
from mdrsclient.exceptions import IllegalArgumentException
|
||||
from mdrsclient.settings import CONFIG_DIRNAME
|
||||
from mdrsclient.utils import FileLock
|
||||
|
||||
|
||||
class ConfigFile:
|
||||
@ -70,7 +71,9 @@ class ConfigFile:
|
||||
def __save(self) -> None:
|
||||
self.__ensure_cache_dir()
|
||||
with open(self.__config_path, "w") as f:
|
||||
FileLock.lock(f)
|
||||
self.__config.write(f)
|
||||
FileLock.unlock(f)
|
||||
os.chmod(self.__config_path, 0o600)
|
||||
|
||||
def __ensure_cache_dir(self) -> None:
|
||||
|
Reference in New Issue
Block a user