mirror of
https://github.com/aclist/dztui.git
synced 2026-10-26 12:42:34 +01:00
change: abstract lock file path
This commit is contained in:
1 parent
199cd07982
commit
c73b07991f
2 files changed
+4
-2
No files matched your search
@@ -96,6 +96,7 @@ LOG_FILTERS = ("CRITICAL", "WARNING", "INFO", "DEBUG")
|
||||
TMP_PATH = "/tmp"
|
||||
TMP_TARBALL = "/tmp/dzgui.tar.gz"
|
||||
TMP_EXE = "/tmp/dzgui/dzgui"
|
||||
LOCK_FILE = "/tmp/dzgui.flock"
|
||||
|
||||
DAYZ_COMMUNITY_ROOT = "Missions"
|
||||
|
||||
|
||||
+3
-2
@@ -5,8 +5,9 @@ import sys
|
||||
from pathlib import Path
|
||||
from typing import TextIO
|
||||
|
||||
from dzgui.views.dialogs.early_alert import EarlyAlertDialog
|
||||
from dzgui.const.constants import LOCK_FILE
|
||||
from dzgui.util.strings import cannot_acquire_lock
|
||||
from dzgui.views.dialogs.early_alert import EarlyAlertDialog
|
||||
|
||||
|
||||
def lock_release(lock: TextIO) -> None:
|
||||
@@ -15,7 +16,7 @@ def lock_release(lock: TextIO) -> None:
|
||||
|
||||
|
||||
def lock_acquire() -> TextIO:
|
||||
lockfile = Path("/tmp/dzgui.flock")
|
||||
lockfile = Path(LOCK_FILE)
|
||||
lock = open(lockfile, "w")
|
||||
try:
|
||||
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
|
||||
Reference in new issue
Block a user