mirror of
https://github.com/aclist/dztui.git
synced 2026-11-09 19:40:38 +01:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15d4b71350 | ||
|
|
16d3df618a | ||
|
|
22dd8fc67f | ||
|
|
03fa707305 | ||
|
|
2479cbd41b |
No files matched your search
@@ -37,6 +37,8 @@ Users wishing to review the licenses to these components can inspect the `LICENS
|
||||
|
||||
Steam and the Steam logo are trademarks and/or registered trademarks of Valve Corporation in the U.S. and/or other countries.
|
||||
|
||||
DayZ is a trademark and brand of Bohemia Interactive a.s.
|
||||
|
||||
## Disclaimer
|
||||
|
||||
DZGUI is beta-quality software and is provided as-is.
|
||||
+4
-5
@@ -2,10 +2,10 @@ import hashlib
|
||||
import logging
|
||||
import re
|
||||
|
||||
from concurrent.futures import ThreadPoolExecutor, wait
|
||||
from concurrent.futures import wait
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from dzgui.api.steam import get_app_path
|
||||
from dzgui.api.servers import get_rules, fqip_to_record
|
||||
@@ -18,7 +18,8 @@ from dzgui.const.constants import (
|
||||
|
||||
from dzgui.config.query import lookup
|
||||
from dzgui.const.enum import Preferences
|
||||
from dzgui.init.migrate import clean_legacy_versions_file
|
||||
|
||||
from typing import Any
|
||||
|
||||
logger = logging.getLogger(APP_NAME)
|
||||
|
||||
@@ -132,8 +133,6 @@ def remove_stale_signatures(
|
||||
versions.touch()
|
||||
return
|
||||
|
||||
clean_legacy_versions_file(versions)
|
||||
|
||||
path = lookup(config, Preferences.DEFAULT)
|
||||
steam_path = Path(path)
|
||||
if ids is None:
|
||||
|
||||
+1
-1
@@ -18,8 +18,8 @@ from dzgui.config.query import lookup
|
||||
from dzgui.config.userprefs import UserPrefs
|
||||
from dzgui.config.xdg import get_xdg_paths, parse_filepaths
|
||||
from dzgui.init.migrate import (
|
||||
copy_state_files,
|
||||
has_new_config,
|
||||
copy_state_files,
|
||||
migrate_cols_file,
|
||||
)
|
||||
from dzgui.init.flock import lock_acquire
|
||||
|
||||
@@ -6,8 +6,7 @@ if TYPE_CHECKING:
|
||||
from dzgui.util.ip import Coords
|
||||
|
||||
|
||||
# NOTE: mutable dataclass: 'use_miles' key changes on demand
|
||||
# 'frozen' cannot be True
|
||||
# NOTE: mutable dataclass, 'use_miles' key changes on demand
|
||||
@dataclass(slots=True)
|
||||
class UserPrefs:
|
||||
is_steam_deck: bool
|
||||
|
||||
+1
-22
@@ -1,21 +1,12 @@
|
||||
import json
|
||||
import logging
|
||||
import re
|
||||
import shutil
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
from dzgui.const.constants import (
|
||||
APP_NAME,
|
||||
LEGACY_CONFIG_PATH,
|
||||
LEGACY_COLS_PATH,
|
||||
LEGACY_IPS_PATH,
|
||||
)
|
||||
from dzgui.const.constants import LEGACY_CONFIG_PATH, LEGACY_COLS_PATH, LEGACY_IPS_PATH
|
||||
from dzgui.config.convert import rc2json
|
||||
from dzgui.util._json import read_json, write_json
|
||||
|
||||
logger = logging.getLogger(APP_NAME)
|
||||
|
||||
|
||||
def migrate_legacy_conf(config: Path) -> Any:
|
||||
old_conf = Path.home() / LEGACY_CONFIG_PATH
|
||||
@@ -79,15 +70,3 @@ def copy_ipdb(ips_path: Path) -> None:
|
||||
return
|
||||
# TODO: ensure that month file is copied
|
||||
shutil.copy(legacy, ips_path)
|
||||
|
||||
|
||||
def clean_legacy_versions_file(versions: Path) -> None:
|
||||
# NOTE: handling for #523
|
||||
try:
|
||||
pat = r"^(\d+),(\d+)$"
|
||||
lines = versions.read_text().splitlines()
|
||||
clean = [line for line in lines if re.match(pat, line)]
|
||||
concat = "\n".join(clean)
|
||||
versions.write_text(concat)
|
||||
except Exception as e:
|
||||
logger.warning(e)
|
||||
@@ -1,4 +1,4 @@
|
||||
from pathlib import Path
|
||||
from shared import get_git_root
|
||||
|
||||
BOILERPLATE = """
|
||||
This file includes the combined licenses to the following components:
|
||||
@@ -40,7 +40,7 @@ class CombinedLicense:
|
||||
|
||||
def concat_license() -> str:
|
||||
combined = CombinedLicense()
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
root = get_git_root()
|
||||
licenses = root.joinpath("docs/licenses")
|
||||
|
||||
main_license = root.joinpath(LICENSE_FILE)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import shutil
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
par = Path(__file__).parent.parent
|
||||
clog = par / "CHANGELOG.md"
|
||||
target = par / "dzgui/data/CHANGELOG.md"
|
||||
from shared import get_git_root
|
||||
|
||||
root = get_git_root()
|
||||
clog = root.joinpath("CHANGELOG.md")
|
||||
target = root.joinpath("dzgui/data/CHANGELOG.md")
|
||||
|
||||
shutil.copy(clog, target)
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import tomllib
|
||||
from pathlib import Path
|
||||
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
from shared import get_git_root
|
||||
|
||||
|
||||
def get_entrypoint() -> None:
|
||||
root = get_git_root()
|
||||
p = root.joinpath("pyproject.toml")
|
||||
with open(p, "rb") as f:
|
||||
t = tomllib.load(f)
|
||||
|
||||
+3
-2
@@ -3,14 +3,15 @@ import requests
|
||||
import subprocess
|
||||
import tarfile
|
||||
|
||||
from pathlib import Path
|
||||
from urllib.parse import unquote
|
||||
|
||||
from shared import get_git_root
|
||||
|
||||
BUILD = "3.13.9"
|
||||
DATE = "20251014"
|
||||
CPYTHON_BUILD = f"cpython-{BUILD}"
|
||||
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
root = get_git_root()
|
||||
build_dir = root.joinpath("build")
|
||||
cpython_dir = build_dir.joinpath(CPYTHON_BUILD)
|
||||
|
||||
|
||||
+2
-1
@@ -9,6 +9,7 @@ from pathlib import Path
|
||||
from concat_licenses import concat_license
|
||||
from parse_toml import get_entrypoint
|
||||
from prebuild import get_pyapp, rebuild_cpython
|
||||
from shared import get_git_root
|
||||
|
||||
|
||||
def update_uname(info: tarfile.TarInfo) -> tarfile.TarInfo:
|
||||
@@ -17,7 +18,7 @@ def update_uname(info: tarfile.TarInfo) -> tarfile.TarInfo:
|
||||
return info
|
||||
|
||||
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
root = get_git_root()
|
||||
dist_dir = root.joinpath("dist")
|
||||
build_dir = root.joinpath("build")
|
||||
|
||||
|
||||
+1
-10
@@ -1,16 +1,7 @@
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
from dzgui.app_init import build_gui
|
||||
|
||||
|
||||
def get_git_root() -> Path:
|
||||
proc = subprocess.run(
|
||||
["git", "rev-parse", "--show-toplevel"], capture_output=True, text=True
|
||||
)
|
||||
if proc.returncode != 0:
|
||||
raise OSError("Failed to parse git root")
|
||||
return Path(proc.stdout.rstrip())
|
||||
from shared import get_git_root
|
||||
|
||||
|
||||
def get_image_path() -> Path:
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def get_git_root() -> Path:
|
||||
proc = subprocess.run(
|
||||
["git", "rev-parse", "--show-toplevel"], capture_output=True, text=True
|
||||
)
|
||||
if proc.returncode != 0:
|
||||
raise OSError("Failed to parse git root")
|
||||
return Path(proc.stdout.rstrip())
|
||||
@@ -1,25 +0,0 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from dzgui.init.migrate import clean_legacy_versions_file
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def test_null_signature_stripping(tmp_path: "Path") -> None:
|
||||
tmp = tmp_path.joinpath("dzg.versions")
|
||||
lines = [
|
||||
"1111,2222",
|
||||
"3333,4444",
|
||||
"5555,null",
|
||||
"foo",
|
||||
",4555",
|
||||
"1111",
|
||||
" ",
|
||||
",,,",
|
||||
"-1",
|
||||
]
|
||||
expect = ["1111,2222", "3333,4444"]
|
||||
tmp.write_text("\n".join(lines))
|
||||
clean_legacy_versions_file(tmp)
|
||||
assert expect == tmp.read_text().splitlines()
|
||||
Reference in new issue
Block a user