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

Class DjangoTemplateFrame

pydevd_plugins/django_debug.py:388–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386
387
388class DjangoTemplateFrame(object):
389 IS_PLUGIN_FRAME = True
390
391 def __init__(self, frame):
392 original_filename = _get_template_original_file_name_from_frame(frame)
393 self._back_context = frame.f_locals["context"]
394 self.f_code = FCode("Django Template", original_filename)
395 self.f_lineno = _get_template_line(frame)
396 self.f_back = frame
397 self.f_globals = {}
398 self.f_locals = self._collect_context(self._back_context)
399 self.f_trace = None
400
401 def _collect_context(self, context):
402 res = {}
403 try:
404 for d in context.dicts:
405 for k, v in d.items():
406 res[k] = v
407 except AttributeError:
408 pass
409 return res
410
411 def _change_variable(self, name, value):
412 for d in self._back_context.dicts:
413 for k, v in d.items():
414 if k == name:
415 d[k] = value
416
417
418class DjangoTemplateSyntaxErrorFrame(object):

Callers 4

stopFunction · 0.85
get_breakpointFunction · 0.85
suspendFunction · 0.85
exception_breakFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected