From ea7f6036baa66dae2d46e178f5de0f7c8be699ce Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Thu, 9 Jun 2022 12:01:17 -0400 Subject: [PATCH] Run pyupgrade. --- contrib/graph/graph.py | 4 ++-- contrib/graph/graph2.py | 4 ++-- contrib/graph/graph3.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/graph/graph.py b/contrib/graph/graph.py index 3887eb89d5e7..3c4f47dbd25e 100644 --- a/contrib/graph/graph.py +++ b/contrib/graph/graph.py @@ -23,7 +23,7 @@ def make_name(pdu_id: str, origin: str) -> str: - return "%s@%s" % (pdu_id, origin) + return f"{pdu_id}@{origin}" def make_graph(pdus: List[dict], filename_prefix: str) -> None: @@ -119,7 +119,7 @@ def make_graph(pdus: List[dict], filename_prefix: str) -> None: def get_pdus(host: str, room: str) -> List[dict]: transaction = json.loads( urllib.request.urlopen( - "http://%s/_matrix/federation/v1/context/%s/" % (host, room) + f"http://{host}/_matrix/federation/v1/context/{room}/" ).read() ) diff --git a/contrib/graph/graph2.py b/contrib/graph/graph2.py index 7ca8a787ba79..57a4fa5e3716 100644 --- a/contrib/graph/graph2.py +++ b/contrib/graph/graph2.py @@ -112,7 +112,7 @@ def make_graph(db_name: str, room_id: str, file_prefix: str, limit: int) -> None try: end_node = node_map[prev_id] except Exception: - end_node = pydot.Node(name=prev_id, label="<%s>" % (prev_id,)) + end_node = pydot.Node(name=prev_id, label=f"<{prev_id}>") node_map[prev_id] = end_node graph.add_node(end_node) @@ -124,7 +124,7 @@ def make_graph(db_name: str, room_id: str, file_prefix: str, limit: int) -> None if len(event_ids) <= 1: continue - cluster = pydot.Cluster(str(group), label="" % (str(group),)) + cluster = pydot.Cluster(str(group), label=f"") for event_id in event_ids: cluster.add_node(node_map[event_id]) diff --git a/contrib/graph/graph3.py b/contrib/graph/graph3.py index 7fddba7fd695..a28a1594c7fe 100644 --- a/contrib/graph/graph3.py +++ b/contrib/graph/graph3.py @@ -115,7 +115,7 @@ def make_graph(file_name: str, file_prefix: str, limit: int) -> None: try: end_node = node_map[prev_id] except Exception: - end_node = pydot.Node(name=prev_id, label="<%s>" % (prev_id,)) + end_node = pydot.Node(name=prev_id, label=f"<{prev_id}>") node_map[prev_id] = end_node graph.add_node(end_node)