chore: clear typehinting errors

This commit is contained in:
aclist committed 2026-05-14 16:15:22 +09:00
1 parent ea1b9facd2
commit 2ebe8cad84
9 files changed
+35 -27

No files matched your search

+3 -2
View File
@@ -50,7 +50,7 @@ def rc2json(file: Path) -> str:
while True:
tok = lex.get_token()
ntok = lex.get_token()
ntok: str | bool | None = lex.get_token()
if ntok is not None:
ntok = ntok.strip('""')
@@ -58,7 +58,8 @@ def rc2json(file: Path) -> str:
if tok in deprecated:
continue
elif tok in toggles:
ntok = str2bool(ntok)
if ntok is not None:
ntok = str2bool(ntok)
elif tok == "preferred_client":
tok = "client"
elif tok == "api_key":
+2 -2
View File
@@ -23,7 +23,7 @@ def lookup(path: Path, enum: Preferences) -> Any:
return None
def get_config(path: Path) -> dict:
def get_config(path: Path) -> Any:
# TODO: is this being called multiple times?
try:
json = read_json(path)
@@ -37,7 +37,7 @@ def get_favorites(path: Path) -> list[str]:
conf = get_config(path)
except Exception:
pass
return conf["ip_list"]
return list(conf["ip_list"])
# def is_in_favs(record: str, path: Path) -> bool:
+4 -1
View File
@@ -54,7 +54,10 @@ def get_xdg_paths() -> dict:
resolved_paths = {}
for path in xdg_paths:
rp = os.environ.get(path)
resolved_paths[path] = Path(rp) / APP_NAME_LOWER if is_writeable(rp) else xdg_paths[path] / APP_NAME_LOWER
if rp is not None and is_writeable(rp):
resolved_paths[path] = Path(rp)
else:
resolved_paths[path] = xdg_paths[path] / APP_NAME_LOWER
return resolved_paths