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

@@ -57,7 +57,7 @@ class Command(compilemessages.Command):
return po_template.format(locale_path, locale)
def get_json_filename(self, locale_path: str, locale: str) -> str:
return "{}/{}/translations.json".format(locale_path, locale)
return f"{locale_path}/{locale}/translations.json"
def get_name_from_po_file(self, po_filename: str, locale: str) -> str:
lang_name_re = re.compile(r'"Language-Team: (.*?) \(')
@@ -67,7 +67,7 @@ class Command(compilemessages.Command):
try:
return result.group(1)
except Exception:
print("Problem in parsing {}".format(po_filename))
print(f"Problem in parsing {po_filename}")
raise
else:
raise Exception("Unknown language %s" % (locale,))
@@ -85,8 +85,8 @@ class Command(compilemessages.Command):
return locales
def extract_language_options(self) -> None:
locale_path = "{}/locale".format(settings.DEPLOY_ROOT)
output_path = "{}/language_options.json".format(locale_path)
locale_path = f"{settings.DEPLOY_ROOT}/locale"
output_path = f"{locale_path}/language_options.json"
data: Dict[str, List[Dict[str, Any]]] = {'languages': []}