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

Function get_breakpoint

pydevd_plugins/django_debug.py:536–565  ·  view source on GitHub ↗
(py_db, frame, event, info)

Source from the content-addressed store, hash-verified

534
535
536def get_breakpoint(py_db, frame, event, info):
537 breakpoint_type = "django"
538
539 if event == "call" and info.pydev_state != STATE_SUSPEND and py_db.django_breakpoints and _is_django_render_call(frame):
540 original_filename = _get_template_original_file_name_from_frame(frame)
541 pydev_log.debug("Django is rendering a template: %s", original_filename)
542
543 canonical_normalized_filename = canonical_normalized_path(original_filename)
544 django_breakpoints_for_file = py_db.django_breakpoints.get(canonical_normalized_filename)
545
546 if django_breakpoints_for_file:
547 # At this point, let's validate whether template lines are correct.
548 if IS_DJANGO19_OR_HIGHER:
549 django_validation_info = py_db.django_validation_info
550 context = frame.f_locals["context"]
551 django_template = context.template
552 django_validation_info.verify_breakpoints(
553 py_db, canonical_normalized_filename, django_breakpoints_for_file, django_template
554 )
555
556 pydev_log.debug("Breakpoints for that file: %s", django_breakpoints_for_file)
557 template_line = _get_template_line(frame)
558 pydev_log.debug("Tracing template line: %s", template_line)
559
560 if template_line in django_breakpoints_for_file:
561 django_breakpoint = django_breakpoints_for_file[template_line]
562 new_frame = DjangoTemplateFrame(frame)
563 return django_breakpoint, new_frame, breakpoint_type
564
565 return None
566
567
568def suspend(py_db, thread, frame, bp_type):

Callers

nothing calls this directly

Calls 7

_is_django_render_callFunction · 0.85
_get_template_lineFunction · 0.85
DjangoTemplateFrameClass · 0.85
verify_breakpointsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected