eventsourcing 9.4.0b2__py3-none-any.whl → 9.4.0b4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of eventsourcing might be problematic. Click here for more details.
- eventsourcing/application.py +53 -104
- eventsourcing/cipher.py +3 -8
- eventsourcing/compressor.py +2 -6
- eventsourcing/cryptography.py +3 -8
- eventsourcing/dispatch.py +2 -2
- eventsourcing/domain.py +361 -384
- eventsourcing/interface.py +10 -24
- eventsourcing/persistence.py +91 -212
- eventsourcing/popo.py +2 -2
- eventsourcing/postgres.py +7 -10
- eventsourcing/projection.py +19 -41
- eventsourcing/sqlite.py +4 -7
- eventsourcing/system.py +89 -156
- eventsourcing/tests/__init__.py +3 -0
- eventsourcing/tests/application.py +14 -10
- eventsourcing/tests/domain.py +14 -34
- eventsourcing/tests/persistence.py +21 -18
- eventsourcing/utils.py +11 -17
- {eventsourcing-9.4.0b2.dist-info → eventsourcing-9.4.0b4.dist-info}/METADATA +1 -1
- eventsourcing-9.4.0b4.dist-info/RECORD +26 -0
- eventsourcing-9.4.0b2.dist-info/RECORD +0 -26
- {eventsourcing-9.4.0b2.dist-info → eventsourcing-9.4.0b4.dist-info}/AUTHORS +0 -0
- {eventsourcing-9.4.0b2.dist-info → eventsourcing-9.4.0b4.dist-info}/LICENSE +0 -0
- {eventsourcing-9.4.0b2.dist-info → eventsourcing-9.4.0b4.dist-info}/WHEEL +0 -0
eventsourcing/interface.py
CHANGED
|
@@ -14,15 +14,13 @@ if TYPE_CHECKING:
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class NotificationLogInterface(ABC):
|
|
17
|
-
"""
|
|
18
|
-
Abstract base class for obtaining serialised
|
|
17
|
+
"""Abstract base class for obtaining serialised
|
|
19
18
|
sections of a notification log.
|
|
20
19
|
"""
|
|
21
20
|
|
|
22
21
|
@abstractmethod
|
|
23
22
|
def get_log_section(self, section_id: str) -> str:
|
|
24
|
-
"""
|
|
25
|
-
Returns a serialised :class:`~eventsourcing.application.Section`
|
|
23
|
+
"""Returns a serialised :class:`~eventsourcing.application.Section`
|
|
26
24
|
from a notification log.
|
|
27
25
|
"""
|
|
28
26
|
|
|
@@ -35,26 +33,20 @@ class NotificationLogInterface(ABC):
|
|
|
35
33
|
*,
|
|
36
34
|
inclusive_of_start: bool = True,
|
|
37
35
|
) -> str:
|
|
38
|
-
"""
|
|
39
|
-
Returns a serialised list of :class:`~eventsourcing.persistence.Notification`
|
|
36
|
+
"""Returns a serialised list of :class:`~eventsourcing.persistence.Notification`
|
|
40
37
|
objects from a notification log.
|
|
41
38
|
"""
|
|
42
39
|
|
|
43
40
|
|
|
44
41
|
class NotificationLogJSONService(NotificationLogInterface, Generic[TApplication]):
|
|
45
|
-
"""
|
|
46
|
-
Presents serialised sections of a notification log.
|
|
47
|
-
"""
|
|
42
|
+
"""Presents serialised sections of a notification log."""
|
|
48
43
|
|
|
49
44
|
def __init__(self, app: TApplication):
|
|
50
|
-
"""
|
|
51
|
-
Initialises service with given application.
|
|
52
|
-
"""
|
|
45
|
+
"""Initialises service with given application."""
|
|
53
46
|
self.app = app
|
|
54
47
|
|
|
55
48
|
def get_log_section(self, section_id: str) -> str:
|
|
56
|
-
"""
|
|
57
|
-
Returns JSON serialised :class:`~eventsourcing.application.Section`
|
|
49
|
+
"""Returns JSON serialised :class:`~eventsourcing.application.Section`
|
|
58
50
|
from a notification log.
|
|
59
51
|
"""
|
|
60
52
|
section = self.app.notification_log[section_id]
|
|
@@ -104,19 +96,14 @@ class NotificationLogJSONService(NotificationLogInterface, Generic[TApplication]
|
|
|
104
96
|
|
|
105
97
|
|
|
106
98
|
class NotificationLogJSONClient(NotificationLog):
|
|
107
|
-
"""
|
|
108
|
-
Presents deserialized sections of a notification log.
|
|
109
|
-
"""
|
|
99
|
+
"""Presents deserialized sections of a notification log."""
|
|
110
100
|
|
|
111
101
|
def __init__(self, interface: NotificationLogInterface):
|
|
112
|
-
"""
|
|
113
|
-
Initialises log with a given interface.
|
|
114
|
-
"""
|
|
102
|
+
"""Initialises log with a given interface."""
|
|
115
103
|
self.interface = interface
|
|
116
104
|
|
|
117
105
|
def __getitem__(self, section_id: str) -> Section:
|
|
118
|
-
"""
|
|
119
|
-
Returns a :class:`Section` of
|
|
106
|
+
"""Returns a :class:`Section` of
|
|
120
107
|
:class:`~eventsourcing.persistence.Notification` objects
|
|
121
108
|
from the notification log.
|
|
122
109
|
"""
|
|
@@ -146,8 +133,7 @@ class NotificationLogJSONClient(NotificationLog):
|
|
|
146
133
|
*,
|
|
147
134
|
inclusive_of_start: bool = True,
|
|
148
135
|
) -> list[Notification]:
|
|
149
|
-
"""
|
|
150
|
-
Returns a selection of
|
|
136
|
+
"""Returns a selection of
|
|
151
137
|
:class:`~eventsourcing.persistence.Notification` objects
|
|
152
138
|
from the notification log.
|
|
153
139
|
"""
|