html: Use translate function from MicroPython string module.

pull/26/head
Paul Sokolovsky 2015-05-18 00:53:01 +03:00
rodzic d8239aa6da
commit c8022030e4
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -16,6 +16,7 @@ def escape(s, quote=True):
characters, both double quote (") and single quote (') characters are also
translated.
"""
import string
if quote:
return s.translate(_escape_map_full)
return s.translate(_escape_map)
return string.translate(s, _escape_map_full)
return string.translate(s, _escape_map)