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

Method from_json

py/generate.py:797–812  ·  view source on GitHub ↗

Instantiate a CDP domain from a JSON object.

(cls, domain: dict)

Source from the content-addressed store, hash-verified

795
796 @classmethod
797 def from_json(cls, domain: dict):
798 """Instantiate a CDP domain from a JSON object."""
799 types = domain.get("types", [])
800 commands = domain.get("commands", [])
801 events = domain.get("events", [])
802 domain_name = domain["domain"]
803
804 return cls(
805 domain_name,
806 domain.get("description"),
807 domain.get("experimental", False),
808 domain.get("dependencies", []),
809 [CdpType.from_json(type) for type in types],
810 [CdpCommand.from_json(command, domain_name) for command in commands],
811 [CdpEvent.from_json(event, domain_name) for event in events],
812 )
813
814 def generate_code(self):
815 """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