python-statemachine 3.1.2__py3-none-any.whl → 3.2.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.
- {python_statemachine-3.1.2.dist-info → python_statemachine-3.2.0.dist-info}/METADATA +16 -3
- python_statemachine-3.2.0.dist-info/RECORD +72 -0
- {python_statemachine-3.1.2.dist-info → python_statemachine-3.2.0.dist-info}/WHEEL +1 -1
- statemachine/__init__.py +1 -1
- statemachine/callbacks.py +5 -11
- statemachine/configuration.py +5 -6
- statemachine/contrib/diagram/extract.py +23 -24
- statemachine/contrib/diagram/formatter.py +5 -7
- statemachine/contrib/diagram/model.py +9 -11
- statemachine/contrib/diagram/renderers/dot.py +20 -26
- statemachine/contrib/diagram/renderers/mermaid.py +36 -40
- statemachine/contrib/diagram/renderers/table.py +7 -9
- statemachine/contrib/weighted.py +7 -11
- statemachine/dispatcher.py +13 -12
- statemachine/engines/async_.py +5 -6
- statemachine/engines/base.py +12 -14
- statemachine/event.py +1 -2
- statemachine/exceptions.py +1 -1
- statemachine/factory.py +11 -15
- statemachine/graph.py +2 -2
- statemachine/invoke.py +12 -11
- statemachine/io/__init__.py +45 -225
- statemachine/io/{scxml/actions.py → actions.py} +158 -288
- statemachine/io/builder.py +195 -0
- statemachine/io/class_factory.py +236 -0
- statemachine/io/evaluators.py +275 -0
- statemachine/io/interpreter.py +128 -0
- statemachine/io/{scxml/invoke.py → invoke.py} +77 -49
- statemachine/io/json/__init__.py +1 -0
- statemachine/io/json/reader.py +27 -0
- statemachine/io/loader.py +161 -0
- statemachine/io/model.py +268 -0
- statemachine/io/native.py +402 -0
- statemachine/io/ports.py +83 -0
- statemachine/io/schemas/statechart.schema.json +258 -0
- statemachine/io/scxml/__init__.py +12 -0
- statemachine/io/scxml/processor.py +23 -253
- statemachine/io/scxml/{parser.py → reader.py} +64 -47
- statemachine/io/system_variables.py +184 -0
- statemachine/io/validation.py +44 -0
- statemachine/io/yaml/__init__.py +1 -0
- statemachine/io/yaml/reader.py +65 -0
- statemachine/locale/en/LC_MESSAGES/statemachine.po +19 -19
- statemachine/locale/hi_IN/LC_MESSAGES/statemachine.po +19 -19
- statemachine/locale/pt_BR/LC_MESSAGES/statemachine.po +19 -19
- statemachine/locale/zh_CN/LC_MESSAGES/statemachine.po +19 -19
- statemachine/orderedset.py +3 -3
- statemachine/registry.py +1 -4
- statemachine/signature.py +2 -5
- statemachine/spec_parser.py +171 -42
- statemachine/state.py +5 -6
- statemachine/statemachine.py +18 -20
- statemachine/states.py +3 -5
- statemachine/transition.py +3 -4
- statemachine/transition_list.py +4 -5
- statemachine/transition_mixin.py +1 -1
- python_statemachine-3.1.2.dist-info/RECORD +0 -58
- statemachine/io/scxml/schema.py +0 -175
- {python_statemachine-3.1.2.dist-info → python_statemachine-3.2.0.dist-info}/licenses/LICENSE +0 -0
statemachine/io/scxml/schema.py
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
from dataclasses import dataclass
|
|
2
|
-
from dataclasses import field
|
|
3
|
-
from typing import Dict
|
|
4
|
-
from typing import List
|
|
5
|
-
from typing import Literal
|
|
6
|
-
from urllib.parse import ParseResult
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@dataclass
|
|
10
|
-
class Action:
|
|
11
|
-
def __str__(self):
|
|
12
|
-
return f"{self.__class__.__name__}"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@dataclass
|
|
16
|
-
class ExecutableContent:
|
|
17
|
-
actions: List[Action] = field(default_factory=list)
|
|
18
|
-
|
|
19
|
-
def __str__(self):
|
|
20
|
-
return ", ".join(str(action) for action in self.actions)
|
|
21
|
-
|
|
22
|
-
@property
|
|
23
|
-
def is_empty(self):
|
|
24
|
-
return not self.actions
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
@dataclass
|
|
28
|
-
class RaiseAction(Action):
|
|
29
|
-
event: str
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
@dataclass
|
|
33
|
-
class AssignAction(Action):
|
|
34
|
-
location: str
|
|
35
|
-
expr: "str | None" = None
|
|
36
|
-
child_xml: "str | None" = None
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
@dataclass
|
|
40
|
-
class LogAction(Action):
|
|
41
|
-
label: "str | None"
|
|
42
|
-
expr: "str | None"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
@dataclass
|
|
46
|
-
class IfBranch(Action):
|
|
47
|
-
cond: "str | None"
|
|
48
|
-
actions: List[Action] = field(default_factory=list)
|
|
49
|
-
|
|
50
|
-
def __str__(self):
|
|
51
|
-
return self.cond or "<empty cond>"
|
|
52
|
-
|
|
53
|
-
def append(self, action: Action):
|
|
54
|
-
self.actions.append(action)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
@dataclass
|
|
58
|
-
class IfAction(Action):
|
|
59
|
-
branches: List[IfBranch] = field(default_factory=list)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
@dataclass
|
|
63
|
-
class ForeachAction(Action):
|
|
64
|
-
array: str
|
|
65
|
-
item: str
|
|
66
|
-
index: "str | None"
|
|
67
|
-
content: ExecutableContent
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
@dataclass
|
|
71
|
-
class Param:
|
|
72
|
-
name: str
|
|
73
|
-
expr: "str | None"
|
|
74
|
-
location: "str | None" = None
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
@dataclass
|
|
78
|
-
class SendAction(Action):
|
|
79
|
-
event: "str | None" = None
|
|
80
|
-
eventexpr: "str | None" = None
|
|
81
|
-
target: "str | None" = None
|
|
82
|
-
type: "str | None" = None
|
|
83
|
-
id: "str | None" = None
|
|
84
|
-
idlocation: "str | None" = None
|
|
85
|
-
delay: "str | None" = None
|
|
86
|
-
delayexpr: "str | None" = None
|
|
87
|
-
namelist: "str | None" = None
|
|
88
|
-
params: List[Param] = field(default_factory=list)
|
|
89
|
-
content: "str | None" = None
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
@dataclass
|
|
93
|
-
class CancelAction(Action):
|
|
94
|
-
sendid: "str | None" = None
|
|
95
|
-
sendidexpr: "str | None" = None
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
@dataclass
|
|
99
|
-
class ScriptAction(Action):
|
|
100
|
-
content: str
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
@dataclass
|
|
104
|
-
class Transition:
|
|
105
|
-
target: "str | None" = None
|
|
106
|
-
internal: bool = False
|
|
107
|
-
initial: bool = False
|
|
108
|
-
event: "str | None" = None
|
|
109
|
-
cond: "str | None" = None
|
|
110
|
-
on: "ExecutableContent | None" = None
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
@dataclass
|
|
114
|
-
class DoneData:
|
|
115
|
-
params: List[Param] = field(default_factory=list)
|
|
116
|
-
content_expr: "str | None" = None
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
@dataclass
|
|
120
|
-
class InvokeDefinition:
|
|
121
|
-
type: "str | None" = None
|
|
122
|
-
typeexpr: "str | None" = None
|
|
123
|
-
src: "str | None" = None
|
|
124
|
-
srcexpr: "str | None" = None
|
|
125
|
-
id: "str | None" = None
|
|
126
|
-
idlocation: "str | None" = None
|
|
127
|
-
autoforward: bool = False
|
|
128
|
-
namelist: "str | None" = None
|
|
129
|
-
params: List[Param] = field(default_factory=list)
|
|
130
|
-
content: "str | None" = None
|
|
131
|
-
finalize: "ExecutableContent | None" = None
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
@dataclass
|
|
135
|
-
class State:
|
|
136
|
-
id: str
|
|
137
|
-
initial: bool = False
|
|
138
|
-
final: bool = False
|
|
139
|
-
parallel: bool = False
|
|
140
|
-
transitions: List[Transition] = field(default_factory=list)
|
|
141
|
-
onentry: List[ExecutableContent] = field(default_factory=list)
|
|
142
|
-
onexit: List[ExecutableContent] = field(default_factory=list)
|
|
143
|
-
states: Dict[str, "State"] = field(default_factory=dict)
|
|
144
|
-
history: Dict[str, "HistoryState"] = field(default_factory=dict)
|
|
145
|
-
donedata: "DoneData | None" = None
|
|
146
|
-
invocations: List[InvokeDefinition] = field(default_factory=list)
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
@dataclass
|
|
150
|
-
class HistoryState:
|
|
151
|
-
id: str
|
|
152
|
-
type: "Literal['shallow', 'deep']" = "shallow"
|
|
153
|
-
transitions: List[Transition] = field(default_factory=list)
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
@dataclass
|
|
157
|
-
class DataItem:
|
|
158
|
-
id: str
|
|
159
|
-
src: "ParseResult | None"
|
|
160
|
-
expr: "str | None"
|
|
161
|
-
content: "str | None"
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
@dataclass
|
|
165
|
-
class DataModel:
|
|
166
|
-
data: List[DataItem] = field(default_factory=list)
|
|
167
|
-
scripts: List[ScriptAction] = field(default_factory=list)
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
@dataclass
|
|
171
|
-
class StateMachineDefinition:
|
|
172
|
-
name: "str | None" = None
|
|
173
|
-
states: Dict[str, State] = field(default_factory=dict)
|
|
174
|
-
initial_states: List[str] = field(default_factory=list)
|
|
175
|
-
datamodel: "DataModel | None" = None
|
{python_statemachine-3.1.2.dist-info → python_statemachine-3.2.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|