MCPcopy Index your code
hub / github.com/RustPython/RustPython / lineinfo

Method lineinfo

Lib/pdb.py:722–753  ·  view source on GitHub ↗
(self, identifier)

Source from the content-addressed store, hash-verified

720 complete_tbreak = _complete_location
721
722 def lineinfo(self, identifier):
723 failed = (None, None, None)
724 # Input is identifier, may be in single quotes
725 idstring = identifier.split("'")
726 if len(idstring) == 1:
727 # not in single quotes
728 id = idstring[0].strip()
729 elif len(idstring) == 3:
730 # quoted
731 id = idstring[1].strip()
732 else:
733 return failed
734 if id == '': return failed
735 parts = id.split('.')
736 # Protection for derived debuggers
737 if parts[0] == 'self':
738 del parts[0]
739 if len(parts) == 0:
740 return failed
741 # Best first guess at file to look at
742 fname = self.defaultFile()
743 if len(parts) == 1:
744 item = parts[0]
745 else:
746 # More than one part.
747 # First is module, second is method/class
748 f = self.lookupmodule(parts[0])
749 if f:
750 fname = f
751 item = parts[1]
752 answer = find_function(item, fname)
753 return answer or failed
754
755 def checkline(self, filename, lineno):
756 """Check whether specified line seems to be executable.

Callers 1

do_breakMethod · 0.95

Calls 6

defaultFileMethod · 0.95
lookupmoduleMethod · 0.95
lenFunction · 0.85
find_functionFunction · 0.85
splitMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected