MCPcopy Create free account
hub / github.com/antirez/freakwan / quote

Method quote

telegram.py:208–209  ·  view source on GitHub ↗
(self,string)

Source from the content-addressed store, hash-verified

206 # MicroPython seems to lack the urlencode module. We need very
207 # little to kinda make it work.
208 def quote(self,string):
209 return ''.join(['%{:02X}'.format(c) if c < 33 or c > 126 or c in (37, 38, 43, 58, 61) else chr(c) for c in str(string).encode('utf-8')])
210
211 # Turn the GET/POST parameters in the 'fields' hash into a string
212 # in url encoded form a=1&b=2&... quoting just the value (the key

Callers 1

urlencodeMethod · 0.95

Calls 1

encodeMethod · 0.80

Tested by

no test coverage detected