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

Method from_json

py/generate.py:796–811  ·  view source on GitHub ↗

Instantiate a CDP domain from a JSON object.

(cls, domain: dict)

Source from the content-addressed store, hash-verified

794
795 @classmethod
796 def from_json(cls, domain: dict):
797 """Instantiate a CDP domain from a JSON object."""
798 types = domain.get("types", [])
799 commands = domain.get("commands", [])
800 events = domain.get("events", [])
801 domain_name = domain["domain"]
802
803 return cls(
804 domain_name,
805 domain.get("description"),
806 domain.get("experimental", False),
807 domain.get("dependencies", []),
808 [CdpType.from_json(type) for type in types],
809 [CdpCommand.from_json(command, domain_name) for command in commands],
810 [CdpEvent.from_json(event, domain_name) for event in events],
811 )
812
813 def generate_code(self):
814 """Generate the Python module code for a given CDP domain."""

Callers

nothing calls this directly

Calls 2

getMethod · 0.65
from_jsonMethod · 0.45

Tested by

no test coverage detected