python: Convert "".format to Python 3.6 f-strings.

Generated by pyupgrade --py36-plus --keep-percent-format, but with the
NamedTuple changes reverted (see commit
ba7906a3c6, #15132).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-06-08 15:25:09 -07:00
parent 8c15081069
commit 8dd83228e7
146 changed files with 596 additions and 596 deletions

View File

@@ -91,7 +91,7 @@ def main() -> None:
with open(success_stamp, 'w') as f:
f.close()
print("build_emoji: Using cached emojis from {}".format(source_emoji_dump))
print(f"build_emoji: Using cached emojis from {source_emoji_dump}")
if os.path.lexists(TARGET_EMOJI_DUMP):
os.remove(TARGET_EMOJI_DUMP)
os.symlink(source_emoji_dump, TARGET_EMOJI_DUMP)
@@ -300,13 +300,13 @@ def setup_old_emoji_farm(cache_path: str,
for name, codepoint in emoji_map.items():
mapped_codepoint = REMAPPED_EMOJIS.get(codepoint, codepoint)
image_file_path = os.path.join(google_emoji_cache_path, '{}.png'.format(mapped_codepoint))
symlink_path = os.path.join(emoji_cache_path, '{}.png'.format(name))
image_file_path = os.path.join(google_emoji_cache_path, f'{mapped_codepoint}.png')
symlink_path = os.path.join(emoji_cache_path, f'{name}.png')
os.symlink(image_file_path, symlink_path)
try:
# `emoji_map` contains duplicate entries for the same codepoint with different
# names. So creation of symlink for <codepoint>.png may throw `FileExistsError`.
unicode_symlink_path = os.path.join(unicode_emoji_cache_path, '{}.png'.format(codepoint))
unicode_symlink_path = os.path.join(unicode_emoji_cache_path, f'{codepoint}.png')
os.symlink(image_file_path, unicode_symlink_path)
except FileExistsError:
pass