Compare commits

...
6 Commits
Author SHA1 Message Date
aclist 5ba6b6c040 Merge pull request #295 from aclist/fix/lan-server
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
fix: break out of loop when sek out of loop on first server
2026-05-20 00:36:58 +09:00
aclist d3b9ba031d Merge branch 'fix/lan-server' of github.com:aclist/dztui into fix/lan-server 2026-05-20 00:35:49 +09:00
aclist 8bfcb6c8fe fix: break out of loop when scanning LAN 2026-05-20 00:35:35 +09:00
aclist 353b10ebfc fix: break out of loop when sek out of loop on first server 2026-05-20 00:25:10 +09:00
aclist 698150645d Merge pull request #290 from aclist/feat/airgapped-installer
feat: airgapped installer
2026-05-20 00:09:31 +09:00
aclist 87f347870f chore: clean up try/except block
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
2026-05-19 23:41:51 +09:00
2 changed files with 8 additions and 12 deletions

No files matched your search

+4 -6
View File
@@ -125,6 +125,8 @@ class ServerModelManager:
@call_on_thread(dialog.scanning) @call_on_thread(dialog.scanning)
def dump_lan(self, port: int, early_abort: bool) -> None: def dump_lan(self, port: int, early_abort: bool) -> None:
self.first_iteration = True
servers = [] servers = []
ports = range(1, 256) ports = range(1, 256)
failure_func = StoredFunc(self._cleanup_on_failure) failure_func = StoredFunc(self._cleanup_on_failure)
@@ -139,15 +141,11 @@ class ServerModelManager:
res = future.result(timeout=LAN_TIMEOUT) res = future.result(timeout=LAN_TIMEOUT)
if res is None: if res is None:
continue continue
servers.append(res)
if early_abort is True: if early_abort is True:
# NOTE: on first non-empty hit, flag pending threads to close # NOTE: on first non-empty hit, flag pending threads to close
event.set() event.set()
servers.append(res) break
self.thread_man.set_cleanup_func(
StoredFunc(self._cleanup_on_success)
)
return
servers.append(res)
except Exception as e: except Exception as e:
logger.critical(e) logger.critical(e)
self.thread_man.set_cleanup_func(failure_func, destroy_first=True) self.thread_man.set_cleanup_func(failure_func, destroy_first=True)
+4 -6
View File
@@ -2,15 +2,13 @@ import json
from pathlib import Path from pathlib import Path
from typing import Any from typing import Any
def read_json(path: Path) -> Any: def read_json(path: Path) -> Any:
try: try:
with open(path, "r") as infile: with open(path, "r") as infile:
try: data = json.load(infile)
data = json.load(infile) return data
return data except Exception as e:
except json.decoder.JSONDecodeError as e:
raise e
except OSError as e:
raise e raise e