mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
python: Convert more "".format to Python 3.6 f-strings.
Generated by pyupgrade --py36-plus --keep-percent-format. Now including %d, %i, %u, and multi-line strings. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
4aeb02f73d
commit
57a80856a5
@@ -118,7 +118,7 @@ def set_user_data(username: str, userkey_dicts: List[Dict[str, Any]]) -> str:
|
||||
server_repo_setup = setup_repo.format(username, "zulip")
|
||||
python_api_repo_setup = setup_repo.format(username, "python-zulip-api")
|
||||
|
||||
cloudconf = """\
|
||||
cloudconf = f"""\
|
||||
#!/bin/bash
|
||||
|
||||
{setup_zulipdev_ssh_keys}
|
||||
@@ -130,10 +130,7 @@ su -c '{server_repo_setup}' zulipdev
|
||||
su -c '{python_api_repo_setup}' zulipdev
|
||||
su -c 'git config --global core.editor nano' zulipdev
|
||||
su -c 'git config --global pull.rebase true' zulipdev
|
||||
""".format(setup_root_ssh_keys=setup_root_ssh_keys,
|
||||
setup_zulipdev_ssh_keys=setup_zulipdev_ssh_keys,
|
||||
hostname_setup=hostname_setup,
|
||||
server_repo_setup=server_repo_setup, python_api_repo_setup=python_api_repo_setup)
|
||||
"""
|
||||
print("...returning cloud-config data.")
|
||||
return cloudconf
|
||||
|
||||
|
||||
@@ -181,9 +181,9 @@ def build_id_dict(templates: List[str]) -> (Dict[str, List[str]]):
|
||||
try:
|
||||
list_tags = tokenize(text)
|
||||
except FormattedException as e:
|
||||
raise Exception('''
|
||||
fn: {}
|
||||
{}'''.format(fn, e))
|
||||
raise Exception(f'''
|
||||
fn: {fn}
|
||||
{e}''')
|
||||
|
||||
for tag in list_tags:
|
||||
info = get_tag_info(tag)
|
||||
|
||||
@@ -213,9 +213,9 @@ def validate(fn: Optional[str] = None, text: Optional[str] = None, check_indent:
|
||||
try:
|
||||
tokens = tokenize(text)
|
||||
except FormattedException as e:
|
||||
raise TemplateParserException('''
|
||||
fn: {}
|
||||
{}'''.format(fn, e))
|
||||
raise TemplateParserException(f'''
|
||||
fn: {fn}
|
||||
{e}''')
|
||||
|
||||
class State:
|
||||
def __init__(self, func: Callable[[Token], None]) -> None:
|
||||
|
||||
Reference in New Issue
Block a user