mirror of
https://github.com/aclist/dztui.git
synced 2026-08-26 01:37:18 +02:00
chore: clear linting errors
This commit is contained in:
parent
3cdc36c78b
commit
77c42f5b78
@ -7,8 +7,6 @@ from dzgui.config.query import lookup
|
||||
from dzgui.const.endpoints import BM_SERVERS
|
||||
from dzgui.const.enum import Preferences
|
||||
|
||||
from typing import Union
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
def get_attributes(config: Path, uid: int) -> str:
|
||||
|
||||
@ -17,7 +17,7 @@ from dzgui.const.constants import (
|
||||
)
|
||||
|
||||
from dzgui.util.strings import checkmark
|
||||
from dzgui.config.query import enum_to_key, lookup
|
||||
from dzgui.config.query import lookup
|
||||
from dzgui.const.enum import Preferences
|
||||
|
||||
from typing import Any
|
||||
@ -91,7 +91,7 @@ def get_delimited_mods(steam_path: Path) -> list[Any]:
|
||||
for mod in mods:
|
||||
mod_dir = mod.name
|
||||
symlink = _hash(mod_dir)
|
||||
# NOTE: malformed .cpp files could break this
|
||||
# FIXME: malformed .cpp files could break this
|
||||
# mention that mods may be downloading
|
||||
meta = parse_meta(mod)
|
||||
if meta is None:
|
||||
|
||||
@ -28,8 +28,8 @@ def write_shim_file(share_path: Path) -> None:
|
||||
"""
|
||||
try:
|
||||
file.write_text(textwrap.dedent(template))
|
||||
f.chmod(f.stat().st_mode | stat.S_IEXEC)
|
||||
except OSError:
|
||||
file.chmod(file.stat().st_mode | stat.S_IEXEC)
|
||||
except OSError as e:
|
||||
logger.critical(e)
|
||||
return
|
||||
clear_old_path()
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
def uninstall(path: Path) -> None
|
||||
def uninstall(path: Path) -> None:
|
||||
pass
|
||||
# TODO: use xdg object?
|
||||
# partial/full (keep config?)
|
||||
# -u removes state, log
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import logging
|
||||
import re
|
||||
import shutil
|
||||
import threading
|
||||
import textwrap
|
||||
|
||||
@ -62,7 +62,9 @@ class ModelManager:
|
||||
Methods are not thread-safe in themselves.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
# FIXME: do not manipulate keyword/map widgets in here
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.filter_cache = {}
|
||||
self.ping_cache = {}
|
||||
|
||||
|
||||
@ -47,7 +47,6 @@ def copy_state_files(state_path: Path) -> None:
|
||||
|
||||
def copy_ipdb(ips_path: Path) -> None:
|
||||
home = Path.home()
|
||||
name = "ips.csv"
|
||||
legacy = home / LEGACY_IPS_PATH
|
||||
if ips_path == legacy:
|
||||
return
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
import requests
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from importlib import resources
|
||||
from packaging.version import Version, InvalidVersion
|
||||
from pathlib import Path
|
||||
|
||||
from dzgui.const.constants import APP_NAME_LOWER, REQUEST_TIMEOUT
|
||||
from dzgui.const.endpoints import GITHUB_RELEASES, CODEBERG_RELEASES
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
def get_time() -> int:
|
||||
return int(datetime.now().timestamp())
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import gi # noqa E402
|
||||
import gi
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk
|
||||
from gi.repository import Gtk, Gdk # noqa E402
|
||||
|
||||
|
||||
def add_class(widget: Gtk.Widget, label: str) -> None:
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import re
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
CPU_FILE = "/proc/cpuinfo"
|
||||
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import textwrap
|
||||
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import a2s
|
||||
import gzip
|
||||
import requests
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import gi # noqa E402
|
||||
import gi
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gdk
|
||||
from gi.repository import Gdk # noqa E402
|
||||
|
||||
def is_navkey(key: int) -> bool:
|
||||
nav_keys = [
|
||||
|
||||
@ -10,7 +10,7 @@ def number(num: int | float) -> str:
|
||||
return locale.format_string(spec, num, grouping=True)
|
||||
|
||||
|
||||
def set_locale():
|
||||
def set_locale() -> None:
|
||||
locale.setlocale(locale.LC_ALL, "")
|
||||
user_loc = loc if (loc := os.getenv("LC_CTYPE")) else "en_US.UTF-8"
|
||||
locale.setlocale(locale.LC_NUMERIC, loc)
|
||||
locale.setlocale(locale.LC_NUMERIC, user_loc)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import gi # noqa E402
|
||||
import gi
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gtk # noqa E402
|
||||
|
||||
def set_surrounding_margins(widget: Gtk.Widget, margin: int) -> None:
|
||||
"""
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import os
|
||||
import shlex
|
||||
import subprocess
|
||||
|
||||
from dzgui.const.constants import APPID_DAYZ
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
from dataclasses import dataclass
|
||||
from typing import List, Dict
|
||||
|
||||
from dzgui.const.constants import SYSTEM_LOG
|
||||
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import hashlib
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user