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

Function _offset_to_line_number

pydevd_plugins/django_debug.py:276–292  ·  view source on GitHub ↗
(text, offset)

Source from the content-addressed store, hash-verified

274
275
276def _offset_to_line_number(text, offset):
277 curLine = 1
278 curOffset = 0
279 while curOffset < offset:
280 if curOffset == len(text):
281 return -1
282 c = text[curOffset]
283 if c == "\n":
284 curLine += 1
285 elif c == "\r":
286 curLine += 1
287 if curOffset < len(text) and text[curOffset + 1] == "\n":
288 curOffset += 1
289
290 curOffset += 1
291
292 return curLine
293
294
295def _get_source_django_18_or_lower(frame):

Callers 1

_get_template_lineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected