Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit b0d9cd6

Browse files
committed
Run pyupgrade.
1 parent e13d18d commit b0d9cd6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

contrib/graph/graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
def make_name(pdu_id: str, origin: str) -> str:
26-
return "%s@%s" % (pdu_id, origin)
26+
return f"{pdu_id}@{origin}"
2727

2828

2929
def make_graph(pdus: List[dict], filename_prefix: str) -> None:
@@ -119,7 +119,7 @@ def make_graph(pdus: List[dict], filename_prefix: str) -> None:
119119
def get_pdus(host: str, room: str) -> List[dict]:
120120
transaction = json.loads(
121121
urllib.request.urlopen(
122-
"http://%s/_matrix/federation/v1/context/%s/" % (host, room)
122+
f"http://{host}/_matrix/federation/v1/context/{room}/"
123123
).read()
124124
)
125125

contrib/graph/graph2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def make_graph(db_name: str, room_id: str, file_prefix: str, limit: int) -> None
112112
try:
113113
end_node = node_map[prev_id]
114114
except Exception:
115-
end_node = pydot.Node(name=prev_id, label="<<b>%s</b>>" % (prev_id,))
115+
end_node = pydot.Node(name=prev_id, label=f"<<b>{prev_id}</b>>")
116116

117117
node_map[prev_id] = end_node
118118
graph.add_node(end_node)
@@ -124,7 +124,7 @@ def make_graph(db_name: str, room_id: str, file_prefix: str, limit: int) -> None
124124
if len(event_ids) <= 1:
125125
continue
126126

127-
cluster = pydot.Cluster(str(group), label="<State Group: %s>" % (str(group),))
127+
cluster = pydot.Cluster(str(group), label=f"<State Group: {str(group)}>")
128128

129129
for event_id in event_ids:
130130
cluster.add_node(node_map[event_id])

contrib/graph/graph3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def make_graph(file_name: str, file_prefix: str, limit: int) -> None:
115115
try:
116116
end_node = node_map[prev_id]
117117
except Exception:
118-
end_node = pydot.Node(name=prev_id, label="<<b>%s</b>>" % (prev_id,))
118+
end_node = pydot.Node(name=prev_id, label=f"<<b>{prev_id}</b>>")
119119

120120
node_map[prev_id] = end_node
121121
graph.add_node(end_node)

0 commit comments

Comments
 (0)