Compare commits

...
Author SHA1 Message Date
aclist 96d50ffafa chore: resolve pytest errors 2026-10-18 07:44:31 +09:00
aclist 6c801ffec5 chore: update tests 2026-10-18 07:44:14 +09:00
aclist 5eb70a1eb8 fix: support changes to VDF format 2026-10-18 07:35:17 +09:00
aclist 7dd14804aa Merge pull request #491 from aclist/fix/dword-parse
Mirror to Codeberg / mirror-to-codeberg (push) Canceled after 0s
fix: dword parse
2026-10-16 00:09:26 +09:00
aclist 1cc1ba2864 chore: bump version 2026-10-16 00:06:54 +09:00
aclist 8c4d0aecdc fix: parse alternate VS_FIXEDFILEINFO structure 2026-10-16 00:06:37 +09:00
aclist 616f18452a Merge pull request #489 from aclist/fix/badlands
Mirror to Codeberg / mirror-to-codeberg (push) Canceled after 0s
fix: badlands
2026-10-15 19:26:43 +09:00
aclist 1064f7a9d6 chore: clear typehinting errors 2026-10-15 19:23:42 +09:00
aclist b0e85f0e35 fix: update Badlands flag 2026-10-15 19:22:44 +09:00
aclist 4d02604bcf Merge pull request #485 from aclist/fix/gint-warning
Mirror to Codeberg / mirror-to-codeberg (push) Canceled after 0s
fix: use more stable GObject signal
2026-10-15 00:32:28 +09:00
aclist ebffbe39f2 fix: use more stable GObject signal 2026-10-15 00:23:11 +09:00
aclist 61860f6aee Merge pull request #482 from aclist/fix/duplicate-warnings
Fix/duplicate warnings
2026-10-14 23:12:18 +09:00
12 changed files with 48 additions and 32 deletions

No files matched your search

+20 -8
View File
@@ -255,16 +255,28 @@ class PeFileError(Exception):
pass pass
def parse_version_number(data: BinaryIO) -> FileVersion: def parse_version_number(data: BinaryIO) -> FileVersion:
# https://learn.microsoft.com/en-us/windows/win32/api/verrsrc/ns-verrsrc-vs_fixedfileinfo # https://learn.microsoft.com/en-us/windows/win32/api/verrsrc/ns-verrsrc-vs_fixedfileinfo
minor = struct.unpack("<L", data.read(4))[0] >> 16 & 0xFFFF """
major = struct.unpack("<L", data.read(4))[0] >> 0 & 0xFFFF Note: structure differs from standard VS_FIXEDFILEINFO
build = struct.unpack("<L", data.read(4))[0] >> 0 & 0xFFFF Major: lower 16 bits of first DWORD
# NOTE: 0-pad revision number Minor: upper 16 bits of first DWORD
revision = str(struct.unpack("<L", data.read(4))[0] >> 16 & 0xFFFF) Build: lower 16 bits of third DWORD
offset = 3 - len(revision) Revision: upper 16 bits of second DWORD, zero-padded
padded = "0" * offset + revision Lower 16 bits of revision DWORD appear unused.
return FileVersion(major, minor, build, padded) """
major_minor = struct.unpack("<I", data.read(4))[0]
revision_pair = struct.unpack("<I", data.read(4))[0]
build_dword = struct.unpack("<I", data.read(4))[0]
major = major_minor & 0xFFFF
minor = (major_minor >> 16) & 0xFFFF
build = build_dword & 0xFFFF
revision = (revision_pair >> 16) & 0xFFFF
revision = f"{revision:03d}"
return FileVersion(major, minor, build, revision)
def seek_to_hex(address: str, data: BinaryIO) -> None: def seek_to_hex(address: str, data: BinaryIO) -> None:
+1 -1
View File
@@ -346,7 +346,7 @@ def get_details(record: Record) -> Details | None:
dlc = strings.dlc_none dlc = strings.dlc_none
case 2: case 2:
dlc = strings.dlc_frostline dlc = strings.dlc_frostline
case 3: case 4:
dlc = strings.dlc_badlands dlc = strings.dlc_badlands
case _: case _:
dlc = strings.unspecified dlc = strings.unspecified
+4 -4
View File
@@ -245,9 +245,9 @@ def find_user_id(path: Path) -> str | None:
last_user = str(next(iter(users))) last_user = str(next(iter(users)))
if len(users) == 1: if len(users) == 1:
return last_user return last_user
last_stamp = int(users[last_user]["Timestamp"]) last_stamp = int(users[last_user]["timestamp"])
for user in users: for user in users:
stamp = int(users[user]["Timestamp"]) stamp = int(users[user]["timestamp"])
if stamp > last_stamp: if stamp > last_stamp:
last_stamp = stamp last_stamp = stamp
last_user = user last_user = user
@@ -265,12 +265,12 @@ def find_user_id_32(path: Path) -> int:
class SteamAPIKeyError(Exception): class SteamAPIKeyError(Exception):
def __init__(self, msg=None): def __init__(self, msg: str | None = None):
super().__init__(msg or api_validation_error) super().__init__(msg or api_validation_error)
class SteamWorkshopEndpointError(Exception): class SteamWorkshopEndpointError(Exception):
def __init__(self, msg=None): def __init__(self, msg: str | None = None):
super().__init__(msg or workshop_endpoint_error) super().__init__(msg or workshop_endpoint_error)
+2 -6
View File
@@ -76,7 +76,7 @@ class SubmitField(Gtk.Box):
self.button = Gtk.Button(label=options.save_button) self.button = Gtk.Button(label=options.save_button)
self.button.connect("clicked", self._on_save_clicked) self.button.connect("clicked", self._on_save_clicked)
self.entry.connect("insert-text", self._on_text_typed) self.entry.connect("changed", self._on_text_typed)
self.entry.connect("activate", self._on_field_activated) self.entry.connect("activate", self._on_field_activated)
self.entry.get_property("buffer").connect("deleted-text", self._on_text_deleted) self.entry.get_property("buffer").connect("deleted-text", self._on_text_deleted)
@@ -113,13 +113,9 @@ class SubmitField(Gtk.Box):
def _on_text_typed( def _on_text_typed(
self, self,
entry: Gtk.Entry, entry: Gtk.Entry,
text: str,
length: int,
pos: int,
) -> None: ) -> None:
buffer = entry.get_property("buffer") text = entry.get_text()
text = buffer.get_text() + text
state = self._is_valid_text(text) state = self._is_valid_text(text)
self.button.set_sensitive(state) self.button.set_sensitive(state)
+1 -1
View File
@@ -4,7 +4,7 @@ description = "DayZ server browser and mod manager for Linux"
authors = [ authors = [
{name = "aclist"} {name = "aclist"}
] ]
version = "7.0.0b26" version = "7.0.0b28"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
license-files = ["LICENSE"] license-files = ["LICENSE"]
readme = "README.md" readme = "README.md"
+1 -1
View File
@@ -8,6 +8,6 @@
"WantsOfflineMode" "0" "WantsOfflineMode" "0"
"SkipOfflineModeWarning" "0" "SkipOfflineModeWarning" "0"
"AutoLogin" "1" "AutoLogin" "1"
"Timestamp" "0" "timestamp" "0"
} }
} }
+2 -2
View File
@@ -8,7 +8,7 @@
"WantsOfflineMode" "0" "WantsOfflineMode" "0"
"SkipOfflineModeWarning" "0" "SkipOfflineModeWarning" "0"
"AutoLogin" "1" "AutoLogin" "1"
"Timestamp" "1787904411" "timestamp" "1787904411"
} }
"1" "1"
{ {
@@ -18,6 +18,6 @@
"WantsOfflineMode" "0" "WantsOfflineMode" "0"
"SkipOfflineModeWarning" "0" "SkipOfflineModeWarning" "0"
"AutoLogin" "1" "AutoLogin" "1"
"Timestamp" "1787904647" "timestamp" "1787904647"
} }
} }
+2 -2
View File
@@ -8,7 +8,7 @@
"WantsOfflineMode" "0" "WantsOfflineMode" "0"
"SkipOfflineModeWarning" "0" "SkipOfflineModeWarning" "0"
"AutoLogin" "1" "AutoLogin" "1"
"Timestamp" "1797904411" "timestamp" "1797904411"
} }
"1" "1"
{ {
@@ -18,6 +18,6 @@
"WantsOfflineMode" "0" "WantsOfflineMode" "0"
"SkipOfflineModeWarning" "0" "SkipOfflineModeWarning" "0"
"AutoLogin" "1" "AutoLogin" "1"
"Timestamp" "1787904647" "timestamp" "1787904647"
} }
} }
+1 -1
View File
@@ -9,6 +9,6 @@
"SkipOfflineModeWarning" "0" "SkipOfflineModeWarning" "0"
"AllowAutoLogin" "1" "AllowAutoLogin" "1"
"MostRecent" "1" "MostRecent" "1"
"Timestamp" "0" "timestamp" "0"
} }
} }
+2 -2
View File
@@ -9,7 +9,7 @@
"SkipOfflineModeWarning" "0" "SkipOfflineModeWarning" "0"
"AllowAutoLogin" "1" "AllowAutoLogin" "1"
"MostRecent" "0" "MostRecent" "0"
"Timestamp" "0" "timestamp" "0"
} }
"1" "1"
{ {
@@ -20,6 +20,6 @@
"SkipOfflineModeWarning" "0" "SkipOfflineModeWarning" "0"
"AllowAutoLogin" "1" "AllowAutoLogin" "1"
"MostRecent" "1" "MostRecent" "1"
"Timestamp" "10" "timestamp" "10"
} }
} }
+3 -4
View File
@@ -10,7 +10,7 @@ gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gio, GLib # noqa from gi.repository import Gtk, Gio, GLib # noqa
class TestWidget(ColorAwareApp, Gtk.Button): class DummyWidget(ColorAwareApp, Gtk.Button):
def __init__(self) -> None: def __init__(self) -> None:
super().__init__() super().__init__()
@@ -22,11 +22,10 @@ class TestWidget(ColorAwareApp, Gtk.Button):
@pytest.fixture @pytest.fixture
def widget() -> TestWidget: def widget() -> DummyWidget:
return TestWidget() return DummyWidget()
@pytest.mark.integration
@pytest.mark.parametrize("key, expect", [("default", False), ("prefer-dark", True)]) @pytest.mark.parametrize("key, expect", [("default", False), ("prefer-dark", True)])
def test_light_mode(widget, key: str, expect: bool) -> None: def test_light_mode(widget, key: str, expect: bool) -> None:
local_pref = subprocess.run( local_pref = subprocess.run(
+9
View File
@@ -3,6 +3,7 @@ import pytest
from pathlib import Path from pathlib import Path
from dzgui.api.steam import find_user_id from dzgui.api.steam import find_user_id
from dzgui.const.constants import DEFAULT_STEAM_PATH
from tests.fixtures import fixture_path from tests.fixtures import fixture_path
pytestmark = pytest.mark.apitest pytestmark = pytest.mark.apitest
@@ -25,3 +26,11 @@ def test_loginusers(monkeypatch, fixture: str, expect: int) -> None:
monkeypatch.setattr("dzgui.api.steam.find_loginusers", mock_loginusers) monkeypatch.setattr("dzgui.api.steam.find_loginusers", mock_loginusers)
uid = find_user_id(Path("")) uid = find_user_id(Path(""))
assert int(uid) == expect assert int(uid) == expect
@pytest.mark.realconfig
def test_live_loginusers() -> None:
"""Added on 2026-10-17 following changes to VDF keys"""
steam = Path.home().joinpath(DEFAULT_STEAM_PATH)
uid = find_user_id(steam)
assert uid is not None