diff --git a/examples/example_django/example_django/asgi.py b/examples/example_django/example_django/asgi.py index 1a2020727..feac32c9f 100644 --- a/examples/example_django/example_django/asgi.py +++ b/examples/example_django/example_django/asgi.py @@ -17,4 +17,4 @@ os.system("/usr/bin/python3 /opt/code/manage.py migrate") -os.system("/usr/bin/python3 /opt/code/manage.py " "loaddata /opt/code/blog/fixtures/default_articles.json") +os.system("/usr/bin/python3 /opt/code/manage.py loaddata /opt/code/blog/fixtures/default_articles.json") diff --git a/packaging/version_from_git.py b/packaging/version_from_git.py index 327b2e2f4..10252dc2a 100755 --- a/packaging/version_from_git.py +++ b/packaging/version_from_git.py @@ -30,7 +30,7 @@ sys.exit(1) if not os.path.isfile(target_file_path): - print("No such file: '{}'".format(target_file_path)) + print(f"No such file: '{target_file_path}'") sys.exit(2) @@ -41,17 +41,17 @@ def get_git_version(): version = get_git_version() -with open(target_file_path, "r") as target_file: +with open(target_file_path) as target_file: target_content = target_file.read() if format_ == "deb": - updated_content = re.sub(r"(Version:)\w*(.*)", "\\1 {}".format(version), target_content) + updated_content = re.sub(r"(Version:)\w*(.*)", f"\\1 {version}", target_content) elif format_ == "setup.py": - updated_content = re.sub(r"(version)\w*=(.*)'", "\\1='{}'".format(version), target_content) + updated_content = re.sub(r"(version)\w*=(.*)'", f"\\1='{version}'", target_content) elif format_ == "__version__": - updated_content = re.sub(r"(__version__)\w*(.*)", "\\1 = '{}'".format(version), target_content) + updated_content = re.sub(r"(__version__)\w*(.*)", f"\\1 = '{version}'", target_content) else: - print("Format must be 'deb', 'setup.py' or '__version__', not '{}'".format(format_)) + print(f"Format must be 'deb', 'setup.py' or '__version__', not '{format_}'") if "--inplace" in args: with open(target_file_path, "w") as target_file: diff --git a/vm_connector/main.py b/vm_connector/main.py index 22a566f6b..86494dd53 100644 --- a/vm_connector/main.py +++ b/vm_connector/main.py @@ -26,9 +26,7 @@ def read_root(): async def get_latest_message_amend(ref: str, sender: str) -> Optional[dict]: async with aiohttp.ClientSession() as session: - url = ( - f"{settings.API_SERVER}/api/v0/messages.json?msgType=STORE&sort_order=-1" f"&refs={ref}&addresses={sender}" - ) + url = f"{settings.API_SERVER}/api/v0/messages.json?msgType=STORE&sort_order=-1&refs={ref}&addresses={sender}" resp = await session.get(url) resp.raise_for_status() resp_data = await resp.json()