python: Convert percent formatting to Python 3.6 f-strings.

Generated by pyupgrade --py36-plus.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-06-09 21:41:04 -07:00
committed by Tim Abbott
parent 6480deaf27
commit 67e7a3631d
217 changed files with 776 additions and 846 deletions

View File

@@ -65,11 +65,11 @@ def create_single_page(pattern: str, out_dir: str, href: str, calls: List[Call])
}
</style>
''')
f.write('<h3>%s</h3>\n' % (html.escape(pattern),))
f.write(f'<h3>{html.escape(pattern)}</h3>\n')
calls.sort(key=lambda call: call['status_code'])
for call in calls:
f.write('<hr>')
f.write('\n%s' % (fix_test_name(call['test_name']),))
f.write('\n{}'.format(fix_test_name(call['test_name'])))
f.write('<div class="test">')
try:
f.write(call['url'])
@@ -77,7 +77,7 @@ def create_single_page(pattern: str, out_dir: str, href: str, calls: List[Call])
f.write(call['url'].encode('utf8'))
f.write('<br>\n')
f.write(call['method'] + '<br>\n')
f.write('status code: %s<br>\n' % (call['status_code'],))
f.write('status code: {}<br>\n'.format(call['status_code']))
f.write('<br>')
f.write('</div>')
@@ -136,13 +136,13 @@ def create_user_docs() -> None:
f.write('<ul>\n')
for pattern in sorted(groups[name]):
href = pattern.replace('/', '-') + '.html'
link = '<a href="%s">%s</a>' % (href, html.escape(pattern))
link = f'<a href="{href}">{html.escape(pattern)}</a>'
f.write('<li>' + link + '</li>\n')
create_single_page(pattern, out_dir, href, pattern_dict[pattern])
f.write('</ul>')
f.write('\n')
print('open %s' % (main_page,))
print(f'open {main_page}')
if __name__ == '__main__':