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

Method needsEncoding

suds/sax/enc.py:51–63  ·  view source on GitHub ↗

Get whether string I{s} contains special characters. @param s: A string to check. @type s: str @return: True if needs encoding. @rtype: boolean

(self, s)

Source from the content-addressed store, hash-verified

49 special = ('&', '<', '>', '"', "'")
50
51 def needsEncoding(self, s):
52 """
53 Get whether string I{s} contains special characters.
54 @param s: A string to check.
55 @type s: str
56 @return: True if needs encoding.
57 @rtype: boolean
58 """
59 if isinstance(s, str):
60 for c in self.special:
61 if c in s:
62 return True
63 return False
64
65 def encode(self, s):
66 """

Callers 1

encodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected