MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / write_update_notice

Method write_update_notice

scripts/update_copyright.py:58–73  ·  view source on GitHub ↗
(self, file, lines)

Source from the content-addressed store, hash-verified

56 return [f"{self._comment_characters} {line}".rstrip() + "\n" for line in self.NOTICE.split("\n")]
57
58 def write_update_notice(self, file, lines):
59 # Build new content
60 new_content = self.copyright_notice(file) + "\n"
61 if lines and lines[0] != "\n":
62 new_content += "\n"
63 new_content += "".join(line.rstrip() + "\n" for line in lines)
64
65 # Only write if different
66 with open(file, encoding="utf-8-sig") as f:
67 old_content = f.read()
68 if new_content == old_content:
69 return
70
71 print(f"Adding notice to {file}")
72 with open(file, "w") as f:
73 f.write(new_content)
74
75
76ROOT = Path(os.path.realpath(__file__)).parent.parent

Callers 1

updateMethod · 0.95

Calls 3

copyright_noticeMethod · 0.95
readMethod · 0.65
writeMethod · 0.45

Tested by

no test coverage detected