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

Function generate_init

py/generate.py:939–950  ·  view source on GitHub ↗

Generate an `__init__.py` that exports the specified modules. :param Path init_path: a file path to create the init file in :param list[tuple] modules: a list of modules each represented as tuples of (name, list_of_exported_symbols)

(init_path, domains)

Source from the content-addressed store, hash-verified

937
938
939def generate_init(init_path, domains):
940 """Generate an `__init__.py` that exports the specified modules.
941
942 :param Path init_path: a file path to create the init file in
943 :param list[tuple] modules: a list of modules each represented as tuples
944 of (name, list_of_exported_symbols)
945 """
946 with open(init_path, "w", encoding="utf-8") as init_file:
947 init_file.write(INIT_HEADER)
948 for domain in domains:
949 init_file.write(f"from . import {domain.module}\n")
950 init_file.write("from . import util\n\n")
951
952
953def generate_docs(docs_path, domains):

Callers 1

mainFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected