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

Commit

Permalink
Run pyupgrade.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Jun 9, 2022
1 parent 1376781 commit ea7f603
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions contrib/graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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()
)

Expand Down
4 changes: 2 additions & 2 deletions contrib/graph/graph2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="<<b>%s</b>>" % (prev_id,))
end_node = pydot.Node(name=prev_id, label=f"<<b>{prev_id}</b>>")

node_map[prev_id] = end_node
graph.add_node(end_node)
Expand All @@ -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="<State Group: %s>" % (str(group),))
cluster = pydot.Cluster(str(group), label=f"<State Group: {str(group)}>")

for event_id in event_ids:
cluster.add_node(node_map[event_id])
Expand Down
2 changes: 1 addition & 1 deletion contrib/graph/graph3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="<<b>%s</b>>" % (prev_id,))
end_node = pydot.Node(name=prev_id, label=f"<<b>{prev_id}</b>>")

node_map[prev_id] = end_node
graph.add_node(end_node)
Expand Down

0 comments on commit ea7f603

Please sign in to comment.