MCPcopy Index your code
hub / github.com/ronreiter/interactive-tutorials / encode

Method encode

suds/sax/enc.py:65–76  ·  view source on GitHub ↗

Encode special characters found in string I{s}. @param s: A string to encode. @type s: str @return: The encoded string. @rtype: str

(self, s)

Source from the content-addressed store, hash-verified

63 return False
64
65 def encode(self, s):
66 """
67 Encode special characters found in string I{s}.
68 @param s: A string to encode.
69 @type s: str
70 @return: The encoded string.
71 @rtype: str
72 """
73 if isinstance(s, str) and self.needsEncoding(s):
74 for x in self.encodings:
75 s = re.sub(x[0], x[1], s)
76 return s
77
78 def decode(self, s):
79 """

Callers 15

convertFileMethod · 0.45
_encodeFunction · 0.45
_escape_cdataFunction · 0.45
_escape_attribFunction · 0.45
_escape_attrib_htmlFunction · 0.45
_serialize_htmlFunction · 0.45
encodeFunction · 0.45
slugifyMethod · 0.45
prism.jsFile · 0.45
mangleMethod · 0.45
__init__Method · 0.45
setlocationMethod · 0.45

Calls 1

needsEncodingMethod · 0.95

Tested by

no test coverage detected