mirror of
https://github.com/aclist/dztui.git
synced 2026-10-26 12:42:34 +01:00
Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
728b8b8242 | ||
|
|
3b51392d39 | ||
|
|
159e2da355 | ||
|
|
b83a333cea | ||
|
|
46117ecdda | ||
|
|
30119fec46 | ||
|
|
ac01818549 | ||
|
|
d486712a4c | ||
|
|
d116702145 | ||
|
|
5bee3614bd | ||
|
|
c73b07991f | ||
|
|
199cd07982 | ||
|
|
e3d62c6749 | ||
|
|
5134bf02fb |
No files matched your search
@@ -96,6 +96,7 @@ LOG_FILTERS = ("CRITICAL", "WARNING", "INFO", "DEBUG")
|
|||||||
TMP_PATH = "/tmp"
|
TMP_PATH = "/tmp"
|
||||||
TMP_TARBALL = "/tmp/dzgui.tar.gz"
|
TMP_TARBALL = "/tmp/dzgui.tar.gz"
|
||||||
TMP_EXE = "/tmp/dzgui/dzgui"
|
TMP_EXE = "/tmp/dzgui/dzgui"
|
||||||
|
LOCK_FILE = "/tmp/dzgui.flock"
|
||||||
|
|
||||||
DAYZ_COMMUNITY_ROOT = "Missions"
|
DAYZ_COMMUNITY_ROOT = "Missions"
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -5,8 +5,9 @@ import sys
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TextIO
|
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.util.strings import cannot_acquire_lock
|
||||||
|
from dzgui.views.dialogs.early_alert import EarlyAlertDialog
|
||||||
|
|
||||||
|
|
||||||
def lock_release(lock: TextIO) -> None:
|
def lock_release(lock: TextIO) -> None:
|
||||||
@@ -15,7 +16,7 @@ def lock_release(lock: TextIO) -> None:
|
|||||||
|
|
||||||
|
|
||||||
def lock_acquire() -> TextIO:
|
def lock_acquire() -> TextIO:
|
||||||
lockfile = Path("/tmp/dzgui.flock")
|
lockfile = Path(LOCK_FILE)
|
||||||
lock = open(lockfile, "w")
|
lock = open(lockfile, "w")
|
||||||
try:
|
try:
|
||||||
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import logging
|
import logging
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from dzgui.const.constants import APP_NAME, FLATPAK_APPID, GTK_APP_ID
|
from dzgui.const.constants import APP_NAME, FLATPAK_APPID, GTK_APP_ID, TMP_PATH
|
||||||
|
|
||||||
logger = logging.getLogger(APP_NAME)
|
logger = logging.getLogger(APP_NAME)
|
||||||
|
|
||||||
@@ -18,7 +18,11 @@ def apply_overrides(xdg: dict[str, str]) -> None:
|
|||||||
]
|
]
|
||||||
subprocess.run([*args], capture_output=True)
|
subprocess.run([*args], capture_output=True)
|
||||||
|
|
||||||
for path in xdg.values():
|
paths: list[str] = []
|
||||||
|
paths.extend([*xdg.values()])
|
||||||
|
paths.append(TMP_PATH)
|
||||||
|
|
||||||
|
for path in paths:
|
||||||
args = [
|
args = [
|
||||||
"flatpak",
|
"flatpak",
|
||||||
"--user",
|
"--user",
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ from dzgui.const.constants import (
|
|||||||
HERO_PATH,
|
HERO_PATH,
|
||||||
FLATPAK_ROOT_PATH,
|
FLATPAK_ROOT_PATH,
|
||||||
LEGACY_CONFIG_PATH,
|
LEGACY_CONFIG_PATH,
|
||||||
|
TMP_PATH
|
||||||
)
|
)
|
||||||
from dzgui.const.boilerplate import config_boilerplate
|
from dzgui.const.boilerplate import config_boilerplate
|
||||||
from dzgui.const.endpoints import STEAM_API_SETUP
|
from dzgui.const.endpoints import STEAM_API_SETUP
|
||||||
@@ -432,6 +433,8 @@ class FlatpakOverridePage(EnumeratedWizardPage):
|
|||||||
store = Gtk.ListStore(str)
|
store = Gtk.ListStore(str)
|
||||||
for path in xdg_paths.values():
|
for path in xdg_paths.values():
|
||||||
store.append((str(path),))
|
store.append((str(path),))
|
||||||
|
store.append((TMP_PATH,))
|
||||||
|
|
||||||
tree = SimpleTree(store, wizard.tree_column)
|
tree = SimpleTree(store, wizard.tree_column)
|
||||||
tree.set_halign(Gtk.Align.CENTER)
|
tree.set_halign(Gtk.Align.CENTER)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ description = "DayZ server browser and mod manager for Linux"
|
|||||||
authors = [
|
authors = [
|
||||||
{name = "aclist"}
|
{name = "aclist"}
|
||||||
]
|
]
|
||||||
version = "7.0.0b28"
|
version = "7.0.0b29"
|
||||||
license = "GPL-3.0-or-later"
|
license = "GPL-3.0-or-later"
|
||||||
license-files = ["LICENSE"]
|
license-files = ["LICENSE"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ def keys():
|
|||||||
|
|
||||||
# TODO: use a static fixture instead of system config
|
# TODO: use a static fixture instead of system config
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
@pytest.mark.realconfig
|
|
||||||
def config():
|
def config():
|
||||||
paths = get_xdg_paths()
|
paths = get_xdg_paths()
|
||||||
xdg = parse_filepaths(paths)
|
xdg = parse_filepaths(paths)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import configparser
|
import configparser
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from dzgui.const.constants import FLATPAK_APPID, GTK_APP_ID
|
from dzgui.const.constants import FLATPAK_APPID, GTK_APP_ID, TMP_PATH
|
||||||
from dzgui.config.xdg import get_xdg_paths
|
from dzgui.config.xdg import get_xdg_paths
|
||||||
from dzgui.util.flatpak import apply_overrides
|
from dzgui.util.flatpak import apply_overrides
|
||||||
|
|
||||||
@@ -38,6 +38,8 @@ def test_session_bus(override, config) -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_paths(override, xdg_paths, config) -> None:
|
def test_paths(override, xdg_paths, config) -> None:
|
||||||
expect = xdg_paths
|
expect: list[str] = []
|
||||||
|
expect.append(TMP_PATH)
|
||||||
|
expect.extend([*xdg_paths.values()])
|
||||||
paths = config[PATHS_KEY][PATHS_SUBKEY].split(";")
|
paths = config[PATHS_KEY][PATHS_SUBKEY].split(";")
|
||||||
assert all(str(path) in paths for path in expect.values())
|
assert all(str(path) in paths for path in expect)
|
||||||
Reference in new issue
Block a user