Compare commits

..

No commits in common. "5ba6b6c04073bddf2c20830db2196eb1da8bb6e7" and "d3f64c1ba5571873adfeffa7e97409e67fd378f3" have entirely different histories.

16 changed files with 35 additions and 44 deletions

View File

@ -14,10 +14,5 @@ sphinx-build -M html source build -a
# Building standalone DZGUI release binaries
1. Run `./scripts/dl_pyapp.sh`
# TODO: secondary script that packs this archive
2. Download cpython 3.13, linux, gnu, v3
https://github.com/astral-sh/python-build-standalone/releases/download/20251014/cpython-3.13.9%2B20251014-x86_64_v3-unknown-linux-gnu-install_only_stripped.tar.gz
3. Explicitly install dependencies into site-packages
4. Pack back into a tarball
5. Run `python3 scripts/release.py`
6. Generate a release and tag against the bundled `dzgui` executable
2. Run `python3 scripts/release.py`
3. Generate a release and tag against the bundled `dzgui` executable

View File

@ -106,7 +106,7 @@ class A2SInfo:
def get_netmask() -> str:
hostname = os.uname()[1]
i = socket.gethostbyname(f"{hostname}.local")
i = socket.gethostbyname(hostname)
netmask = i.rsplit(".", 1)[0]
return netmask

View File

@ -112,9 +112,6 @@ def main() -> None:
copy_state_files(xdg_paths["XDG_STATE_HOME"])
# TODO: add logging inside wizard
SetupWizard(_is_steam_deck, XDG.config)
# NOTE: implies that setup wizard failed or was closed
if has_new_config(XDG.config) is False:
return
setup_logger(XDG.debug)
@ -130,7 +127,7 @@ def main() -> None:
if has_steam_client() is False:
EarlyAlertDialog(init.requires_steam)
# NOTE: clears versions file of unlinked mods
# NOTE: clear versions file of unlinked mods
rebuild_symlinks(XDG.config)
remove_stale_signatures(XDG.config, XDG.version)

View File

@ -22,6 +22,7 @@ import gi
gi.require_version("Gtk", "3.0")
from gi.repository.Gtk import main_quit # noqa E402
# import dzgui.api.servers as Servers
if TYPE_CHECKING:
from dzgui.config.userprefs import UserPrefs
from dzgui.controllers.mc import Controller

View File

@ -20,10 +20,7 @@ logger = logging.getLogger(APP_NAME)
class NoteManager:
def __init__(self, controller: "Controller", path: "Path") -> None:
self.notes_path = path
try:
self.cache: dict[str, str] = read_json(self.notes_path)
except Exception:
self.cache = {}
self.cache: dict[str, str] = read_json(self.notes_path)
def add_note(self, server: str, note: str) -> None:
self.cache[server] = note

View File

@ -125,8 +125,6 @@ class ServerModelManager:
@call_on_thread(dialog.scanning)
def dump_lan(self, port: int, early_abort: bool) -> None:
self.first_iteration = True
servers = []
ports = range(1, 256)
failure_func = StoredFunc(self._cleanup_on_failure)
@ -141,11 +139,15 @@ class ServerModelManager:
res = future.result(timeout=LAN_TIMEOUT)
if res is None:
continue
servers.append(res)
if early_abort is True:
# NOTE: on first non-empty hit, flag pending threads to close
event.set()
break
servers.append(res)
self.thread_man.set_cleanup_func(
StoredFunc(self._cleanup_on_success)
)
return
servers.append(res)
except Exception as e:
logger.critical(e)
self.thread_man.set_cleanup_func(failure_func, destroy_first=True)

View File

@ -67,4 +67,4 @@ label_client = "Steam client"
### Completion page
heading_completion = "Setup complete"
blurb_completion = "Configuration completed successfully. Click 'Close' to close this dialog and launch DZGUI."
blurb_completion = "Configuration completed successfully. Please exit and restart DZGUI to apply changes."

View File

@ -2,13 +2,15 @@ import json
from pathlib import Path
from typing import Any
def read_json(path: Path) -> Any:
try:
with open(path, "r") as infile:
data = json.load(infile)
return data
except Exception as e:
try:
data = json.load(infile)
return data
except json.decoder.JSONDecodeError as e:
raise e
except OSError as e:
raise e

View File

@ -101,7 +101,7 @@ build_corrupted = (
"Steam settings or DayZ installation may be corrupted. Try restarting Steam."
)
api_warn_msg = """No servers returned. Please wait and try again.
This usually indicates a transitory network timeout. If this issue persists, your API key or network may be malfunctioning.
If this issue persists, your API key may be defunct or your network is blocking requests.
"""
server_timeout = "Timed out when querying server, check IP or try again later."
server_error = (

View File

@ -262,8 +262,8 @@ class Grid(Gtk.Grid):
self.emitter.connect("server_page_toggled", self.toggle_filter_panels)
# TODO: drop, use map/signal
def hide_widgets_on_init(self) -> None:
self.conpan.set_lan_visible(False)
self.right_panel.sel_panel.hide()
def toggle_filter_panels(self, emitter: "Emitter", state: bool) -> None:

View File

@ -278,7 +278,9 @@ class ConnectPanel(Gtk.Box):
for el in self.lan, self.fav, self.add_panel:
self.add(el)
self.lan.set_visible(False)
def set_lan_visible(self, state: bool) -> None:
self.lan.set_visible(state)
def _on_lan_tab_toggled(self, emitter: "Emitter", state: bool) -> None:
self.lan.set_visible(state)
self.set_lan_visible(state)

View File

@ -11,5 +11,5 @@ class ModsMixin:
self, tree: TreeView, path: Gtk.TreePath, column: Gtk.TreeViewColumn
) -> None:
mod = self.get_value_at_index(2)
self.controller.open_workshop_page(mod) # type: ignore
path = self.get_focused_row_path() # type: ignore
self.controller.open_mod_page(path) # type: ignore

View File

@ -17,7 +17,7 @@ from dzgui.views.trees.tree_server_mods import ServerModTreeView
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gdk, Gtk # noqa E402
from gi.repository import Gdk, Gtk # type: ignore # noqa E402
if TYPE_CHECKING:

View File

@ -162,8 +162,8 @@ class ServerTreeView(ContextMixin, TreeView): # type: ignore
def _on_map(self, widget: Self) -> None:
# TODO: disable filter panel if current model is None
state = self.get_enum() is ServerTab.LAN
self.emitter.emit("lan_tab_toggled", state)
if self.get_enum() is ServerTab.LAN:
self.emitter.emit("lan_tab_toggled", True)
store = self.filter_man.get_map_store()
@ -178,6 +178,8 @@ class ServerTreeView(ContextMixin, TreeView): # type: ignore
# NOTE: removes queue checker for this tab
GLib.Source.remove(self.queue_id)
self.emitter.disconnect(self.handler_id)
if self.get_enum() is ServerTab.LAN:
self.emitter.emit("lan_tab_toggled", False)
def _on_col_width_changed(
self, col: Gtk.TreeViewColumn, width: GObject.ParamSpecInt

View File

@ -4,7 +4,7 @@ description = "DayZ server browser and mod manager for Linux"
authors = [
{name = "aclist"}
]
version = "7.0.0b3"
version = "7.0.0b2"
license = "GPL-3.0-or-later"
license-files = ["LICENSE"]
readme = "README.md"

View File

@ -9,7 +9,6 @@ root = Path(__file__).resolve().parents[1]
output = root.joinpath("dist")
pyapp_dir = root.joinpath("pyapp-latest")
cpython = root.joinpath("build/cpython/airgapped.tar.gz")
builder = build.ProjectBuilder(root)
wheel = builder.build("wheel", output_directory=output)
@ -27,15 +26,9 @@ env["PYAPP_PROJECT_VERSION"] = version
env["PYAPP_PROJECT_NAME"] = appname
env["PYAPP_EXEC_SPEC"] = entrypoint
env["PYAPP_PROJECT_PATH"] = wheel
env["PYAPP_PASS_LOCATION"] = "true"
# env["PYAPP_PYTHON_VERSION"] = "3.13"
# NOTE: explicitly install all dependencies into distribution
env["PYAPP_SKIP_INSTALL"] = "true"
env["PYAPP_DISTRIBUTION_EMBED"] = "true"
env["PYAPP_FULL_ISOLATION"] = "true"
env["PYAPP_DISTRIBUTION_PATH"] = str(cpython)
env["PYAPP_DISTRIBUTION_PYTHON_PATH"] = "python/bin/python3"
env["PYAPP_PYTHON_VERSION"] = "3.13"
env["PYAPP_PASS_LOCATION"] = "true"
proc = subprocess.run(["cargo", "build", "--release"], env=env, cwd=pyapp_dir)
if proc.returncode == 0: