mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-13 06:32:16 -04:00
Update black, and run auto formatting over the codebase (#9381)
- Update black version to the latest
- Run black auto formatting over the codebase
- Run autoformatting according to [`docs/code_style.md
`](80d6dc9783/docs/code_style.md
)
- Update `code_style.md` docs around installing black to use the correct version
This commit is contained in:
parent
5636e597c3
commit
0a00b7ff14
271 changed files with 2802 additions and 1713 deletions
|
@ -193,8 +193,7 @@ class RoomWorkerStore(SQLBaseStore):
|
|||
)
|
||||
|
||||
async def get_room_count(self) -> int:
|
||||
"""Retrieve the total number of rooms.
|
||||
"""
|
||||
"""Retrieve the total number of rooms."""
|
||||
|
||||
def f(txn):
|
||||
sql = "SELECT count(*) FROM rooms"
|
||||
|
@ -517,7 +516,8 @@ class RoomWorkerStore(SQLBaseStore):
|
|||
return rooms, room_count[0]
|
||||
|
||||
return await self.db_pool.runInteraction(
|
||||
"get_rooms_paginate", _get_rooms_paginate_txn,
|
||||
"get_rooms_paginate",
|
||||
_get_rooms_paginate_txn,
|
||||
)
|
||||
|
||||
@cached(max_entries=10000)
|
||||
|
@ -578,7 +578,8 @@ class RoomWorkerStore(SQLBaseStore):
|
|||
return self.db_pool.cursor_to_dict(txn)
|
||||
|
||||
ret = await self.db_pool.runInteraction(
|
||||
"get_retention_policy_for_room", get_retention_policy_for_room_txn,
|
||||
"get_retention_policy_for_room",
|
||||
get_retention_policy_for_room_txn,
|
||||
)
|
||||
|
||||
# If we don't know this room ID, ret will be None, in this case return the default
|
||||
|
@ -707,7 +708,10 @@ class RoomWorkerStore(SQLBaseStore):
|
|||
return local_media_mxcs, remote_media_mxcs
|
||||
|
||||
async def quarantine_media_by_id(
|
||||
self, server_name: str, media_id: str, quarantined_by: str,
|
||||
self,
|
||||
server_name: str,
|
||||
media_id: str,
|
||||
quarantined_by: str,
|
||||
) -> int:
|
||||
"""quarantines a single local or remote media id
|
||||
|
||||
|
@ -961,7 +965,8 @@ class RoomBackgroundUpdateStore(SQLBaseStore):
|
|||
self.config = hs.config
|
||||
|
||||
self.db_pool.updates.register_background_update_handler(
|
||||
"insert_room_retention", self._background_insert_retention,
|
||||
"insert_room_retention",
|
||||
self._background_insert_retention,
|
||||
)
|
||||
|
||||
self.db_pool.updates.register_background_update_handler(
|
||||
|
@ -1033,7 +1038,8 @@ class RoomBackgroundUpdateStore(SQLBaseStore):
|
|||
return False
|
||||
|
||||
end = await self.db_pool.runInteraction(
|
||||
"insert_room_retention", _background_insert_retention_txn,
|
||||
"insert_room_retention",
|
||||
_background_insert_retention_txn,
|
||||
)
|
||||
|
||||
if end:
|
||||
|
@ -1588,7 +1594,8 @@ class RoomStore(RoomBackgroundUpdateStore, RoomWorkerStore, SearchStore):
|
|||
LIMIT ?
|
||||
OFFSET ?
|
||||
""".format(
|
||||
where_clause=where_clause, order=order,
|
||||
where_clause=where_clause,
|
||||
order=order,
|
||||
)
|
||||
|
||||
args += [limit, start]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue