home · contact · privacy
Minor refactoring.
authorChristian Heller <c.heller@plomlompom.de>
Fri, 26 Sep 2025 03:48:52 +0000 (05:48 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Fri, 26 Sep 2025 03:48:52 +0000 (05:48 +0200)
src/ircplom/client_tui.py

index 01f712798ad4959f909cb339c98dbd3d9e14f0a6..efd7458b9567cbf954b5e06f5e27cee9eb46fd1b 100644 (file)
@@ -511,16 +511,16 @@ class ClientTui(BaseTui):
     def __init__(self, **kwargs) -> None:
         super().__init__(**kwargs)
         self._client_mngrs: dict[str, _ClientWindowsManager] = {}
+        if self._path_config is None:
+            return
         config = {}
-        if self._path_config is not None:
-            if self._path_config.exists():
-                self.log(f'Found config at {self._path_config}, reading …')
-                assert self._path_config.is_file()
-                with open(self._path_config, 'rb') as f:
-                    config = toml_load(f)
-            else:
-                self.log(
-                    f'No config at {self._path_config}, proceeding without.')
+        if self._path_config.exists():
+            self.log(f'Found config at {self._path_config}, reading …')
+            assert self._path_config.is_file()
+            with open(self._path_config, 'rb') as f:
+                config = toml_load(f)
+        else:
+            self.log(f'No config at {self._path_config}, proceeding without.')
         for server_conf in config.get('server', []):
             self.log(f'Connecting: {server_conf}')
             hostname = server_conf['hostname']