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

Function _get_template_line

pydevd_plugins/django_debug.py:369–385  ·  view source on GitHub ↗
(frame)

Source from the content-addressed store, hash-verified

367
368
369def _get_template_line(frame):
370 if IS_DJANGO19_OR_HIGHER:
371 node = frame.f_locals["self"]
372 if hasattr(node, "token") and hasattr(node.token, "lineno"):
373 return node.token.lineno
374 else:
375 return None
376
377 source = _get_source_django_18_or_lower(frame)
378 original_filename = _get_template_original_file_name_from_frame(frame)
379 if original_filename is not None:
380 try:
381 absolute_filename = absolute_path(original_filename)
382 return _offset_to_line_number(_read_file(absolute_filename), source[1][0])
383 except:
384 return None
385 return None
386
387
388class DjangoTemplateFrame(object):

Callers 2

__init__Method · 0.85
get_breakpointFunction · 0.85

Calls 5

absolute_pathFunction · 0.90
_offset_to_line_numberFunction · 0.85
_read_fileFunction · 0.85

Tested by

no test coverage detected