MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / write_update_notice

Method write_update_notice

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

Source from the content-addressed store, hash-verified

68 return [f"{self._comment_characters} {line}".rstrip() + "\n" for line in self.NOTICE.split("\n")]
69
70 def write_update_notice(self, file, lines):
71 # Build new content
72 new_content = self.copyright_notice(file) + "\n"
73 if lines and lines[0] != "\n":
74 new_content += "\n"
75 new_content += "".join(line.rstrip() + "\n" for line in lines)
76
77 # Only write if different
78 with open(file, encoding="utf-8-sig") as f:
79 old_content = f.read()
80 if new_content == old_content:
81 return
82
83 print(f"Adding notice to {file}")
84 with open(file, "w") as f:
85 f.write(new_content)
86
87
88ROOT = Path(os.path.realpath(__file__)).parent.parent

Callers 1

updateMethod · 0.95

Calls 4

copyright_noticeMethod · 0.95
joinMethod · 0.80
readMethod · 0.65
writeMethod · 0.45

Tested by

no test coverage detected