def format_function_return(step): """Format a function return.""" name, srcloc = step['detail']['name'], step['detail']['location'] line = '<- {}'.format( markup_link.link_text_to_srcloc(name, srcloc, './trace/trace.html')) return line
def format_srcloc(srcloc, symbols): """Format a source location for a trace step.""" if srcloc is None: return 'Function none, File none, Line none' fyle, func, line = srcloc['file'], srcloc['function'], srcloc['line'] func_srcloc = symbols.lookup(func) # Warning: next line assumes trace root is subdirectory of code root from_file = os.path.join(TRACES, 'foo.html') # any name foo.html will do return 'Function {}, File {}, Line {}'.format( markup_link.link_text_to_srcloc(func, func_srcloc, from_file), markup_link.link_text_to_file(fyle, fyle, from_file), markup_link.link_text_to_line(line, fyle, line, from_file))