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

Function build_module

py/generate_bidi_protocol.py:838–855  ·  view source on GitHub ↗
(schema: Schema, domain: str)

Source from the content-addressed store, hash-verified

836
837
838def build_module(schema: Schema, domain: str) -> ModuleIR:
839 schema._pending_refs = set()
840 records, unions = schema.types_for(domain)
841 commands = [build_command(schema, c) for c in schema.commands_for(domain)]
842 events = [build_event(schema, e) for e in schema.events_for(domain)]
843 imports = _cross_domain_imports(schema, domain)
844 return ModuleIR(
845 domain=domain,
846 class_name=snake_to_class(camel_to_snake(domain)),
847 filename=camel_to_snake(domain),
848 enums=schema.enums_for(domain),
849 records=records,
850 unions=unions,
851 commands=commands,
852 events=events,
853 imports=imports,
854 spec_href=schema._domain_links.get(domain, {}).get("specHref"),
855 )
856
857
858def _cross_domain_imports(schema: Schema, domain: str) -> dict[str, set[str]]:

Callers 1

render_allFunction · 0.85

Calls 11

build_commandFunction · 0.85
build_eventFunction · 0.85
_cross_domain_importsFunction · 0.85
ModuleIRClass · 0.85
snake_to_classFunction · 0.85
camel_to_snakeFunction · 0.85
getMethod · 0.65
types_forMethod · 0.45
commands_forMethod · 0.45
events_forMethod · 0.45
enums_forMethod · 0.45

Tested by

no test coverage detected