mirror of
https://github.com/aclist/dztui.git
synced 2026-10-25 12:12:31 +01:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3fff40f8f |
No files matched your search
+2
-2
@@ -245,9 +245,9 @@ def find_user_id(path: Path) -> str | None:
|
||||
last_user = str(next(iter(users)))
|
||||
if len(users) == 1:
|
||||
return last_user
|
||||
last_stamp = int(users[last_user]["timestamp"])
|
||||
last_stamp = int(users[last_user]["Timestamp"])
|
||||
for user in users:
|
||||
stamp = int(users[user]["timestamp"])
|
||||
stamp = int(users[user]["Timestamp"])
|
||||
if stamp > last_stamp:
|
||||
last_stamp = stamp
|
||||
last_user = user
|
||||
|
||||
@@ -22,11 +22,12 @@ class FilterManager:
|
||||
strings.filter_night: True,
|
||||
strings.filter_full: show_full,
|
||||
strings.filter_official: True,
|
||||
strings.filter_nonascii: False,
|
||||
strings.filter_modded: True,
|
||||
strings.filter_lowpop: True,
|
||||
strings.filter_unofficial: True,
|
||||
strings.filter_unmodded: True,
|
||||
strings.filter_duplicate: False,
|
||||
strings.filter_modded: True,
|
||||
strings.filter_nonascii: False,
|
||||
}
|
||||
|
||||
# TODO: strings
|
||||
@@ -43,6 +44,7 @@ class FilterManager:
|
||||
strings.filter_unofficial: "Third-party servers",
|
||||
strings.filter_duplicate: "Duplicates of existing servers (usually spoofed)",
|
||||
strings.filter_modded: "Servers with one or more mods",
|
||||
strings.filter_unmodded: "Servers with no mods",
|
||||
}
|
||||
|
||||
self.active_keyword = ""
|
||||
|
||||
@@ -243,6 +243,8 @@ class ProxyModelManager:
|
||||
rows = [row for row in rows if (row[4] / row[5] * 100) > 30]
|
||||
case strings.filter_modded:
|
||||
rows = [row for row in rows if not row[11]]
|
||||
case strings.filter_unmodded:
|
||||
rows = [row for row in rows if row[11]]
|
||||
return rows
|
||||
|
||||
def filter_toggle_on(self, filters: tuple[str]) -> list:
|
||||
|
||||
@@ -156,6 +156,7 @@ filter_duplicate = "Duplicate"
|
||||
filter_official = "Official"
|
||||
filter_unofficial = "Unofficial"
|
||||
filter_modded = "Modded"
|
||||
filter_unmodded = "Unmodded"
|
||||
|
||||
# maps
|
||||
all_maps = "All maps"
|
||||
|
||||
+1
-1
@@ -8,6 +8,6 @@
|
||||
"WantsOfflineMode" "0"
|
||||
"SkipOfflineModeWarning" "0"
|
||||
"AutoLogin" "1"
|
||||
"timestamp" "0"
|
||||
"Timestamp" "0"
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
"WantsOfflineMode" "0"
|
||||
"SkipOfflineModeWarning" "0"
|
||||
"AutoLogin" "1"
|
||||
"timestamp" "1787904411"
|
||||
"Timestamp" "1787904411"
|
||||
}
|
||||
"1"
|
||||
{
|
||||
@@ -18,6 +18,6 @@
|
||||
"WantsOfflineMode" "0"
|
||||
"SkipOfflineModeWarning" "0"
|
||||
"AutoLogin" "1"
|
||||
"timestamp" "1787904647"
|
||||
"Timestamp" "1787904647"
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
"WantsOfflineMode" "0"
|
||||
"SkipOfflineModeWarning" "0"
|
||||
"AutoLogin" "1"
|
||||
"timestamp" "1797904411"
|
||||
"Timestamp" "1797904411"
|
||||
}
|
||||
"1"
|
||||
{
|
||||
@@ -18,6 +18,6 @@
|
||||
"WantsOfflineMode" "0"
|
||||
"SkipOfflineModeWarning" "0"
|
||||
"AutoLogin" "1"
|
||||
"timestamp" "1787904647"
|
||||
"Timestamp" "1787904647"
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -9,6 +9,6 @@
|
||||
"SkipOfflineModeWarning" "0"
|
||||
"AllowAutoLogin" "1"
|
||||
"MostRecent" "1"
|
||||
"timestamp" "0"
|
||||
"Timestamp" "0"
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
"SkipOfflineModeWarning" "0"
|
||||
"AllowAutoLogin" "1"
|
||||
"MostRecent" "0"
|
||||
"timestamp" "0"
|
||||
"Timestamp" "0"
|
||||
}
|
||||
"1"
|
||||
{
|
||||
@@ -20,6 +20,6 @@
|
||||
"SkipOfflineModeWarning" "0"
|
||||
"AllowAutoLogin" "1"
|
||||
"MostRecent" "1"
|
||||
"timestamp" "10"
|
||||
"Timestamp" "10"
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gio, GLib # noqa
|
||||
|
||||
|
||||
class DummyWidget(ColorAwareApp, Gtk.Button):
|
||||
class TestWidget(ColorAwareApp, Gtk.Button):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
@@ -22,10 +22,11 @@ class DummyWidget(ColorAwareApp, Gtk.Button):
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def widget() -> DummyWidget:
|
||||
return DummyWidget()
|
||||
def widget() -> TestWidget:
|
||||
return TestWidget()
|
||||
|
||||
|
||||
@pytest.mark.integration
|
||||
@pytest.mark.parametrize("key, expect", [("default", False), ("prefer-dark", True)])
|
||||
def test_light_mode(widget, key: str, expect: bool) -> None:
|
||||
local_pref = subprocess.run(
|
||||
|
||||
@@ -3,7 +3,6 @@ import pytest
|
||||
from pathlib import Path
|
||||
|
||||
from dzgui.api.steam import find_user_id
|
||||
from dzgui.const.constants import DEFAULT_STEAM_PATH
|
||||
from tests.fixtures import fixture_path
|
||||
|
||||
pytestmark = pytest.mark.apitest
|
||||
@@ -26,11 +25,3 @@ def test_loginusers(monkeypatch, fixture: str, expect: int) -> None:
|
||||
monkeypatch.setattr("dzgui.api.steam.find_loginusers", mock_loginusers)
|
||||
uid = find_user_id(Path(""))
|
||||
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
|
||||
Reference in new issue
Block a user