MCPcopy Index your code
hub / github.com/microsoft/playwright-python / main

Function main

scripts/update_versions.py:20–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18
19
20def main() -> None:
21 with sync_playwright() as p:
22 readme = Path("README.md").resolve()
23 text = readme.read_text(encoding="utf-8")
24 for browser_type in [p.chromium, p.firefox, p.webkit]:
25 rx = re.compile(
26 r"<!-- GEN:"
27 + browser_type.name
28 + r"-version -->([^<]+)<!-- GEN:stop -->"
29 )
30 browser = browser_type.launch()
31 text = rx.sub(
32 f"<!-- GEN:{browser_type.name}-version -->{browser.version}<!-- GEN:stop -->",
33 text,
34 )
35 browser.close()
36 readme.write_text(text, encoding="utf-8")
37
38
39if __name__ == "__main__":

Callers 1

update_versions.pyFile · 0.70

Calls 3

sync_playwrightFunction · 0.90
launchMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected