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

Method update

scripts/update_copyright.py:18–39  ·  view source on GitHub ↗
(self, files)

Source from the content-addressed store, hash-verified

16 self._prefix = prefix or []
17
18 def update(self, files):
19 for file in files:
20 with open(file, encoding="utf-8-sig") as f:
21 lines = f.readlines()
22
23 # An interpreter only honours `#!` on the first line, so the notice goes after it.
24 shebang = lines[:1] if lines and lines[0].startswith("#!") else []
25 lines = lines[len(shebang) :]
26
27 index = -1
28 for i, line in enumerate(lines):
29 if line.startswith(self._comment_characters) or self.valid_copyright_notice_line(line, index, file):
30 index += 1
31 else:
32 break
33
34 if index == -1:
35 self.write_update_notice(file, lines, shebang)
36 else:
37 current = "".join(lines[: index + 1])
38 if current != self.copyright_notice(file):
39 self.write_update_notice(file, lines[index + 1 :], shebang)
40
41 def valid_copyright_notice_line(self, line, index, file):
42 return index + 1 < len(self.copyright_notice_lines(file)) and line.startswith(

Callers 15

update_filesFunction · 0.95
set_window_rectMethod · 0.80
jquery.min.jsFile · 0.80
calculate_hashFunction · 0.80
update_moduleFunction · 0.80
sha256_of_urlFunction · 0.80
_requestMethod · 0.80
to_capabilitiesMethod · 0.80
_build_headersMethod · 0.80

Calls 3

write_update_noticeMethod · 0.95
copyright_noticeMethod · 0.95