MCPcopy Create free account
hub / github.com/BuddySirJava/SSH-Studio / update_if_touched

Method update_if_touched

src/ui/host_editor.py:899–912  ·  view source on GitHub ↗
(
            key: str, value: str | None, default_absent_values: list[str] | None = None
        )

Source from the content-addressed store, hash-verified

897 )
898
899 def update_if_touched(
900 key: str, value: str | None, default_absent_values: list[str] | None = None
901 ):
902 if key not in self._touched_options:
903 return
904 v = (value or "").strip()
905 if default_absent_values and v.lower() in [
906 d.lower() for d in default_absent_values
907 ]:
908 self.current_host.remove_option(key)
909 elif v == "":
910 self.current_host.remove_option(key)
911 else:
912 self.current_host.set_option(key, v)
913
914 update_if_touched("HostName", self.hostname_entry.get_text())
915 update_if_touched("User", self.user_entry.get_text())

Callers

nothing calls this directly

Calls 2

remove_optionMethod · 0.80
set_optionMethod · 0.80

Tested by

no test coverage detected