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