python-statemachine 2.3.0__tar.gz → 2.3.1__tar.gz
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-2.3.0 → python_statemachine-2.3.1}/PKG-INFO +2 -2
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/README.md +1 -1
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/pyproject.toml +1 -1
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/__init__.py +1 -1
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/utils.py +10 -4
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/LICENSE +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/callbacks.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/contrib/__init__.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/contrib/diagram.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/dispatcher.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/event.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/event_data.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/events.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/exceptions.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/factory.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/graph.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/i18n.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/locale/en/LC_MESSAGES/statemachine.po +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/locale/pt_BR/LC_MESSAGES/statemachine.po +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/mixins.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/model.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/registry.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/signature.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/state.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/statemachine.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/states.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/transition.py +0 -0
- {python_statemachine-2.3.0 → python_statemachine-2.3.1}/statemachine/transition_list.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-statemachine
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.1
|
|
4
4
|
Summary: Python Finite State Machines made easy.
|
|
5
5
|
Home-page: https://github.com/fgmacedo/python-statemachine
|
|
6
6
|
License: MIT
|
|
@@ -43,7 +43,7 @@ Python [finite-state machines](https://en.wikipedia.org/wiki/Finite-state_machin
|
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
Welcome to python-statemachine, an intuitive and powerful state machine library designed for a
|
|
46
|
-
great developer experience. We provide
|
|
46
|
+
great developer experience. We provide a _pythonic_ and expressive API for implementing state
|
|
47
47
|
machines in sync or asynchonous Python codebases.
|
|
48
48
|
|
|
49
49
|
## Features
|
|
@@ -17,7 +17,7 @@ Python [finite-state machines](https://en.wikipedia.org/wiki/Finite-state_machin
|
|
|
17
17
|
</div>
|
|
18
18
|
|
|
19
19
|
Welcome to python-statemachine, an intuitive and powerful state machine library designed for a
|
|
20
|
-
great developer experience. We provide
|
|
20
|
+
great developer experience. We provide a _pythonic_ and expressive API for implementing state
|
|
21
21
|
machines in sync or asynchonous Python codebases.
|
|
22
22
|
|
|
23
23
|
## Features
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
+
import threading
|
|
3
|
+
|
|
4
|
+
_cached_loop = threading.local()
|
|
5
|
+
"""Loop that will be used when the SM is running in a synchronous context. One loop per thread."""
|
|
2
6
|
|
|
3
7
|
|
|
4
8
|
def qualname(cls):
|
|
@@ -23,11 +27,13 @@ def ensure_iterable(obj):
|
|
|
23
27
|
|
|
24
28
|
def run_async_from_sync(coroutine):
|
|
25
29
|
"""
|
|
26
|
-
|
|
30
|
+
Compatibility layer to run an async coroutine from a synchronous context.
|
|
27
31
|
"""
|
|
32
|
+
global _cached_loop
|
|
28
33
|
try:
|
|
29
|
-
|
|
34
|
+
asyncio.get_running_loop()
|
|
30
35
|
return asyncio.ensure_future(coroutine)
|
|
31
36
|
except RuntimeError:
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
if not hasattr(_cached_loop, "loop"):
|
|
38
|
+
_cached_loop.loop = asyncio.new_event_loop()
|
|
39
|
+
return _cached_loop.loop.run_until_complete(coroutine)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|