mirror of
https://github.com/aclist/dztui.git
synced 2026-11-06 01:54:49 +01:00
Compare commits
12
Commits
7.0.0b9
...
c4cc9f04c4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c4cc9f04c4 | ||
|
|
bcd59162b1 | ||
|
|
2f0bac75ac | ||
|
|
9191f43c8e | ||
|
|
2419fedd19 | ||
|
|
83a7996189 | ||
|
|
9d3aa8d9f5 | ||
|
|
0de0dd4a03 | ||
|
|
aeefc830cd | ||
|
|
647f75cde3 | ||
|
|
7e8b8eb7f7 | ||
|
|
79af78a7e0 |
No files matched your search
@@ -14,6 +14,7 @@ from typing import Any, Optional, TYPE_CHECKING, Union
|
|||||||
from dzgui.api.bm import map_id_to_record
|
from dzgui.api.bm import map_id_to_record
|
||||||
from dzgui.const.constants import APP_NAME, REQUEST_TIMEOUT
|
from dzgui.const.constants import APP_NAME, REQUEST_TIMEOUT
|
||||||
from dzgui.const.endpoints import STEAM_SERVERS
|
from dzgui.const.endpoints import STEAM_SERVERS
|
||||||
|
from dzgui.util.format import format_exception
|
||||||
from dzgui.util import strings
|
from dzgui.util import strings
|
||||||
|
|
||||||
import a2s
|
import a2s
|
||||||
@@ -272,8 +273,9 @@ def source_info_to_dict(ip: str, qport: int, info: "SourceInfo") -> dict[str, An
|
|||||||
res["ping"] = ping
|
res["ping"] = ping
|
||||||
return res
|
return res
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# TODO: generalized function
|
msg = format_exception(e)
|
||||||
logger.critical(f"{type(e).__name__}: {e} ({ip}:{qport})")
|
msg += f" ({ip}:{qport})"
|
||||||
|
logger.critical(msg)
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -79,4 +79,4 @@ 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"
|
TMP_EXE = "/tmp/dzgui/dzgui"
|
||||||
@@ -238,8 +238,7 @@ class ConnectionManager:
|
|||||||
def query_modlist_and_present(self, record: Servers.Record) -> None:
|
def query_modlist_and_present(self, record: Servers.Record) -> None:
|
||||||
try:
|
try:
|
||||||
mods = self._query_modlist(record)
|
mods = self._query_modlist(record)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
print(f"{type(e).__name__}: {e}")
|
|
||||||
self.thread_man.set_cleanup_func(
|
self.thread_man.set_cleanup_func(
|
||||||
StoredFunc(self._server_timeout), destroy_first=True
|
StoredFunc(self._server_timeout), destroy_first=True
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class UpdateManager:
|
|||||||
with tarfile.open(TMP_TARBALL) as tar:
|
with tarfile.open(TMP_TARBALL) as tar:
|
||||||
tar.extractall(TMP_PATH)
|
tar.extractall(TMP_PATH)
|
||||||
|
|
||||||
shutil.move(TMP_EXE, exe_path)
|
shutil.copy(TMP_EXE, exe_path)
|
||||||
|
|
||||||
proc = subprocess.run([exe_path, "self", "restore"])
|
proc = subprocess.run([exe_path, "self", "restore"])
|
||||||
if proc.returncode == 0:
|
if proc.returncode == 0:
|
||||||
@@ -53,7 +53,7 @@ class UpdateManager:
|
|||||||
func = StoredFunc(self._on_update_failure, msg)
|
func = StoredFunc(self._on_update_failure, msg)
|
||||||
self.thread_man.set_cleanup_func(func, destroy_first=True)
|
self.thread_man.set_cleanup_func(func, destroy_first=True)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
func = StoredFunc(self._on_update_failure, e)
|
func = StoredFunc(self._on_update_failure, str(e))
|
||||||
self.thread_man.set_cleanup_func(func, destroy_first=True)
|
self.thread_man.set_cleanup_func(func, destroy_first=True)
|
||||||
logger.warning(e)
|
logger.warning(e)
|
||||||
|
|
||||||
|
|||||||
@@ -83,3 +83,7 @@ def format_player_count(model: Gtk.TreeModel | None, control: list) -> str:
|
|||||||
|
|
||||||
def embolden(text: str) -> str:
|
def embolden(text: str) -> str:
|
||||||
return f"<b>{text}</b>"
|
return f"<b>{text}</b>"
|
||||||
|
|
||||||
|
|
||||||
|
def format_exception(e: Exception) -> str:
|
||||||
|
return f"{type(e).__name__}: {e}"
|
||||||
@@ -181,7 +181,7 @@ filter_lowpop = "Low pop"
|
|||||||
filter_nonascii = "Non-ASCII"
|
filter_nonascii = "Non-ASCII"
|
||||||
filter_duplicate = "Duplicate"
|
filter_duplicate = "Duplicate"
|
||||||
filter_official = "Official"
|
filter_official = "Official"
|
||||||
filter_unofficial = "Unoffic."
|
filter_unofficial = "Unofficial"
|
||||||
filter_modded = "Modded"
|
filter_modded = "Modded"
|
||||||
|
|
||||||
# maps
|
# maps
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ from dzgui.const.constants import (
|
|||||||
)
|
)
|
||||||
from dzgui.const.enum import FilterMode
|
from dzgui.const.enum import FilterMode
|
||||||
from dzgui.model.servers import ServerModelManager
|
from dzgui.model.servers import ServerModelManager
|
||||||
|
from dzgui.util.format import format_exception
|
||||||
from dzgui.util.strings import all_maps
|
from dzgui.util.strings import all_maps
|
||||||
from dzgui.views.components.maps_combo import MapsCombo
|
from dzgui.views.components.maps_combo import MapsCombo
|
||||||
from dzgui.views.components.labels import BoldLabel
|
from dzgui.views.components.labels import BoldLabel
|
||||||
@@ -333,6 +334,10 @@ class FilterPanel(Gtk.Box):
|
|||||||
self.emitter.emit("map_selection_changed", name)
|
self.emitter.emit("map_selection_changed", name)
|
||||||
|
|
||||||
def set_filters(self, filters: dict[str, bool]) -> None:
|
def set_filters(self, filters: dict[str, bool]) -> None:
|
||||||
for check in self.button_grid.checks:
|
try:
|
||||||
label = check.get_label()
|
for check in self.button_grid.checks:
|
||||||
check.set_active(filters[label])
|
label = check.get_label()
|
||||||
|
check.set_active(filters[label])
|
||||||
|
except Exception as e:
|
||||||
|
msg = format_exception(e)
|
||||||
|
logger.warning(msg)
|
||||||
@@ -8,7 +8,7 @@ from dzgui.views.components.buttons import LoggerAlertsButton
|
|||||||
import gi
|
import gi
|
||||||
|
|
||||||
gi.require_version("Gtk", "3.0")
|
gi.require_version("Gtk", "3.0")
|
||||||
from gi.repository import Gtk, GObject # noqa E402
|
from gi.repository import Gtk # noqa E402
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from dzgui.const.enum import ServerTab
|
from dzgui.const.enum import ServerTab
|
||||||
@@ -34,14 +34,6 @@ class Statusbar(Gtk.Grid):
|
|||||||
self.attach(self.statusbar, 0, 0, 3, 1)
|
self.attach(self.statusbar, 0, 0, 3, 1)
|
||||||
self.attach_next_to(self.spinner, self.statusbar, Gtk.PositionType.RIGHT, 3, 1)
|
self.attach_next_to(self.spinner, self.statusbar, Gtk.PositionType.RIGHT, 3, 1)
|
||||||
|
|
||||||
# TODO: pack version event box in right panel into hbox with update button
|
|
||||||
# TODO: spawns a modal or just jumps right to install page
|
|
||||||
# from dzgui.views.components.buttons import IconTextButton
|
|
||||||
# b = IconTextButton("dialog-information-symbolic", label="Updates available")
|
|
||||||
# b.set_halign(Gtk.Align.END)
|
|
||||||
# b.set_hexpand(True)
|
|
||||||
# self.attach_next_to(b, self.spinner, Gtk.PositionType.RIGHT, 3, 1)
|
|
||||||
|
|
||||||
self.players = ""
|
self.players = ""
|
||||||
|
|
||||||
controller.get_menu().connect("generic_treesel_changed", self._help_row_changed)
|
controller.get_menu().connect("generic_treesel_changed", self._help_row_changed)
|
||||||
@@ -92,12 +84,6 @@ class Statusbar(Gtk.Grid):
|
|||||||
|
|
||||||
self.set_by_context(enum, bar)
|
self.set_by_context(enum, bar)
|
||||||
|
|
||||||
# TODO: unused
|
|
||||||
def _on_notebook_page_returned(
|
|
||||||
self, statusbar: Self, prior_context: NotebookPage
|
|
||||||
) -> None:
|
|
||||||
self.pop(prior_context)
|
|
||||||
|
|
||||||
def _on_server_row_changed(self, statusbar: Self) -> None:
|
def _on_server_row_changed(self, statusbar: Self) -> None:
|
||||||
self.spinner.start()
|
self.spinner.start()
|
||||||
|
|
||||||
@@ -132,12 +118,6 @@ class Statusbar(Gtk.Grid):
|
|||||||
cid = self.statusbar.get_context_id(str(context))
|
cid = self.statusbar.get_context_id(str(context))
|
||||||
self.statusbar.pop(cid)
|
self.statusbar.pop(cid)
|
||||||
|
|
||||||
@deprecated("currently unused")
|
|
||||||
# def get_text(self) -> str:
|
|
||||||
# area = self.statusbar.get_message_area()
|
|
||||||
# label = area.get_children()[0]
|
|
||||||
# return str(label.get_text())
|
|
||||||
|
|
||||||
def set_by_context(
|
def set_by_context(
|
||||||
self, context: Union[NotebookPage, "ServerTab"], string: str
|
self, context: Union[NotebookPage, "ServerTab"], string: str
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ from dzgui.init.update import check_updates
|
|||||||
from dzgui.const.constants import EXPAND, FILL
|
from dzgui.const.constants import EXPAND, FILL
|
||||||
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
from dzgui.managers.threading import call_on_thread, StoredFunc, ThreadingManager
|
||||||
from dzgui.strings import preboot
|
from dzgui.strings import preboot
|
||||||
|
from dzgui.util.format import format_exception
|
||||||
from dzgui.util.strings import dialog_header
|
from dzgui.util.strings import dialog_header
|
||||||
from dzgui.util.symlink import rebuild_symlinks
|
from dzgui.util.symlink import rebuild_symlinks
|
||||||
from dzgui.views.components.buttons import ClipboardButton
|
from dzgui.views.components.buttons import ClipboardButton
|
||||||
@@ -175,8 +176,7 @@ class BootDialog(Gtk.Dialog):
|
|||||||
self.thread_man.set_cleanup_func(callback)
|
self.thread_man.set_cleanup_func(callback)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.failed = True
|
self.failed = True
|
||||||
# TODO: generic exception wrapper
|
self.exception = format_exception(e)
|
||||||
self.exception = f"{type(e).__name__}: {e}"
|
|
||||||
callback = StoredFunc(self.update_status, Success.FAIL)
|
callback = StoredFunc(self.update_status, Success.FAIL)
|
||||||
self.thread_man.set_cleanup_func(callback)
|
self.thread_man.set_cleanup_func(callback)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ description = "DayZ server browser and mod manager for Linux"
|
|||||||
authors = [
|
authors = [
|
||||||
{name = "aclist"}
|
{name = "aclist"}
|
||||||
]
|
]
|
||||||
version = "7.0.0b9"
|
version = "7.0.0b10"
|
||||||
license = "GPL-3.0-or-later"
|
license = "GPL-3.0-or-later"
|
||||||
license-files = ["LICENSE"]
|
license-files = ["LICENSE"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|||||||
Reference in new issue
Block a user