MCPcopy Create free account
hub / github.com/OpenCCU/OpenCCU / escape

Function escape

buildroot-external/scripts/kconfiglib.py:6217–6224  ·  view source on GitHub ↗

r""" Escapes the string 's' in the same fashion as is done for display in Kconfig format and when writing strings to a .config file. " and \ are replaced by \" and \\, respectively.

(s)

Source from the content-addressed store, hash-verified

6215
6216
6217def escape(s):
6218 r"""
6219 Escapes the string 's' in the same fashion as is done for display in
6220 Kconfig format and when writing strings to a .config file. " and \ are
6221 replaced by \" and \\, respectively.
6222 """
6223 # \ must be escaped before " to avoid double escaping
6224 return s.replace("\\", r"\\").replace('"', r'\"')
6225
6226
6227def unescape(s):

Callers 15

webui.jsFile · 0.85
webui.jsFile · 0.85
webui.jsFile · 0.85
webui.jsFile · 0.85
webui.jsFile · 0.85
webui.jsFile · 0.85
webui.jsFile · 0.85
webui.jsFile · 0.85
webui.jsFile · 0.85
webui.jsFile · 0.85
webui.jsFile · 0.85
webui.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected