python-statemachine 2.3.4__py3-none-any.whl → 2.3.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-statemachine
3
- Version: 2.3.4
3
+ Version: 2.3.6
4
4
  Summary: Python Finite State Machines made easy.
5
5
  Home-page: https://github.com/fgmacedo/python-statemachine
6
6
  License: MIT
@@ -20,8 +20,10 @@ Classifier: Programming Language :: Python :: 3.9
20
20
  Classifier: Programming Language :: Python :: 3.10
21
21
  Classifier: Programming Language :: Python :: 3.11
22
22
  Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
23
24
  Classifier: Topic :: Software Development :: Libraries
24
25
  Provides-Extra: diagrams
26
+ Requires-Dist: pydot (>=2.0.0) ; extra == "diagrams"
25
27
  Description-Content-Type: text/markdown
26
28
 
27
29
  # Python StateMachine
@@ -1,11 +1,11 @@
1
- statemachine/__init__.py,sha256=adVlL_-BcysTOCiwLuk9ETvy23vCnxMDRioFAadkeZ4,192
1
+ statemachine/__init__.py,sha256=_tQlx-C4SHRysuQwRTIU3c9C8MJrDlvIVCG0kfuWFBk,192
2
2
  statemachine/callbacks.py,sha256=5_WaILrjUvZOYX_LQe4Gd8nsCvkErjw9DaHYG_ggvxs,11101
3
3
  statemachine/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- statemachine/contrib/diagram.py,sha256=JJx52yZqgDNIebvcUJ82IGT4EyerXQmOcF5mR21_kao,7198
4
+ statemachine/contrib/diagram.py,sha256=eK3unncEXNq3e_yfBTZmvgdWWWDZq69r7gsHvCHr5Ys,7208
5
5
  statemachine/dispatcher.py,sha256=2DtjCj_kiDF2uk_EEvXxs5NTABOvCr4paxVz77s6mXA,5365
6
6
  statemachine/engines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- statemachine/engines/async_.py,sha256=Z-AS4zQ2xDj2uexJ7fepQTSaw5PjqesemWGXX9g0rpU,5546
8
- statemachine/engines/sync.py,sha256=bYCyzoYo03LLfxzUl2XyyNlmMmxDLn_w0AMa5IHCF3U,5497
7
+ statemachine/engines/async_.py,sha256=deZ5oYeoIYX9zOsFEOCT4KXsz5V1F9fbaMDOBATnTkE,5572
8
+ statemachine/engines/sync.py,sha256=cGy23Ivx0Ul4NWSix8E8PNA1Ji4V9qvOd3K_yodD_UI,5523
9
9
  statemachine/event.py,sha256=LfvO-imBVyVX6krBK0Pz7q-iTRudo_5OjTFaYJpc6IQ,1556
10
10
  statemachine/event_data.py,sha256=x9m9Q2q-78kVFnJVJmOAwq6lo9zgSVxko3q4Omwjqxk,2228
11
11
  statemachine/events.py,sha256=QgXcxu25WkUaxJvonh0K7hOlYYSQlV0jbhTCAi_gpwc,736
@@ -17,15 +17,16 @@ statemachine/locale/en/LC_MESSAGES/statemachine.po,sha256=zJYaV2DxrHdPngDOt1bji8
17
17
  statemachine/locale/pt_BR/LC_MESSAGES/statemachine.po,sha256=SPrt-KaCBCKQq7PoOMtyyqU1bihrw_3MPL_NbqZzTVs,3214
18
18
  statemachine/mixins.py,sha256=Y1fa52Cj20JaGkyNk3P7Gpqkt4cGTjJ0YyV_VQyCl0M,1231
19
19
  statemachine/model.py,sha256=OylI3FjMiHpYyDl9mtK1zEJMeSvemaN4giQDonpc8kI,211
20
+ statemachine/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
21
  statemachine/registry.py,sha256=HmV9sUGkYVrNUZxJYoZo-trSUis7dIun_WcGktblgc8,922
21
22
  statemachine/signature.py,sha256=HwuyWX3p_GZwKKrGbt9wk4-bHpymqs_pgqW7OlDgGRc,7877
22
23
  statemachine/state.py,sha256=IKdkMBkXCgcvswMKQZ-hn0-739Hhf6z6q8mSEoevV7o,8262
23
- statemachine/statemachine.py,sha256=WgI4LbnOyOBl8OZqBXFRYETtt8rQi0XEhQN-D_2oMFM,11536
24
+ statemachine/statemachine.py,sha256=IvvQ9NKQAdfMXD5xc7Henvy3YrLd5vjN1APG-WnhmlM,11574
24
25
  statemachine/states.py,sha256=vpRNjiGmTDHvE0fn0gwdq8-WcG32n4ZiPTU-kgZ73rc,4870
25
26
  statemachine/transition.py,sha256=R7gfSZjqR59OIdpKePgdr66zTp5azow-tDqqYJsECR4,4711
26
27
  statemachine/transition_list.py,sha256=_tdFD1O7hw8xVAU6nRYmGrj6TCAM0SD-Sa0_DYKa88Y,6034
27
28
  statemachine/utils.py,sha256=DpcrGqlbrnT-ogh-BogG0L07EG3KirHOsKORHlspDlI,1041
28
- python_statemachine-2.3.4.dist-info/LICENSE,sha256=zcP7TsJMqaFxuTvLRZPT7nJl3_ppjxR9Z76BE9pL5zc,1074
29
- python_statemachine-2.3.4.dist-info/METADATA,sha256=Sn9ueboV6iqunRJjBB5VtyxuD1UJyTk8f002WFzWwM4,13932
30
- python_statemachine-2.3.4.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
31
- python_statemachine-2.3.4.dist-info/RECORD,,
29
+ python_statemachine-2.3.6.dist-info/LICENSE,sha256=zcP7TsJMqaFxuTvLRZPT7nJl3_ppjxR9Z76BE9pL5zc,1074
30
+ python_statemachine-2.3.6.dist-info/METADATA,sha256=Ozs8cZly2wGdAlvS144fRCe_umkG6lbqGpJHZxgpihc,14036
31
+ python_statemachine-2.3.6.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
32
+ python_statemachine-2.3.6.dist-info/RECORD,,
statemachine/__init__.py CHANGED
@@ -3,6 +3,6 @@ from .statemachine import StateMachine
3
3
 
4
4
  __author__ = """Fernando Macedo"""
5
5
  __email__ = "fgmacedo@gmail.com"
6
- __version__ = "2.3.4"
6
+ __version__ = "2.3.6"
7
7
 
8
8
  __all__ = ["StateMachine", "State"]
@@ -18,16 +18,16 @@ class DotGraphMachine:
18
18
  font_name = "Arial"
19
19
  """Graph font face name"""
20
20
 
21
- state_font_size = "10pt"
22
- """State font size"""
21
+ state_font_size = "10"
22
+ """State font size in points"""
23
23
 
24
24
  state_active_penwidth = 2
25
25
  """Active state external line width"""
26
26
 
27
27
  state_active_fillcolor = "turquoise"
28
28
 
29
- transition_font_size = "9pt"
30
- """Transition font size"""
29
+ transition_font_size = "9"
30
+ """Transition font size in points"""
31
31
 
32
32
  def __init__(self, machine):
33
33
  self.machine = machine
@@ -48,7 +48,7 @@ class DotGraphMachine:
48
48
  "i",
49
49
  shape="circle",
50
50
  style="filled",
51
- fontsize="1pt",
51
+ fontsize="1",
52
52
  fixedsize="true",
53
53
  width=0.2,
54
54
  height=0.2,
@@ -167,7 +167,7 @@ def quickchart_write_svg(sm: StateMachine, path: str):
167
167
  >>> print(sm._graph().to_string())
168
168
  digraph list {
169
169
  fontname=Arial;
170
- fontsize="10pt";
170
+ fontsize=10;
171
171
  label=OrderControl;
172
172
  rankdir=LR;
173
173
  ...
@@ -15,6 +15,7 @@ if TYPE_CHECKING:
15
15
 
16
16
  class AsyncEngine:
17
17
  def __init__(self, sm: "StateMachine", rtc: bool = True):
18
+ sm._engine = self
18
19
  self.sm = proxy(sm)
19
20
  self._sentinel = object()
20
21
  if not rtc:
@@ -13,6 +13,7 @@ if TYPE_CHECKING:
13
13
 
14
14
  class SyncEngine:
15
15
  def __init__(self, sm: "StateMachine", rtc: bool = True):
16
+ sm._engine = self
16
17
  self.sm = proxy(sm)
17
18
  self._sentinel = object()
18
19
  self._rtc = rtc
statemachine/py.typed ADDED
File without changes
@@ -105,13 +105,14 @@ class StateMachine(metaclass=StateMachineMetaclass):
105
105
  )
106
106
  self._put_nonblocking(trigger_data)
107
107
 
108
- self._engine = self._get_engine(rtc)
108
+ self._engine: AsyncEngine | SyncEngine | None = None
109
+ self._select_engine(rtc)
109
110
 
110
- def _get_engine(self, rtc: bool):
111
+ def _select_engine(self, rtc: bool):
111
112
  if self._callbacks_registry.has_async_callbacks:
112
- return AsyncEngine(self, rtc=rtc)
113
+ AsyncEngine(self, rtc=rtc)
113
114
  else:
114
- return SyncEngine(self, rtc=rtc)
115
+ SyncEngine(self, rtc=rtc)
115
116
 
116
117
  def activate_initial_state(self):
117
118
  result = self._engine.activate_initial_state()