MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / from_json

Function from_json

_pydevd_bundle/_debug_adapter/pydevd_base_schema.py:112–126  ·  view source on GitHub ↗
(json_msg, update_ids_from_dap=False, on_dict_loaded=lambda dct: None)

Source from the content-addressed store, hash-verified

110
111
112def from_json(json_msg, update_ids_from_dap=False, on_dict_loaded=lambda dct: None):
113 if isinstance(json_msg, bytes):
114 json_msg = json_msg.decode("utf-8")
115
116 as_dict = json.loads(json_msg)
117 on_dict_loaded(as_dict)
118 try:
119 return from_dict(as_dict, update_ids_from_dap=update_ids_from_dap)
120 except:
121 if as_dict.get("type") == "response" and not as_dict.get("success"):
122 # Error messages may not have required body (return as a generic Response).
123 Response = _all_messages["Response"]
124 return Response(**as_dict)
125 else:
126 raise
127
128
129def get_response_class(request):

Callers 2

accept_json_messageMethod · 0.90
wait_for_json_messageMethod · 0.90

Calls 5

from_dictFunction · 0.85
ResponseClass · 0.85
loadsMethod · 0.80
decodeMethod · 0.45
getMethod · 0.45

Tested by 2

accept_json_messageMethod · 0.72
wait_for_json_messageMethod · 0.72