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

Function generate_init

py/generate.py:940–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

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