mirror of
https://github.com/aclist/dztui.git
synced 2026-08-27 02:07:18 +02:00
chore: clear linting errors
This commit is contained in:
parent
24125a7492
commit
7b06973af3
@ -25,4 +25,3 @@ Refer to the documentation for installation and setup instructions:
|
||||
Geolocation records from [DB-IP](https://db-ip.com) under [CC 4.0 license](https://creativecommons.org/licenses/by/4.0/)
|
||||
|
||||
# TODO: mention third party libraries
|
||||
# TODO: mention 'pre-commit install' command
|
||||
|
||||
@ -389,8 +389,6 @@ def ping(iteration: int, row: list) -> Ping:
|
||||
|
||||
|
||||
def query_api(key: str, appid: int, param: str) -> Res:
|
||||
import time
|
||||
|
||||
LIMIT = 10000
|
||||
payload: dict[str, Union[int, str]] = {
|
||||
"filter": r"\appid" + rf"\{appid}" + param,
|
||||
|
||||
@ -8,7 +8,7 @@ from warnings import deprecated
|
||||
from concurrent.futures import wait
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from pathlib import Path
|
||||
from typing import Any, Callable, Literal, Union, TYPE_CHECKING
|
||||
from typing import Any, Callable, TYPE_CHECKING
|
||||
|
||||
import dzgui.api.pefile as PeFile
|
||||
import dzgui.api.servers as Servers
|
||||
|
||||
@ -26,16 +26,17 @@ def get_cpu_model() -> str:
|
||||
def print_servers(servers: list[str]) -> str:
|
||||
s = ""
|
||||
for server in servers:
|
||||
s+= server + "\n"
|
||||
s += server + "\n"
|
||||
return s
|
||||
|
||||
|
||||
def print_mods(mods: list[int]) -> str:
|
||||
s = ""
|
||||
for mod in mods:
|
||||
s+= str(mod) + "\n"
|
||||
s += str(mod) + "\n"
|
||||
return s
|
||||
|
||||
|
||||
def write_diagnostic(config: Path, outfile: Path) -> None:
|
||||
# TODO: test availability on other distros
|
||||
date = datetime.now().isoformat()
|
||||
@ -62,7 +63,7 @@ def write_diagnostic(config: Path, outfile: Path) -> None:
|
||||
servers = lookup(config, Preferences.IP_LIST)
|
||||
servers_pretty = print_servers(servers)
|
||||
|
||||
# FIXME: extraneous newlines in lists
|
||||
# FIXME: extraneous newlines in lists of mods
|
||||
template = f"""\
|
||||
{APP_NAME} version {version} ({branch})
|
||||
Date: {date}
|
||||
@ -82,5 +83,5 @@ def write_diagnostic(config: Path, outfile: Path) -> None:
|
||||
{servers_pretty}
|
||||
"""
|
||||
|
||||
output = "\n".join([line.lstrip() for line in template.split('\n')])
|
||||
output = "\n".join([line.lstrip() for line in template.split("\n")])
|
||||
outfile.write_text(output)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import re
|
||||
|
||||
from dzgui.util.localize import number
|
||||
from dzgui.util.strings import no_mods, no_servers, distance_suffix
|
||||
from dzgui.util.strings import no_mods, no_servers
|
||||
|
||||
import gi
|
||||
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
from dataclasses import dataclass
|
||||
from dzgui.const.constants import SYSTEM_LOG
|
||||
|
||||
# TODO: move to util.format.py
|
||||
|
||||
|
||||
def build_missing(build: str) -> str:
|
||||
msg = (
|
||||
@ -605,7 +607,7 @@ atomic_buttons = AtomicButton(
|
||||
keys_tooltip="Toggles the keybindings dialog",
|
||||
)
|
||||
|
||||
steam_icon_missing="Steam icon not found in IconTheme"
|
||||
steam_icon_missing = "Steam icon not found in IconTheme"
|
||||
|
||||
missing_changelog = "Error: failed to read changelog"
|
||||
esc_to_return = "Press ESC to return"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
from typing import Optional, TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from dzgui.const.enum import ServerTab
|
||||
from dzgui.views.components.buttonbox import ButtonBox
|
||||
@ -50,11 +50,10 @@ class RightPanel(Gtk.Box):
|
||||
if context in (ServerTab.RECENT, ServerTab.SAVED):
|
||||
self.refresh_button.set_sensitive(False)
|
||||
|
||||
# TODO: reference
|
||||
# TODO: reference for ping pass
|
||||
# def _on_ping_clicked(self, button: Gtk.Button) -> None:
|
||||
# block_signals()
|
||||
# def _update_pings():
|
||||
# # TODO
|
||||
# rows = ModelManager.get_filtered()
|
||||
# with ThreadPoolExecutor(100) as executor:
|
||||
# futures = [
|
||||
@ -67,14 +66,10 @@ class RightPanel(Gtk.Box):
|
||||
# path = Gtk.TreePath.new_from_indices([res.iteration])
|
||||
# temp_model[path][9] = res.ping
|
||||
# ModelManager.ping_cache[res.addr] = res.ping
|
||||
# # TODO: drop/rewrite
|
||||
# treeview.set_model(temp_model)
|
||||
# treeview.wait_dialog.destroy()
|
||||
# treeview.grab_focus()
|
||||
|
||||
# # TODO:
|
||||
# unblock_signals()
|
||||
|
||||
# temp_model = self.AppNav.treeview.get_model()
|
||||
# treeview.set_model(None)
|
||||
# treeview.wait_dialog = GenericDialog("Pinging servers", Popup.WAIT)
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
from datetime import datetime
|
||||
from typing import Self, Union, TYPE_CHECKING
|
||||
|
||||
from dzgui.const.enum import NotebookPage, ServerTab
|
||||
|
||||
@ -116,8 +116,6 @@ class WaitDialog(GenericDialog):
|
||||
content.pack_end(spinner, NO_EXPAND, NO_FILL, 0)
|
||||
|
||||
spinner.start()
|
||||
# FIXME: center on parent window
|
||||
# self.show_all()
|
||||
|
||||
def _on_dialog_delete(
|
||||
self, response_id: Gtk.ResponseType, event: Gdk.Event
|
||||
|
||||
@ -183,7 +183,7 @@ class ServerTreeView(ContextMixin, TreeView):
|
||||
self.start_distcalc()
|
||||
|
||||
def _on_unmap(self, a) -> None:
|
||||
# NOTE: remove queue checker for this tab
|
||||
# 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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user