summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorAmber H. Brown <hawkowl@atleastfornow.net>2019-07-05 22:44:22 +1000
committerAmber H. Brown <hawkowl@atleastfornow.net>2019-07-05 22:44:22 +1000
commit400bc061caaab8a41f5186b060c68fece544ce2c (patch)
treeef171d6b8b833a2227e8476b84058fc839f3f508 /synapse
parentMerge tag 'v1.1.0' into shhs (diff)
downloadsynapse-400bc061caaab8a41f5186b060c68fece544ce2c.tar.xz
linting
Diffstat (limited to 'synapse')
-rw-r--r--synapse/config/repository.py8
-rw-r--r--synapse/federation/federation_client.py10
-rw-r--r--synapse/federation/transport/client.py9
-rw-r--r--synapse/handlers/room_member.py19
-rw-r--r--synapse/storage/events_worker.py4
5 files changed, 24 insertions, 26 deletions
diff --git a/synapse/config/repository.py b/synapse/config/repository.py
index feff90cfbb..95b24ed973 100644
--- a/synapse/config/repository.py
+++ b/synapse/config/repository.py
@@ -94,8 +94,12 @@ class ContentRepositoryConfig(Config):
         self.max_spider_size = self.parse_size(config.get("max_spider_size", "10M"))
 
         if self.enable_media_repo:
-            self.media_store_path = self.ensure_directory(config.get("media_store_path", "media_store"))
-            self.uploads_path = self.ensure_directory(config.get("uploads_path", "uploads"))
+            self.media_store_path = self.ensure_directory(
+                config.get("media_store_path", "media_store")
+            )
+            self.uploads_path = self.ensure_directory(
+                config.get("uploads_path", "uploads")
+            )
         else:
             self.media_store_path = None
             self.uploads_path = None
diff --git a/synapse/federation/federation_client.py b/synapse/federation/federation_client.py
index 4e62fbf321..f57b09cb94 100644
--- a/synapse/federation/federation_client.py
+++ b/synapse/federation/federation_client.py
@@ -1011,8 +1011,7 @@ class FederationClient(FederationBase):
         """
         try:
             complexity = yield self.transport_layer.get_room_complexity(
-                destination=destination,
-                room_id=room_id
+                destination=destination, room_id=room_id
             )
             defer.returnValue(complexity)
         except CodeMessageException as e:
@@ -1020,12 +1019,13 @@ class FederationClient(FederationBase):
             # servers don't give it to us.
             logger.debug(
                 "Failed to fetch room complexity via %s for %s, got a %d",
-                destination, room_id, e.code
+                destination,
+                room_id,
+                e.code,
             )
         except Exception:
             logger.exception(
-                "Failed to fetch room complexity via %s for %s",
-                destination, room_id
+                "Failed to fetch room complexity via %s for %s", destination, room_id
             )
 
         # If we don't manage to find it, return None. It's not an error if a
diff --git a/synapse/federation/transport/client.py b/synapse/federation/transport/client.py
index 8ba893ab35..ce5f510bd4 100644
--- a/synapse/federation/transport/client.py
+++ b/synapse/federation/transport/client.py
@@ -945,14 +945,9 @@ class TransportLayerClient(object):
             destination (str): The remote server
             room_id (str): The room ID to ask about.
         """
-        path = _create_path(
-            FEDERATION_UNSTABLE_PREFIX, "/rooms/%s/complexity", room_id
-        )
+        path = _create_path(FEDERATION_UNSTABLE_PREFIX, "/rooms/%s/complexity", room_id)
 
-        return self.client.get_json(
-            destination=destination,
-            path=path
-        )
+        return self.client.get_json(destination=destination, path=path)
 
 
 def _create_path(federation_prefix, path, *args):
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py
index cef520392f..06777fefae 100644
--- a/synapse/handlers/room_member.py
+++ b/synapse/handlers/room_member.py
@@ -1030,8 +1030,9 @@ class RoomMemberMasterHandler(RoomMemberHandler):
             )
             if too_complex is True:
                 raise SynapseError(
-                    code=400, msg=ROOM_COMPLEXITY_TOO_GREAT,
-                    errcode=Codes.RESOURCE_LIMIT_EXCEEDED
+                    code=400,
+                    msg=ROOM_COMPLEXITY_TOO_GREAT,
+                    errcode=Codes.RESOURCE_LIMIT_EXCEEDED,
                 )
 
         # We don't do an auth check if we are doing an invite
@@ -1058,18 +1059,14 @@ class RoomMemberMasterHandler(RoomMemberHandler):
                 return
 
             # The room is too large. Leave.
-            requester = types.create_requester(
-                user, None, False, None
-            )
+            requester = types.create_requester(user, None, False, None)
             yield self.update_membership(
-                requester=requester,
-                target=user,
-                room_id=room_id,
-                action="leave"
+                requester=requester, target=user, room_id=room_id, action="leave"
             )
             raise SynapseError(
-                code=400, msg=ROOM_COMPLEXITY_TOO_GREAT,
-                errcode=Codes.RESOURCE_LIMIT_EXCEEDED
+                code=400,
+                msg=ROOM_COMPLEXITY_TOO_GREAT,
+                errcode=Codes.RESOURCE_LIMIT_EXCEEDED,
             )
 
     @defer.inlineCallbacks
diff --git a/synapse/storage/events_worker.py b/synapse/storage/events_worker.py
index c7dddb2bbe..9d7027b943 100644
--- a/synapse/storage/events_worker.py
+++ b/synapse/storage/events_worker.py
@@ -683,7 +683,9 @@ class EventsWorkerStore(SQLBaseStore):
             Deferred[int]
         """
         return self.runInteraction(
-            "get_current_state_event_counts", self._get_current_state_event_counts_txn, room_id
+            "get_current_state_event_counts",
+            self._get_current_state_event_counts_txn,
+            room_id,
         )
 
     def _get_current_state_event_counts_txn(self, txn, room_id):