()
| 177 | |
| 178 | def _parse_config_async(self): |
| 179 | def worker(): |
| 180 | try: |
| 181 | if self.parser is not None: |
| 182 | self.parser.parse() |
| 183 | |
| 184 | def update_ui(): |
| 185 | try: |
| 186 | if self.main_window and getattr( |
| 187 | self.main_window, "host_list", None |
| 188 | ): |
| 189 | self.main_window.host_list.load_hosts( |
| 190 | self.parser.config.hosts |
| 191 | ) |
| 192 | except Exception: |
| 193 | pass |
| 194 | return False |
| 195 | |
| 196 | GLib.idle_add(update_ui) |
| 197 | except Exception as e: |
| 198 | logging.error(f"Failed to initialize SSH config parser: {e}") |
| 199 | GLib.idle_add( |
| 200 | lambda: ( |
| 201 | self._show_error_dialog(_("Failed to load SSH config"), str(e)), |
| 202 | False, |
| 203 | )[1] |
| 204 | ) |
| 205 | |
| 206 | t = threading.Thread(target=worker, daemon=True) |
| 207 | t.start() |
nothing calls this directly
no test coverage detected