Mercurial > cpython-lru_cache-weakref
diff Tools/scripts/parseentities.py @ 76106:62dde5dd475e 3.2
#14490, #14491: add 'sundry'-style import tests for Tools/scripts.
This patch changes a few of the scripts to have __name__=='__main__'
clauses so that they are importable without running. Also fixes the
syntax errors revealed by the tests.
| author | R David Murray <rdmurray@bitdance.com> |
|---|---|
| date | Wed, 04 Apr 2012 21:28:14 -0400 |
| parents | fcfe324663a6 |
| children |
line wrap: on
line diff
--- a/Tools/scripts/parseentities.py Wed Apr 04 20:17:06 2012 +0200 +++ b/Tools/scripts/parseentities.py Wed Apr 04 21:28:14 2012 -0400 @@ -13,7 +13,6 @@ """ import re,sys -import TextTools entityRE = re.compile('<!ENTITY +(\w+) +CDATA +"([^"]+)" +-- +((?:.|\n)+?) *-->') @@ -45,7 +44,7 @@ charcode = repr(charcode) else: charcode = repr(charcode) - comment = TextTools.collapse(comment) + comment = ' '.join(comment.split()) f.write(" '%s':\t%s, \t# %s\n" % (name,charcode,comment)) f.write('\n}\n')
