MCPcopy Create free account
hub / github.com/ActiveState/code / escape

Method escape

recipes/Python/578138_gprof2dotpy/recipe-578138.py:2733–2739  ·  view source on GitHub ↗
(self, s)

Source from the content-addressed store, hash-verified

2731 return "#" + "".join(["%02x" % float2int(c) for c in (r, g, b)])
2732
2733 def escape(self, s):
2734 #s = s.encode('utf-8')
2735 s = s.replace('\\', r'\\')
2736 s = s.replace('\n', r'\n')
2737 s = s.replace('\t', r'\t')
2738 s = s.replace('"', r'\"')
2739 return '"' + s + '"'
2740
2741 def write(self, s):
2742 self.fp.write(s)

Callers 15

idMethod · 0.95
convert_templateFunction · 0.45
safehtmlFunction · 0.45
do_subFunction · 0.45
getTagPathMethod · 0.45
ireplaceMethod · 0.45
run_pyMethod · 0.45
run_tplMethod · 0.45
html_highlightFunction · 0.45
build_html_pageFunction · 0.45
__init__Method · 0.45
startElementMethod · 0.45

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected