mirror of
https://github.com/aclist/dztui.git
synced 2026-10-25 12:12:31 +01:00
Merge pull request #398 from u-alexandru/fix/history-file-not-found
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
fix: prevent stuck launch dialog when history file is missing
This commit is contained in:
1 file changed
+3
@@ -55,8 +55,11 @@ class ConfigManager:
|
|||||||
self.update_config(Preferences.IP_LIST, ips)
|
self.update_config(Preferences.IP_LIST, ips)
|
||||||
|
|
||||||
def update_history_file(self, fqip: str) -> None:
|
def update_history_file(self, fqip: str) -> None:
|
||||||
|
try:
|
||||||
with open(self.prefs.paths.history, "r") as f:
|
with open(self.prefs.paths.history, "r") as f:
|
||||||
ips = [line.rstrip() for line in f.readlines()]
|
ips = [line.rstrip() for line in f.readlines()]
|
||||||
|
except FileNotFoundError:
|
||||||
|
ips = []
|
||||||
|
|
||||||
seen = set()
|
seen = set()
|
||||||
ips.append(fqip)
|
ips.append(fqip)
|
||||||
|
|||||||
Reference in new issue
Block a user