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

Method write

src/ssh_config_parser.py:169–188  ·  view source on GitHub ↗
(self, backup: bool = True)

Source from the content-addressed store, hash-verified

167 return self.config
168
169 def write(self, backup: bool = True) -> None:
170 content = self._generate_content()
171
172 if self.config_path.exists():
173 try:
174 with self.config_path.open("r", encoding="utf-8") as f:
175 current = f.read()
176 if current == content:
177 return
178 except Exception:
179 pass
180
181 effective_backup = (
182 backup and self.auto_backup_enabled and self.config_path.exists()
183 )
184 if effective_backup and not self._have_backed_up_this_session:
185 self._backup_file()
186 self._have_backed_up_this_session = True
187
188 self._atomic_write(content)
189
190 def validate(self) -> List[str]:
191 errors: List[str] = []

Callers 5

installMethod · 0.80
_atomic_writeMethod · 0.80
_on_save_clickedMethod · 0.80
_write_and_reloadMethod · 0.80
_on_save_clickedMethod · 0.80

Calls 3

_generate_contentMethod · 0.95
_backup_fileMethod · 0.95
_atomic_writeMethod · 0.95

Tested by

no test coverage detected