Mercurial > repos > fubar > tool_factory_2
changeset 8:9d58cc32a12d draft
Uploaded
author | fubar |
---|---|
date | Mon, 12 Jan 2015 05:27:52 -0500 |
parents | 61381bad936d |
children | ce5ec1d989fd |
files | rgToolFactory2.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/rgToolFactory2.py Mon Jan 12 05:01:29 2015 -0500 +++ b/rgToolFactory2.py Mon Jan 12 05:27:52 2015 -0500 @@ -145,7 +145,7 @@ "<": "<", "$": "\$" } -html_unescape_table = dict(zip(html_escape_table.values(),html_escape_table.keys())) + def html_escape(text): """Produce entities within text.""" return "".join(html_escape_table.get(c,c) for c in text) @@ -153,7 +153,8 @@ def html_unescape(text): """Revert entities within text.""" - return "".join(html_unescape_table.get(c,c) for c in text) + t = text.replace('&','&').replace('>','>').replace('<','<').replace('\$','$') + return t def cmd_exists(cmd): return subprocess.call("type " + cmd, shell=True,