MCPcopy Index your code
hub / github.com/BuddySirJava/SSH-Studio / _generate_content

Method _generate_content

src/ssh_config_parser.py:316–331  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

314 logger.warning("Failed to create backup: %s", e)
315
316 def _generate_content(self) -> str:
317 lines: List[str] = []
318 for opt in self.config.global_options:
319 lines.append(str(opt))
320 if self.config.global_options and (not lines or lines[-1] != ""):
321 lines.append("")
322 for host in self.config.hosts:
323 lines.append(f"Host {' '.join(host.patterns)}")
324 for opt in host.options:
325 lines.append(str(opt))
326 lines.append("")
327 while lines and lines[-1] == "":
328 lines.pop()
329 for inc in self.config.include_directives:
330 lines.append(f"Include {inc}")
331 return "\n".join(lines) + "\n"
332
333 def _atomic_write(self, content: str) -> None:
334 tmp = tempfile.NamedTemporaryFile(

Callers 2

writeMethod · 0.95
_on_save_clickedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected