MCPcopy Index your code
hub / github.com/fabioz/PyDev.Debugger / get_breakpoint

Function get_breakpoint

pydevd_plugins/jinja2_debug.py:463–488  ·  view source on GitHub ↗
(py_db, frame, event, info)

Source from the content-addressed store, hash-verified

461
462
463def get_breakpoint(py_db, frame, event, info):
464 break_type = "jinja2"
465
466 if event == "line" and info.pydev_state != STATE_SUSPEND and py_db.jinja2_breakpoints and _is_jinja2_render_call(frame):
467 jinja_template = frame.f_globals.get("__jinja_template__")
468 if jinja_template is None:
469 return None
470
471 original_filename = _get_jinja2_template_original_filename(frame)
472 if original_filename is not None:
473 pydev_log.debug("Jinja2 is rendering a template: %s", original_filename)
474 canonical_normalized_filename = canonical_normalized_path(original_filename)
475 jinja2_breakpoints_for_file = py_db.jinja2_breakpoints.get(canonical_normalized_filename)
476
477 if jinja2_breakpoints_for_file:
478 jinja2_validation_info = py_db.jinja2_validation_info
479 jinja2_validation_info.verify_breakpoints(py_db, canonical_normalized_filename, jinja2_breakpoints_for_file, jinja_template)
480
481 template_lineno = _get_jinja2_template_line(frame)
482 if template_lineno is not None:
483 jinja2_breakpoint = jinja2_breakpoints_for_file.get(template_lineno)
484 if jinja2_breakpoint is not None:
485 new_frame = Jinja2TemplateFrame(frame, original_filename, template_lineno)
486 return jinja2_breakpoint, new_frame, break_type
487
488 return None
489
490
491def suspend(pydb, thread, frame, bp_type):

Callers

nothing calls this directly

Calls 7

_is_jinja2_render_callFunction · 0.85
Jinja2TemplateFrameClass · 0.85
verify_breakpointsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected