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

Method set_source_mapping

_pydevd_bundle/pydevd_api.py:999–1021  ·  view source on GitHub ↗

:param str source_filename: The filename for the source mapping (bytes on py2 and str on py3). This filename will be made absolute in this function. :param list(SourceMappingEntry) mapping: A list with the source mapping entries to be applied to

(self, py_db, source_filename, mapping)

Source from the content-addressed store, hash-verified

997 SourceMappingEntry = pydevd_source_mapping.SourceMappingEntry
998
999 def set_source_mapping(self, py_db, source_filename, mapping):
1000 """
1001 :param str source_filename:
1002 The filename for the source mapping (bytes on py2 and str on py3).
1003 This filename will be made absolute in this function.
1004
1005 :param list(SourceMappingEntry) mapping:
1006 A list with the source mapping entries to be applied to the given filename.
1007
1008 :return str:
1009 An error message if it was not possible to set the mapping or an empty string if
1010 everything is ok.
1011 """
1012 source_filename = self.filename_to_server(source_filename)
1013 absolute_source_filename = pydevd_file_utils.absolute_path(source_filename)
1014 for map_entry in mapping:
1015 map_entry.source_filename = absolute_source_filename
1016 error_msg = py_db.source_mapping.set_source_mapping(absolute_source_filename, mapping)
1017 if error_msg:
1018 return error_msg
1019
1020 self.reapply_breakpoints(py_db)
1021 return ""
1022
1023 def set_variable_presentation(self, py_db, variable_presentation):
1024 assert isinstance(variable_presentation, self.VariablePresentation)

Callers 2

test_source_mappingFunction · 0.95

Calls 2

filename_to_serverMethod · 0.95
reapply_breakpointsMethod · 0.95

Tested by 1

test_source_mappingFunction · 0.76