summary refs log tree commit diff
path: root/synapse/events/__init__.py
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2019-06-20 19:32:02 +1000
committerGitHub <noreply@github.com>2019-06-20 19:32:02 +1000
commit32e7c9e7f20b57dd081023ac42d6931a8da9b3a3 (patch)
tree139ef30c957535699d1ae0474e8b5ba2517196b2 /synapse/events/__init__.py
parentMerge pull request #5042 from matrix-org/erikj/fix_get_missing_events_error (diff)
downloadsynapse-32e7c9e7f20b57dd081023ac42d6931a8da9b3a3.tar.xz
Run Black. (#5482)
Diffstat (limited to 'synapse/events/__init__.py')
-rw-r--r--synapse/events/__init__.py30
1 files changed, 13 insertions, 17 deletions
diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py
index 7154bcbea6..d3de70e671 100644
--- a/synapse/events/__init__.py
+++ b/synapse/events/__init__.py
@@ -127,25 +127,25 @@ def _event_dict_property(key):
         except KeyError:
             raise AttributeError(key)
 
-    return property(
-        getter,
-        setter,
-        delete,
-    )
+    return property(getter, setter, delete)
 
 
 class EventBase(object):
-    def __init__(self, event_dict, signatures={}, unsigned={},
-                 internal_metadata_dict={}, rejected_reason=None):
+    def __init__(
+        self,
+        event_dict,
+        signatures={},
+        unsigned={},
+        internal_metadata_dict={},
+        rejected_reason=None,
+    ):
         self.signatures = signatures
         self.unsigned = unsigned
         self.rejected_reason = rejected_reason
 
         self._event_dict = event_dict
 
-        self.internal_metadata = _EventInternalMetadata(
-            internal_metadata_dict
-        )
+        self.internal_metadata = _EventInternalMetadata(internal_metadata_dict)
 
     auth_events = _event_dict_property("auth_events")
     depth = _event_dict_property("depth")
@@ -168,10 +168,7 @@ class EventBase(object):
 
     def get_dict(self):
         d = dict(self._event_dict)
-        d.update({
-            "signatures": self.signatures,
-            "unsigned": dict(self.unsigned),
-        })
+        d.update({"signatures": self.signatures, "unsigned": dict(self.unsigned)})
 
         return d
 
@@ -358,6 +355,7 @@ class FrozenEventV2(EventBase):
 
 class FrozenEventV3(FrozenEventV2):
     """FrozenEventV3, which differs from FrozenEventV2 only in the event_id format"""
+
     format_version = EventFormatVersions.V3  # All events of this type are V3
 
     @property
@@ -414,6 +412,4 @@ def event_type_from_format_version(format_version):
     elif format_version == EventFormatVersions.V3:
         return FrozenEventV3
     else:
-        raise Exception(
-            "No event format %r" % (format_version,)
-        )
+        raise Exception("No event format %r" % (format_version,))