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

Method is_dirty

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

Source from the content-addressed store, hash-verified

104 original_lines: List[str] = field(default_factory=list)
105
106 def is_dirty(self) -> bool:
107 current_content_lines = []
108 for opt in self.global_options:
109 current_content_lines.append(str(opt))
110 if self.global_options and (
111 not current_content_lines or current_content_lines[-1].strip() != ""
112 ):
113 current_content_lines.append("")
114 for host in self.hosts:
115 current_content_lines.append(f"Host {' '.join(host.patterns)}")
116 for opt in host.options:
117 current_content_lines.append(str(opt))
118 current_content_lines.append("")
119 while current_content_lines and current_content_lines[-1] == "":
120 current_content_lines.pop()
121 for inc in self.include_directives:
122 current_content_lines.append(f"Include {inc}")
123
124 original_clean_lines = [line.rstrip("\n") for line in self.original_lines]
125
126 while original_clean_lines and original_clean_lines[-1] == "":
127 original_clean_lines.pop()
128
129 return current_content_lines != original_clean_lines
130
131 def get_host(self, alias: str) -> Optional[SSHHost]:
132 for h in self.hosts:

Callers 4

undo_addMethod · 0.80
_on_host_changedMethod · 0.80
_on_hosts_reorderedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected