vmx 2.6.0__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.
- vmx/__about__.py +10 -0
- vmx/__init__.py +289 -0
- vmx/aggregates/__init__.py +60 -0
- vmx/aggregates/aggregate_vm.py +653 -0
- vmx/aggregates/builders.py +451 -0
- vmx/builders/__init__.py +14 -0
- vmx/builders/_validation.py +31 -0
- vmx/builders/exceptions.py +20 -0
- vmx/capabilities/__init__.py +56 -0
- vmx/capabilities/crud.py +40 -0
- vmx/capabilities/current_crud.py +21 -0
- vmx/capabilities/dialog.py +29 -0
- vmx/capabilities/expandable_state.py +68 -0
- vmx/capabilities/expansion.py +33 -0
- vmx/capabilities/filter.py +28 -0
- vmx/capabilities/lifecycle_capabilities.py +32 -0
- vmx/capabilities/management.py +16 -0
- vmx/capabilities/pageable.py +103 -0
- vmx/capabilities/search.py +21 -0
- vmx/capabilities/searchable_state.py +103 -0
- vmx/capabilities/selection.py +29 -0
- vmx/collections/__init__.py +34 -0
- vmx/collections/batch.py +45 -0
- vmx/collections/collection_changed.py +21 -0
- vmx/collections/observable_dictionary.py +288 -0
- vmx/collections/observable_list.py +225 -0
- vmx/collections/paged_composition.py +240 -0
- vmx/collections/serviced_observable_collection.py +136 -0
- vmx/commands/__init__.py +48 -0
- vmx/commands/composite_command.py +55 -0
- vmx/commands/confirmation_decorator_command.py +62 -0
- vmx/commands/decorator_command.py +67 -0
- vmx/commands/fluent.py +109 -0
- vmx/commands/modeled_crud_commands.py +88 -0
- vmx/commands/protocols.py +57 -0
- vmx/commands/relay_command.py +278 -0
- vmx/components/__init__.py +44 -0
- vmx/components/base.py +457 -0
- vmx/components/builders.py +346 -0
- vmx/components/component_vm.py +156 -0
- vmx/components/protocols.py +136 -0
- vmx/components/readonly_component_vm.py +77 -0
- vmx/composites/__init__.py +29 -0
- vmx/composites/builders.py +265 -0
- vmx/composites/composite_vm.py +517 -0
- vmx/composites/protocols.py +58 -0
- vmx/dialogs/__init__.py +18 -0
- vmx/dialogs/dialog_service.py +96 -0
- vmx/dialogs/null_dialog_service.py +56 -0
- vmx/forms/__init__.py +15 -0
- vmx/forms/builders.py +107 -0
- vmx/forms/form_vm.py +229 -0
- vmx/forwarding/__init__.py +14 -0
- vmx/forwarding/component.py +153 -0
- vmx/forwarding/composite.py +214 -0
- vmx/groups/__init__.py +20 -0
- vmx/groups/builders.py +118 -0
- vmx/groups/group_vm.py +305 -0
- vmx/hierarchical/__init__.py +11 -0
- vmx/hierarchical/builders.py +157 -0
- vmx/hierarchical/hierarchical_vm.py +298 -0
- vmx/lifecycle/__init__.py +24 -0
- vmx/lifecycle/_data/__init__.py +1 -0
- vmx/lifecycle/_data/lifecycle-transitions.json +37 -0
- vmx/lifecycle/exceptions.py +27 -0
- vmx/lifecycle/status.py +31 -0
- vmx/lifecycle/transition_validator.py +116 -0
- vmx/localization/__init__.py +12 -0
- vmx/localization/localizer.py +15 -0
- vmx/localization/null_localizer.py +16 -0
- vmx/messages/__init__.py +44 -0
- vmx/messages/collection_changed.py +111 -0
- vmx/messages/construction_status_changed.py +44 -0
- vmx/messages/form_reverted.py +34 -0
- vmx/messages/property_changed.py +45 -0
- vmx/messages/property_value_changed.py +60 -0
- vmx/messages/protocols.py +55 -0
- vmx/messages/tree_structure_changed.py +68 -0
- vmx/notifications/__init__.py +33 -0
- vmx/notifications/confirm_helper.py +25 -0
- vmx/notifications/confirmation_vm.py +92 -0
- vmx/notifications/notification.py +23 -0
- vmx/notifications/notification_hub.py +137 -0
- vmx/notifications/notification_reaction.py +13 -0
- vmx/notifications/notification_type.py +13 -0
- vmx/notifications/notification_vm.py +186 -0
- vmx/notifications/null_notification_hub.py +40 -0
- vmx/properties/__init__.py +25 -0
- vmx/properties/derived.py +222 -0
- vmx/py.typed +0 -0
- vmx/services/__init__.py +29 -0
- vmx/services/dispatcher.py +83 -0
- vmx/services/message_hub.py +82 -0
- vmx/services/null_dispatcher.py +32 -0
- vmx/services/null_message_hub.py +77 -0
- vmx/tree/__init__.py +10 -0
- vmx/tree/walk.py +65 -0
- vmx-2.6.0.dist-info/METADATA +271 -0
- vmx-2.6.0.dist-info/RECORD +100 -0
- vmx-2.6.0.dist-info/WHEEL +4 -0
vmx/__about__.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""Package metadata for vmx."""
|
|
2
|
+
|
|
3
|
+
# release-please updates the value preceding the marker comment on the
|
|
4
|
+
# `__version__` line each time it cuts a release PR. `__min_spec_version__`
|
|
5
|
+
# is intentionally not auto-bumped — when a spec major bumps, the user
|
|
6
|
+
# adjusts it together with `spec/VERSION` and the compatibility matrix in
|
|
7
|
+
# the release-prep PR review (or in a follow-up commit on the release PR
|
|
8
|
+
# before merging).
|
|
9
|
+
__version__ = "2.6.0" # x-release-please-version
|
|
10
|
+
__min_spec_version__ = "2.6.0"
|
vmx/__init__.py
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
"""VMx — hierarchical, lifecycle-aware MVVM viewmodel framework (Python flavor).
|
|
2
|
+
|
|
3
|
+
Public API is organised by responsibility under sub-packages: ``vmx.lifecycle``,
|
|
4
|
+
``vmx.messages``, ``vmx.services``, ``vmx.commands``, ``vmx.components``,
|
|
5
|
+
``vmx.composites``, ``vmx.groups``, ``vmx.aggregates``, ``vmx.forwarding``,
|
|
6
|
+
``vmx.builders``, ``vmx.tree``, ``vmx.collections``, ``vmx.capabilities``,
|
|
7
|
+
``vmx.properties``, ``vmx.localization``, ``vmx.hierarchical``, ``vmx.dialogs``,
|
|
8
|
+
``vmx.forms``. The ``vmx.notifications`` sub-package is opt-in and must be
|
|
9
|
+
imported explicitly. The full set of public types is re-exported here so
|
|
10
|
+
``from vmx import ...`` reaches every primitive.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from vmx.__about__ import __min_spec_version__, __version__
|
|
14
|
+
from vmx.aggregates import (
|
|
15
|
+
AggregateVM1,
|
|
16
|
+
AggregateVM1Builder,
|
|
17
|
+
AggregateVM2,
|
|
18
|
+
AggregateVM2Builder,
|
|
19
|
+
AggregateVM3,
|
|
20
|
+
AggregateVM3Builder,
|
|
21
|
+
AggregateVM4,
|
|
22
|
+
AggregateVM4Builder,
|
|
23
|
+
AggregateVM5,
|
|
24
|
+
AggregateVM5Builder,
|
|
25
|
+
AggregateVM6,
|
|
26
|
+
AggregateVM6Builder,
|
|
27
|
+
AggregateVMBuilder1,
|
|
28
|
+
AggregateVMBuilder2,
|
|
29
|
+
AggregateVMBuilder3,
|
|
30
|
+
AggregateVMBuilder4,
|
|
31
|
+
AggregateVMBuilder5,
|
|
32
|
+
AggregateVMBuilder6,
|
|
33
|
+
)
|
|
34
|
+
from vmx.builders import BuilderValidationError
|
|
35
|
+
from vmx.capabilities import (
|
|
36
|
+
ExpandableState,
|
|
37
|
+
Filterable,
|
|
38
|
+
IApprovable,
|
|
39
|
+
ICancelable,
|
|
40
|
+
IClosable,
|
|
41
|
+
ICollapsible,
|
|
42
|
+
IConstructable,
|
|
43
|
+
ICurrentDeletable,
|
|
44
|
+
ICurrentUpdatable,
|
|
45
|
+
IDeletable,
|
|
46
|
+
IDeselectable,
|
|
47
|
+
IDestructable,
|
|
48
|
+
IExpandable,
|
|
49
|
+
IExpansionTogglable,
|
|
50
|
+
IManagable,
|
|
51
|
+
INewCreatable,
|
|
52
|
+
IReconstructable,
|
|
53
|
+
ISavable,
|
|
54
|
+
ISearchable,
|
|
55
|
+
ISelectable,
|
|
56
|
+
ISelectionTogglable,
|
|
57
|
+
IUpdatable,
|
|
58
|
+
Pageable,
|
|
59
|
+
SearchableState,
|
|
60
|
+
)
|
|
61
|
+
from vmx.collections import (
|
|
62
|
+
BatchUpdateHandle,
|
|
63
|
+
CollectionChangedEvent,
|
|
64
|
+
ObservableDictionary,
|
|
65
|
+
ObservableList,
|
|
66
|
+
PagedComposition,
|
|
67
|
+
ServicedObservableCollection,
|
|
68
|
+
)
|
|
69
|
+
from vmx.commands import (
|
|
70
|
+
Command,
|
|
71
|
+
CompositeCommand,
|
|
72
|
+
ConfirmationDecoratorCommand,
|
|
73
|
+
DecoratorCommand,
|
|
74
|
+
ModeledCrudCommands,
|
|
75
|
+
ParameterizedCommand,
|
|
76
|
+
RelayCommand,
|
|
77
|
+
RelayCommandBuilder,
|
|
78
|
+
RelayCommandOf,
|
|
79
|
+
RelayCommandOfBuilder,
|
|
80
|
+
RelayCommandOfT,
|
|
81
|
+
RelayCommandOfTBuilder,
|
|
82
|
+
confirm,
|
|
83
|
+
confirm_with_dialog_service,
|
|
84
|
+
precede_with,
|
|
85
|
+
succeed_with,
|
|
86
|
+
wrap_with,
|
|
87
|
+
)
|
|
88
|
+
from vmx.components import (
|
|
89
|
+
ComponentVM,
|
|
90
|
+
ComponentVMBuilder,
|
|
91
|
+
ComponentVMOf,
|
|
92
|
+
ComponentVMOfBuilder,
|
|
93
|
+
ReadonlyComponentVMOf,
|
|
94
|
+
ReadonlyComponentVMOfBuilder,
|
|
95
|
+
ViewModelType,
|
|
96
|
+
)
|
|
97
|
+
from vmx.composites import (
|
|
98
|
+
CompositeVM,
|
|
99
|
+
CompositeVMBuilder,
|
|
100
|
+
CompositeVMOf,
|
|
101
|
+
CompositeVMOfBuilder,
|
|
102
|
+
)
|
|
103
|
+
from vmx.dialogs import (
|
|
104
|
+
NULL_DIALOG_SERVICE,
|
|
105
|
+
DialogService,
|
|
106
|
+
FileFilter,
|
|
107
|
+
NotificationSeverity,
|
|
108
|
+
NullDialogService,
|
|
109
|
+
)
|
|
110
|
+
from vmx.forms import FormVM, FormVMBuilder
|
|
111
|
+
from vmx.forwarding import ForwardingComponentVM, ForwardingCompositeVM
|
|
112
|
+
from vmx.groups import GroupVM, GroupVMBuilder
|
|
113
|
+
from vmx.hierarchical import HierarchicalVM, HierarchicalVMBuilder
|
|
114
|
+
from vmx.lifecycle import ConstructionStatus, StatusTransitionError
|
|
115
|
+
from vmx.localization import NULL_LOCALIZER, ILocalizer, NullLocalizer
|
|
116
|
+
from vmx.messages import (
|
|
117
|
+
CollectionChangedMessage,
|
|
118
|
+
ConstructionStatusChangedMessage,
|
|
119
|
+
FormRevertedMessage,
|
|
120
|
+
Message,
|
|
121
|
+
PropertyChangedMessage,
|
|
122
|
+
TreeStructureChange,
|
|
123
|
+
TreeStructureChangedMessage,
|
|
124
|
+
TypedMessage,
|
|
125
|
+
property_value_changed_messages_for,
|
|
126
|
+
)
|
|
127
|
+
from vmx.properties import (
|
|
128
|
+
DerivedProperty,
|
|
129
|
+
from_five,
|
|
130
|
+
from_four,
|
|
131
|
+
from_many,
|
|
132
|
+
from_one,
|
|
133
|
+
from_sources,
|
|
134
|
+
from_three,
|
|
135
|
+
from_two,
|
|
136
|
+
)
|
|
137
|
+
from vmx.services import (
|
|
138
|
+
NULL_DISPATCHER,
|
|
139
|
+
NULL_MESSAGE_HUB,
|
|
140
|
+
Dispatcher,
|
|
141
|
+
MessageHub,
|
|
142
|
+
MessageHubProto,
|
|
143
|
+
NullDispatcher,
|
|
144
|
+
NullMessageHub,
|
|
145
|
+
RxDispatcher,
|
|
146
|
+
null_message_hub_of,
|
|
147
|
+
)
|
|
148
|
+
from vmx.tree import find, walk, walk_expanded
|
|
149
|
+
|
|
150
|
+
__all__ = [
|
|
151
|
+
"NULL_DIALOG_SERVICE",
|
|
152
|
+
"NULL_DISPATCHER",
|
|
153
|
+
"NULL_LOCALIZER",
|
|
154
|
+
"NULL_MESSAGE_HUB",
|
|
155
|
+
"AggregateVM1",
|
|
156
|
+
"AggregateVM1Builder",
|
|
157
|
+
"AggregateVM2",
|
|
158
|
+
"AggregateVM2Builder",
|
|
159
|
+
"AggregateVM3",
|
|
160
|
+
"AggregateVM3Builder",
|
|
161
|
+
"AggregateVM4",
|
|
162
|
+
"AggregateVM4Builder",
|
|
163
|
+
"AggregateVM5",
|
|
164
|
+
"AggregateVM5Builder",
|
|
165
|
+
"AggregateVM6",
|
|
166
|
+
"AggregateVM6Builder",
|
|
167
|
+
"AggregateVMBuilder1",
|
|
168
|
+
"AggregateVMBuilder2",
|
|
169
|
+
"AggregateVMBuilder3",
|
|
170
|
+
"AggregateVMBuilder4",
|
|
171
|
+
"AggregateVMBuilder5",
|
|
172
|
+
"AggregateVMBuilder6",
|
|
173
|
+
"BatchUpdateHandle",
|
|
174
|
+
"BuilderValidationError",
|
|
175
|
+
"CollectionChangedEvent",
|
|
176
|
+
"CollectionChangedMessage",
|
|
177
|
+
"Command",
|
|
178
|
+
"ComponentVM",
|
|
179
|
+
"ComponentVMBuilder",
|
|
180
|
+
"ComponentVMOf",
|
|
181
|
+
"ComponentVMOfBuilder",
|
|
182
|
+
"CompositeCommand",
|
|
183
|
+
"CompositeVM",
|
|
184
|
+
"CompositeVMBuilder",
|
|
185
|
+
"CompositeVMOf",
|
|
186
|
+
"CompositeVMOfBuilder",
|
|
187
|
+
"ConfirmationDecoratorCommand",
|
|
188
|
+
"ConstructionStatus",
|
|
189
|
+
"ConstructionStatusChangedMessage",
|
|
190
|
+
"DecoratorCommand",
|
|
191
|
+
"DerivedProperty",
|
|
192
|
+
"DialogService",
|
|
193
|
+
"Dispatcher",
|
|
194
|
+
"ExpandableState",
|
|
195
|
+
"FileFilter",
|
|
196
|
+
"Filterable",
|
|
197
|
+
"FormRevertedMessage",
|
|
198
|
+
"FormVM",
|
|
199
|
+
"FormVMBuilder",
|
|
200
|
+
"ForwardingComponentVM",
|
|
201
|
+
"ForwardingCompositeVM",
|
|
202
|
+
"GroupVM",
|
|
203
|
+
"GroupVMBuilder",
|
|
204
|
+
"HierarchicalVM",
|
|
205
|
+
"HierarchicalVMBuilder",
|
|
206
|
+
"IApprovable",
|
|
207
|
+
"ICancelable",
|
|
208
|
+
"IClosable",
|
|
209
|
+
"ICollapsible",
|
|
210
|
+
"IConstructable",
|
|
211
|
+
"ICurrentDeletable",
|
|
212
|
+
"ICurrentUpdatable",
|
|
213
|
+
"IDeletable",
|
|
214
|
+
"IDeselectable",
|
|
215
|
+
"IDestructable",
|
|
216
|
+
"IExpandable",
|
|
217
|
+
"IExpansionTogglable",
|
|
218
|
+
"ILocalizer",
|
|
219
|
+
"IManagable",
|
|
220
|
+
"INewCreatable",
|
|
221
|
+
"IReconstructable",
|
|
222
|
+
"ISavable",
|
|
223
|
+
"ISearchable",
|
|
224
|
+
"ISelectable",
|
|
225
|
+
"ISelectionTogglable",
|
|
226
|
+
"IUpdatable",
|
|
227
|
+
"Message",
|
|
228
|
+
"MessageHub",
|
|
229
|
+
"MessageHubProto",
|
|
230
|
+
"ModeledCrudCommands",
|
|
231
|
+
"NotificationSeverity",
|
|
232
|
+
"NullDialogService",
|
|
233
|
+
"NullDispatcher",
|
|
234
|
+
"NullLocalizer",
|
|
235
|
+
"NullMessageHub",
|
|
236
|
+
"ObservableDictionary",
|
|
237
|
+
"ObservableList",
|
|
238
|
+
"Pageable",
|
|
239
|
+
"PagedComposition",
|
|
240
|
+
"ParameterizedCommand",
|
|
241
|
+
"PropertyChangedMessage",
|
|
242
|
+
"ReadonlyComponentVMOf",
|
|
243
|
+
"ReadonlyComponentVMOfBuilder",
|
|
244
|
+
"RelayCommand",
|
|
245
|
+
"RelayCommandBuilder",
|
|
246
|
+
"RelayCommandOf",
|
|
247
|
+
"RelayCommandOfBuilder",
|
|
248
|
+
"RelayCommandOfT",
|
|
249
|
+
"RelayCommandOfTBuilder",
|
|
250
|
+
"RxDispatcher",
|
|
251
|
+
"SearchableState",
|
|
252
|
+
"ServicedObservableCollection",
|
|
253
|
+
"StatusTransitionError",
|
|
254
|
+
"TreeStructureChange",
|
|
255
|
+
"TreeStructureChangedMessage",
|
|
256
|
+
"TypedMessage",
|
|
257
|
+
"ViewModelType",
|
|
258
|
+
"__min_spec_version__",
|
|
259
|
+
"__version__",
|
|
260
|
+
"confirm",
|
|
261
|
+
"confirm_with_dialog_service",
|
|
262
|
+
"find",
|
|
263
|
+
"from_five",
|
|
264
|
+
"from_four",
|
|
265
|
+
"from_many",
|
|
266
|
+
"from_one",
|
|
267
|
+
"from_sources",
|
|
268
|
+
"from_three",
|
|
269
|
+
"from_two",
|
|
270
|
+
"null_message_hub_of",
|
|
271
|
+
"precede_with",
|
|
272
|
+
"property_value_changed_messages_for",
|
|
273
|
+
"succeed_with",
|
|
274
|
+
"walk",
|
|
275
|
+
"walk_expanded",
|
|
276
|
+
"wrap_with",
|
|
277
|
+
]
|
|
278
|
+
|
|
279
|
+
# Lifecycle capabilities are baseline: every core VM trivially satisfies them.
|
|
280
|
+
# See spec/14-capabilities.md rule 2 and CAP-020.
|
|
281
|
+
IConstructable.register(ComponentVM)
|
|
282
|
+
IConstructable.register(ComponentVMOf)
|
|
283
|
+
IConstructable.register(ReadonlyComponentVMOf)
|
|
284
|
+
IDestructable.register(ComponentVM)
|
|
285
|
+
IDestructable.register(ComponentVMOf)
|
|
286
|
+
IDestructable.register(ReadonlyComponentVMOf)
|
|
287
|
+
IReconstructable.register(ComponentVM)
|
|
288
|
+
IReconstructable.register(ComponentVMOf)
|
|
289
|
+
IReconstructable.register(ReadonlyComponentVMOf)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"""vmx.aggregates — fixed-arity heterogeneous component VM tuples.
|
|
2
|
+
|
|
3
|
+
Exports AggregateVM1 through AggregateVM6 and their corresponding builders.
|
|
4
|
+
|
|
5
|
+
Builder naming
|
|
6
|
+
--------------
|
|
7
|
+
The canonical builder names from v1.2.0 are ``AggregateVM1Builder`` through
|
|
8
|
+
``AggregateVM6Builder`` (matching the TypeScript flavor). The historical
|
|
9
|
+
``AggregateVMBuilder1`` through ``AggregateVMBuilder6`` names remain as identity
|
|
10
|
+
aliases for backward compatibility; the originally planned v2.0.0 removal slipped
|
|
11
|
+
and is deferred to vmx v3.0.0 per ADR-0009.
|
|
12
|
+
|
|
13
|
+
See spec/08-aggregate-vm.md and ADR-0007 (arity 6 added per ADR-0034).
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
from vmx.aggregates.aggregate_vm import (
|
|
19
|
+
AggregateVM1,
|
|
20
|
+
AggregateVM2,
|
|
21
|
+
AggregateVM3,
|
|
22
|
+
AggregateVM4,
|
|
23
|
+
AggregateVM5,
|
|
24
|
+
AggregateVM6,
|
|
25
|
+
)
|
|
26
|
+
from vmx.aggregates.builders import (
|
|
27
|
+
AggregateVM1Builder,
|
|
28
|
+
AggregateVM2Builder,
|
|
29
|
+
AggregateVM3Builder,
|
|
30
|
+
AggregateVM4Builder,
|
|
31
|
+
AggregateVM5Builder,
|
|
32
|
+
AggregateVM6Builder,
|
|
33
|
+
AggregateVMBuilder1,
|
|
34
|
+
AggregateVMBuilder2,
|
|
35
|
+
AggregateVMBuilder3,
|
|
36
|
+
AggregateVMBuilder4,
|
|
37
|
+
AggregateVMBuilder5,
|
|
38
|
+
AggregateVMBuilder6,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
__all__ = [
|
|
42
|
+
"AggregateVM1",
|
|
43
|
+
"AggregateVM1Builder",
|
|
44
|
+
"AggregateVM2",
|
|
45
|
+
"AggregateVM2Builder",
|
|
46
|
+
"AggregateVM3",
|
|
47
|
+
"AggregateVM3Builder",
|
|
48
|
+
"AggregateVM4",
|
|
49
|
+
"AggregateVM4Builder",
|
|
50
|
+
"AggregateVM5",
|
|
51
|
+
"AggregateVM5Builder",
|
|
52
|
+
"AggregateVM6",
|
|
53
|
+
"AggregateVM6Builder",
|
|
54
|
+
"AggregateVMBuilder1",
|
|
55
|
+
"AggregateVMBuilder2",
|
|
56
|
+
"AggregateVMBuilder3",
|
|
57
|
+
"AggregateVMBuilder4",
|
|
58
|
+
"AggregateVMBuilder5",
|
|
59
|
+
"AggregateVMBuilder6",
|
|
60
|
+
]
|