From: Raymond Hettinger Date: Tue, 3 Jul 2012 00:17:16 +0000 (-0700) Subject: Use new-style string formatting for the HTML template X-Git-Tag: v3.3.0b2~332 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ecea0fb1739d4a85a235cee6013747742d9e9acb;p=thirdparty%2FPython%2Fcpython.git Use new-style string formatting for the HTML template --- diff --git a/Tools/scripts/pycolorize.py b/Tools/scripts/pycolorize.py index 3a9c95e275a8..7a177b925aa1 100755 --- a/Tools/scripts/pycolorize.py +++ b/Tools/scripts/pycolorize.py @@ -79,13 +79,13 @@ default_html = '''\ - %s + {title} -%s +{body} ''' @@ -95,7 +95,7 @@ def build_page(source, title='python', css=default_css, html=default_html): css_str = '\n'.join(['%s %s' % item for item in css.items()]) result = colorize(source) title = cgi.escape(title) - return html % (title, css_str, result) + return html.format(title=title, css=css_str, body=result) if __name__ == '__main__':