mirror of
https://github.com/aclist/dztui.git
synced 2026-08-26 01:37:18 +02:00
chore: boilerplate
This commit is contained in:
parent
67eff054a3
commit
cf913eff1b
@ -6,8 +6,6 @@ from enum import Enum
|
||||
from pathlib import Path
|
||||
from typing import BinaryIO, Self, Union
|
||||
|
||||
from packaging.version import Version
|
||||
|
||||
from dzgui.const.constants import (
|
||||
APPID_DAYZ,
|
||||
APPID_DAYZ_EXP,
|
||||
@ -448,21 +446,6 @@ def get_app_path(folders_path: Path, appid: int) -> Path:
|
||||
return app_path
|
||||
|
||||
|
||||
# TODO: tests
|
||||
#def compare_versions(local: DayZVersion, remote: DayZVersion) -> VersionMatch:
|
||||
# local_str = Version(dayz_version_to_str(local))
|
||||
# remote_str = Version(dayz_version_to_str(remote))
|
||||
#
|
||||
# if local_str == remote_str:
|
||||
# return VersionMatch.SAME_VERSION
|
||||
#
|
||||
# if local_str < remote_str:
|
||||
# return VersionMatch.LOCAL_OLDER
|
||||
#
|
||||
# if local_str > remote_str:
|
||||
# return VersionMatch.LOCAL_NEWER
|
||||
|
||||
|
||||
def get_pretty_version(steam_path: Path, appid: int) -> str | None:
|
||||
try:
|
||||
pe_file_path = get_pefile_path(steam_path, appid)
|
||||
|
||||
@ -221,7 +221,7 @@ def parse_json(json: list) -> list:
|
||||
mapname = row["map"].lower()
|
||||
players = row["players"]
|
||||
max_players = row["max_players"]
|
||||
raw = [
|
||||
raw = (
|
||||
name,
|
||||
mapname,
|
||||
view,
|
||||
@ -234,7 +234,7 @@ def parse_json(json: list) -> list:
|
||||
ping,
|
||||
provider,
|
||||
modded,
|
||||
]
|
||||
)
|
||||
rows.append(raw)
|
||||
return rows
|
||||
|
||||
|
||||
@ -323,6 +323,7 @@ class Controller(GObject.GObject):
|
||||
def _on_servers_loaded_init(self, emitter: "Emitter") -> None:
|
||||
"""Triggered after servers load but prior to maps loading"""
|
||||
# FIXME: wipe maps store when changing tabs if model is none
|
||||
# e.g. select recent, toggle map, then select lan -> not wiped
|
||||
tv = self.get_active_treeview()
|
||||
if tv.loaded is False:
|
||||
return
|
||||
|
||||
@ -83,13 +83,12 @@ def main() -> None:
|
||||
if args.version is True:
|
||||
print(get_version())
|
||||
sys.exit(0)
|
||||
|
||||
if args.uninstall is True:
|
||||
uninstall()
|
||||
sys.exit(0)
|
||||
|
||||
if args.debug is True:
|
||||
warnings.filterwarnings("default", category=DeprecationWarning)
|
||||
|
||||
version = get_version()
|
||||
set_locale()
|
||||
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
from pathlib import Path
|
||||
|
||||
import gi # noqa E402
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib, GObject
|
||||
|
||||
from dzgui.util.strings import picker
|
||||
|
||||
import gi # noqa E402
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk # noqa E402
|
||||
|
||||
|
||||
class FilePicker(Gtk.FileChooserDialog):
|
||||
def __init__(self, parent: Gtk.Window) -> None:
|
||||
|
||||
@ -45,6 +45,7 @@ class ServerDialog(GenericDialog):
|
||||
self.content = self.get_content_area()
|
||||
self.content.pack_start(self.scrollable_tree, EXPAND, FILL, 0)
|
||||
|
||||
# TODO:
|
||||
# def pack(self, widget: Gtk.Widget) -> None:
|
||||
# self.content.pack_start(widget, EXPAND, FILL, NO_PADDING)
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ build-backend = "setuptools.build_meta"
|
||||
[tool.ruff]
|
||||
line-length = 88
|
||||
indent-width = 4
|
||||
extend-exclude = ["tree_server_mods.py", "dialogs", "*lib/a2s"]
|
||||
extend-exclude = ["*lib/a2s"]
|
||||
lint.unfixable = ["F401"]
|
||||
|
||||
[tool.ruff.format]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user