python-dispatch 0.2.2__tar.gz → 0.2.3__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-dispatch-0.2.2/python_dispatch.egg-info → python_dispatch-0.2.3}/PKG-INFO +16 -16
- {python-dispatch-0.2.2 → python_dispatch-0.2.3}/README.md +1 -1
- {python-dispatch-0.2.2 → python_dispatch-0.2.3}/pydispatch/aioutils.py +21 -3
- {python-dispatch-0.2.2 → python_dispatch-0.2.3}/pydispatch/dispatch.py +10 -8
- {python-dispatch-0.2.2 → python_dispatch-0.2.3}/pydispatch/utils.py +8 -2
- python_dispatch-0.2.3/pyproject.toml +84 -0
- python-dispatch-0.2.2/LICENSE.txt +0 -21
- python-dispatch-0.2.2/MANIFEST.in +0 -2
- python-dispatch-0.2.2/PKG-INFO +0 -157
- python-dispatch-0.2.2/python_dispatch.egg-info/SOURCES.txt +0 -22
- python-dispatch-0.2.2/python_dispatch.egg-info/dependency_links.txt +0 -1
- python-dispatch-0.2.2/python_dispatch.egg-info/top_level.txt +0 -1
- python-dispatch-0.2.2/setup.cfg +0 -56
- python-dispatch-0.2.2/setup.py +0 -4
- python-dispatch-0.2.2/tests/test_aio_listeners.py +0 -433
- python-dispatch-0.2.2/tests/test_aio_lock.py +0 -322
- python-dispatch-0.2.2/tests/test_events.py +0 -231
- python-dispatch-0.2.2/tests/test_global_dispatcher.py +0 -151
- python-dispatch-0.2.2/tests/test_properties.py +0 -436
- python-dispatch-0.2.2/tests/test_subclass_init.py +0 -98
- python-dispatch-0.2.2/tests/test_version_attribute.py +0 -18
- {python-dispatch-0.2.2 → python_dispatch-0.2.3}/pydispatch/__init__.py +0 -0
- {python-dispatch-0.2.2 → python_dispatch-0.2.3}/pydispatch/decorators.py +0 -0
- {python-dispatch-0.2.2 → python_dispatch-0.2.3}/pydispatch/properties.py +0 -0
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: python-dispatch
|
|
3
|
-
Version: 0.2.
|
|
4
|
-
Summary: Lightweight Event Handling
|
|
5
|
-
|
|
3
|
+
Version: 0.2.3
|
|
4
|
+
Summary: Lightweight Event Handling Library for Python
|
|
5
|
+
Keywords: event,properties,dispatch
|
|
6
6
|
Author: Matthew Reid
|
|
7
|
-
Author-email: matt@nomadic-recording.com
|
|
8
|
-
License: MIT
|
|
9
|
-
Project-URL: Documentation, https://python-dispatch.readthedocs.io
|
|
10
|
-
Project-URL: Source, https://github.com/nocarryr/python-dispatch
|
|
11
|
-
Project-URL: Tracker, https://github.com/nocarryr/python-dispatch/issues
|
|
12
|
-
Keywords: event properties dispatch
|
|
13
|
-
Platform: any
|
|
7
|
+
Author-email: Matthew Reid <matt@nomadic-recording.com>
|
|
8
|
+
License-Expression: MIT
|
|
14
9
|
Classifier: Development Status :: 3 - Alpha
|
|
15
10
|
Classifier: Intended Audience :: Developers
|
|
16
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
17
11
|
Classifier: Operating System :: OS Independent
|
|
18
12
|
Classifier: Programming Language :: Python
|
|
19
13
|
Classifier: Topic :: Software Development
|
|
20
14
|
Classifier: Programming Language :: Python :: 3
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
23
15
|
Classifier: Programming Language :: Python :: 3.8
|
|
24
16
|
Classifier: Programming Language :: Python :: 3.9
|
|
25
17
|
Classifier: Programming Language :: Python :: 3.10
|
|
26
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
27
22
|
Classifier: Topic :: Software Development :: Libraries
|
|
28
23
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Requires-Dist: importlib-metadata ; python_full_version < '3.8'
|
|
25
|
+
Requires-Python: >=3.8
|
|
26
|
+
Project-URL: Documentation, https://python-dispatch.readthedocs.io/
|
|
27
|
+
Project-URL: Download, https://pypi.org/project/python-dispatch/
|
|
28
|
+
Project-URL: Source, https://github.com/nocarryr/python-dispatch
|
|
29
|
+
Project-URL: Tracker, https://github.com/nocarryr/python-dispatch/issues
|
|
29
30
|
Description-Content-Type: text/markdown
|
|
30
|
-
License-File: LICENSE.txt
|
|
31
31
|
|
|
32
32
|
# python-dispatch
|
|
33
33
|
Lightweight event handling for Python
|
|
34
34
|
|
|
35
|
-
[](https://github.com/astral-sh/uv)[](https://coveralls.io/github/nocarryr/python-dispatch?branch=master)[](https://badge.fury.io/py/python-dispatch)[](https://raw.githubusercontent.com/nocarryr/python-dispatch/master/LICENSE.txt)
|
|
36
36
|
|
|
37
37
|
## Description
|
|
38
38
|
This is an implementation of the "Observer Pattern" with inspiration from the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# python-dispatch
|
|
2
2
|
Lightweight event handling for Python
|
|
3
3
|
|
|
4
|
-
[](https://github.com/astral-sh/uv)[](https://coveralls.io/github/nocarryr/python-dispatch?branch=master)[](https://badge.fury.io/py/python-dispatch)[](https://raw.githubusercontent.com/nocarryr/python-dispatch/master/LICENSE.txt)
|
|
5
5
|
|
|
6
6
|
## Description
|
|
7
7
|
This is an implementation of the "Observer Pattern" with inspiration from the
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
+
import sys
|
|
1
2
|
import asyncio
|
|
2
3
|
import threading
|
|
3
|
-
from
|
|
4
|
-
from
|
|
4
|
+
from weakref import ref
|
|
5
|
+
from _weakref import _remove_dead_weakref # type: ignore[import]
|
|
6
|
+
if sys.version_info < (3, 14):
|
|
7
|
+
from _weakrefset import _IterationGuard
|
|
8
|
+
else:
|
|
9
|
+
# _IterationGuard was removed in Python 3.14. We define a no-op version here
|
|
10
|
+
class _IterationGuard:
|
|
11
|
+
def __init__(self, obj):
|
|
12
|
+
pass
|
|
13
|
+
def __enter__(self):
|
|
14
|
+
pass
|
|
15
|
+
def __exit__(self, *args):
|
|
16
|
+
pass
|
|
17
|
+
|
|
5
18
|
|
|
6
19
|
from pydispatch.utils import (
|
|
7
20
|
WeakMethodContainer,
|
|
8
21
|
isfunction,
|
|
9
22
|
get_method_vars,
|
|
10
|
-
_remove_dead_weakref,
|
|
11
23
|
)
|
|
12
24
|
|
|
13
25
|
|
|
@@ -192,6 +204,12 @@ class AioWeakMethodContainer(WeakMethodContainer):
|
|
|
192
204
|
_remove_dead_weakref(self.data, wr.key)
|
|
193
205
|
self._on_weakref_fin(wr.key)
|
|
194
206
|
self._remove = remove
|
|
207
|
+
|
|
208
|
+
# `_pending_removals` and `_iterating` were removed in Python 3.14.
|
|
209
|
+
# To maintain compatibility with earlier versions, we reintroduce them here.
|
|
210
|
+
self._pending_removals = []
|
|
211
|
+
self._iterating = set()
|
|
212
|
+
|
|
195
213
|
self.event_loop_map = {}
|
|
196
214
|
def add_method(self, loop, callback):
|
|
197
215
|
"""Add a coroutine function
|
|
@@ -209,14 +209,16 @@ class Dispatcher(object):
|
|
|
209
209
|
... async def on_foo_test_event(self, *args, **kwargs):
|
|
210
210
|
... self.got_foo_event.set()
|
|
211
211
|
|
|
212
|
-
>>>
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
212
|
+
>>> async def main():
|
|
213
|
+
... loop = asyncio.get_running_loop()
|
|
214
|
+
... foo = Foo()
|
|
215
|
+
... bar = Bar()
|
|
216
|
+
... foo.bind(test_event=bar.on_foo_test_event, __aio_loop__=loop)
|
|
217
|
+
... fut = asyncio.create_task(bar.wait_for_foo())
|
|
218
|
+
... foo.emit('test_event')
|
|
219
|
+
... await fut
|
|
220
|
+
|
|
221
|
+
>>> asyncio.run(main())
|
|
220
222
|
got foo!
|
|
221
223
|
|
|
222
224
|
This can also be done using :meth:`bind_async`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import weakref
|
|
2
|
-
from weakref import ref
|
|
3
|
-
from _weakref import
|
|
2
|
+
from weakref import ref
|
|
3
|
+
from _weakref import _remove_dead_weakref # type: ignore[import]
|
|
4
4
|
import types
|
|
5
5
|
import asyncio
|
|
6
6
|
|
|
@@ -114,6 +114,12 @@ class InformativeWVDict(weakref.WeakValueDictionary):
|
|
|
114
114
|
_remove_dead_weakref(self.data, wr.key)
|
|
115
115
|
self._data_del_callback(wr.key)
|
|
116
116
|
self._remove = remove
|
|
117
|
+
|
|
118
|
+
# `_pending_removals` and `_iterating` were removed in Python 3.14.
|
|
119
|
+
# To maintain compatibility with earlier versions, we reintroduce them here.
|
|
120
|
+
self._pending_removals = []
|
|
121
|
+
self._iterating = set()
|
|
122
|
+
|
|
117
123
|
self.data = InformativeDict()
|
|
118
124
|
self.data.del_callback = self._data_del_callback
|
|
119
125
|
def _data_del_callback(self, key):
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
|
|
2
|
+
[project]
|
|
3
|
+
name = "python-dispatch"
|
|
4
|
+
version = "0.2.3"
|
|
5
|
+
description = "Lightweight Event Handling Library for Python"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "Matthew Reid", email = "matt@nomadic-recording.com" }
|
|
8
|
+
]
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
keywords = ["event", "properties", "dispatch"]
|
|
12
|
+
requires-python = ">=3.8"
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 3 - Alpha",
|
|
15
|
+
"Intended Audience :: Developers",
|
|
16
|
+
"Operating System :: OS Independent",
|
|
17
|
+
"Programming Language :: Python",
|
|
18
|
+
"Topic :: Software Development",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.8",
|
|
21
|
+
"Programming Language :: Python :: 3.9",
|
|
22
|
+
"Programming Language :: Python :: 3.10",
|
|
23
|
+
"Programming Language :: Python :: 3.11",
|
|
24
|
+
"Programming Language :: Python :: 3.12",
|
|
25
|
+
"Programming Language :: Python :: 3.13",
|
|
26
|
+
"Programming Language :: Python :: 3.14",
|
|
27
|
+
"Topic :: Software Development :: Libraries",
|
|
28
|
+
"Topic :: Software Development :: Libraries :: Python Modules"
|
|
29
|
+
]
|
|
30
|
+
dependencies = [
|
|
31
|
+
"importlib-metadata; python_version < '3.8'"
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
[project.urls]
|
|
36
|
+
Documentation = "https://python-dispatch.readthedocs.io/"
|
|
37
|
+
Source = "https://github.com/nocarryr/python-dispatch"
|
|
38
|
+
Download = "https://pypi.org/project/python-dispatch/"
|
|
39
|
+
Tracker = "https://github.com/nocarryr/python-dispatch/issues"
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
[build-system]
|
|
43
|
+
requires = ["uv_build>=0.9.16,<0.10.0"]
|
|
44
|
+
build-backend = "uv_build"
|
|
45
|
+
|
|
46
|
+
[tool.uv.build-backend]
|
|
47
|
+
module-root = ""
|
|
48
|
+
module-name = "pydispatch"
|
|
49
|
+
|
|
50
|
+
[tool.uv.sources]
|
|
51
|
+
python-dispatch-sphinx = { path = "sphinx-plugin", package = false }
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
[tool.pytest.ini_options]
|
|
55
|
+
testpaths = ["tests", "doc", "pydispatch"]
|
|
56
|
+
addopts = "--doctest-modules --doctest-glob='*.rst' --doctest-glob='*.md'"
|
|
57
|
+
doctest_plus = "enabled"
|
|
58
|
+
asyncio_mode = "auto"
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
[dependency-groups]
|
|
62
|
+
doc = [
|
|
63
|
+
"furo>=2022.4.7",
|
|
64
|
+
"m2r2>=0.3.2",
|
|
65
|
+
"setuptools>=60.2.0",
|
|
66
|
+
"sphinx<5.0.0",
|
|
67
|
+
"sphinx-panels>=0.6.0",
|
|
68
|
+
"sphinx-rst-builder>=0.0.3",
|
|
69
|
+
"sphinx-rtd-theme>=1.3.0",
|
|
70
|
+
]
|
|
71
|
+
test = [
|
|
72
|
+
{include-group = "doc"},
|
|
73
|
+
"coveralls>=3.3.1",
|
|
74
|
+
"pytest>=7.0.1",
|
|
75
|
+
"pytest-asyncio>=0.16.0",
|
|
76
|
+
"pytest-cov>=4.0.0",
|
|
77
|
+
"pytest-doctestplus>=0.9.0",
|
|
78
|
+
"tomli; python_version < '3.11'",
|
|
79
|
+
]
|
|
80
|
+
|
|
81
|
+
dev = [
|
|
82
|
+
{include-group = "test"},
|
|
83
|
+
"python-dispatch-sphinx",
|
|
84
|
+
]
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2016 Matthew Reid
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
python-dispatch-0.2.2/PKG-INFO
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: python-dispatch
|
|
3
|
-
Version: 0.2.2
|
|
4
|
-
Summary: Lightweight Event Handling
|
|
5
|
-
Home-page: https://github.com/nocarryr/python-dispatch
|
|
6
|
-
Author: Matthew Reid
|
|
7
|
-
Author-email: matt@nomadic-recording.com
|
|
8
|
-
License: MIT
|
|
9
|
-
Project-URL: Documentation, https://python-dispatch.readthedocs.io
|
|
10
|
-
Project-URL: Source, https://github.com/nocarryr/python-dispatch
|
|
11
|
-
Project-URL: Tracker, https://github.com/nocarryr/python-dispatch/issues
|
|
12
|
-
Keywords: event properties dispatch
|
|
13
|
-
Platform: any
|
|
14
|
-
Classifier: Development Status :: 3 - Alpha
|
|
15
|
-
Classifier: Intended Audience :: Developers
|
|
16
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
-
Classifier: Operating System :: OS Independent
|
|
18
|
-
Classifier: Programming Language :: Python
|
|
19
|
-
Classifier: Topic :: Software Development
|
|
20
|
-
Classifier: Programming Language :: Python :: 3
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
24
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
25
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
26
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
27
|
-
Classifier: Topic :: Software Development :: Libraries
|
|
28
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
29
|
-
Description-Content-Type: text/markdown
|
|
30
|
-
License-File: LICENSE.txt
|
|
31
|
-
|
|
32
|
-
# python-dispatch
|
|
33
|
-
Lightweight event handling for Python
|
|
34
|
-
|
|
35
|
-
[](https://travis-ci.org/nocarryr/python-dispatch)[](https://coveralls.io/github/nocarryr/python-dispatch?branch=master)[](https://badge.fury.io/py/python-dispatch)[](https://raw.githubusercontent.com/nocarryr/python-dispatch/master/LICENSE.txt)
|
|
36
|
-
|
|
37
|
-
## Description
|
|
38
|
-
This is an implementation of the "Observer Pattern" with inspiration from the
|
|
39
|
-
[Kivy](kivy.org) framework. Many of the features though are intentionally
|
|
40
|
-
stripped down and more generalized. The goal is to have a simple drop-in
|
|
41
|
-
library with no dependencies that stays out of the programmer's way.
|
|
42
|
-
|
|
43
|
-
## Installation
|
|
44
|
-
"python-dispatch" is available on [PyPI](https://pypi.org/project/python-dispatch/)
|
|
45
|
-
and can be installed using pip:
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
pip install python-dispatch
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Python Requirements
|
|
52
|
-
After version `0.1` of this project, only Python 3.6 and above will be supported.
|
|
53
|
-
If using an older Python version, the older releases should still be available
|
|
54
|
-
on PyPI and the correct package should be chosen automatically by `pip`.
|
|
55
|
-
If not, either upgrade `pip` and `setuptools`:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
pip install -U pip setuptools
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Or specify the version manually:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
pip install python-dispatch<0.2
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Links
|
|
68
|
-
|
|
69
|
-
| | |
|
|
70
|
-
| -------------:|:-------------------------------------------- |
|
|
71
|
-
| Project Home | https://github.com/nocarryr/python-dispatch |
|
|
72
|
-
| PyPI | https://pypi.python.org/pypi/python-dispatch |
|
|
73
|
-
| Documentation | https://python-dispatch.readthedocs.io |
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
## Usage
|
|
77
|
-
|
|
78
|
-
### Events
|
|
79
|
-
|
|
80
|
-
```python
|
|
81
|
-
>>> from pydispatch import Dispatcher
|
|
82
|
-
|
|
83
|
-
>>> class MyEmitter(Dispatcher):
|
|
84
|
-
... # Events are defined in classes and subclasses with the '_events_' attribute
|
|
85
|
-
... _events_ = ['on_state', 'new_data']
|
|
86
|
-
... def do_some_stuff(self):
|
|
87
|
-
... # do stuff that makes new data
|
|
88
|
-
... data = {'foo':'bar'}
|
|
89
|
-
... # Then emit the change with optional positional and keyword arguments
|
|
90
|
-
... self.emit('new_data', data=data)
|
|
91
|
-
|
|
92
|
-
>>> # An observer - could inherit from Dispatcher or any other class
|
|
93
|
-
>>> class MyListener(object):
|
|
94
|
-
... def on_new_data(self, *args, **kwargs):
|
|
95
|
-
... data = kwargs.get('data')
|
|
96
|
-
... print('I got data: {}'.format(data))
|
|
97
|
-
... def on_emitter_state(self, *args, **kwargs):
|
|
98
|
-
... print('emitter state changed')
|
|
99
|
-
|
|
100
|
-
>>> emitter = MyEmitter()
|
|
101
|
-
>>> listener = MyListener()
|
|
102
|
-
|
|
103
|
-
>>> # Bind to the "on_state" and "new_data" events of emitter
|
|
104
|
-
>>> emitter.bind(on_state=listener.on_emitter_state)
|
|
105
|
-
>>> emitter.bind(new_data=listener.on_new_data)
|
|
106
|
-
|
|
107
|
-
>>> emitter.do_some_stuff()
|
|
108
|
-
I got data: {'foo': 'bar'}
|
|
109
|
-
>>> emitter.emit('on_state')
|
|
110
|
-
emitter state changed
|
|
111
|
-
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Properties
|
|
115
|
-
|
|
116
|
-
```python
|
|
117
|
-
>>> from pydispatch import Dispatcher, Property
|
|
118
|
-
|
|
119
|
-
>>> class MyEmitter(Dispatcher):
|
|
120
|
-
... # Property objects are defined and named at the class level.
|
|
121
|
-
... # They will become instance attributes that will emit events when their values change
|
|
122
|
-
... name = Property()
|
|
123
|
-
... value = Property()
|
|
124
|
-
|
|
125
|
-
>>> class MyListener(object):
|
|
126
|
-
... def on_name(self, instance, value, **kwargs):
|
|
127
|
-
... print('emitter name is {}'.format(value))
|
|
128
|
-
... def on_value(self, instance, value, **kwargs):
|
|
129
|
-
... print('emitter value is {}'.format(value))
|
|
130
|
-
|
|
131
|
-
>>> emitter = MyEmitter()
|
|
132
|
-
>>> listener = MyListener()
|
|
133
|
-
|
|
134
|
-
>>> # Bind to the "name" and "value" properties of emitter
|
|
135
|
-
>>> emitter.bind(name=listener.on_name, value=listener.on_value)
|
|
136
|
-
|
|
137
|
-
>>> # Set emitter.name property (triggering the on_name callback)
|
|
138
|
-
>>> emitter.name = 'foo'
|
|
139
|
-
emitter name is foo
|
|
140
|
-
|
|
141
|
-
>>> # Set emitter.value (triggering the on_value callback)
|
|
142
|
-
>>> emitter.value = 42
|
|
143
|
-
emitter value is 42
|
|
144
|
-
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
## Contributing
|
|
148
|
-
|
|
149
|
-
Contributions are welcome!
|
|
150
|
-
|
|
151
|
-
If you want to contribute through code or documentation, please see the
|
|
152
|
-
[Contributing Guide](CONTRIBUTING.md) for information.
|
|
153
|
-
|
|
154
|
-
## License
|
|
155
|
-
|
|
156
|
-
This project is released under the MIT License. See the [LICENSE](LICENSE.txt) file
|
|
157
|
-
for more information.
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
LICENSE.txt
|
|
2
|
-
MANIFEST.in
|
|
3
|
-
README.md
|
|
4
|
-
setup.cfg
|
|
5
|
-
setup.py
|
|
6
|
-
pydispatch/__init__.py
|
|
7
|
-
pydispatch/aioutils.py
|
|
8
|
-
pydispatch/decorators.py
|
|
9
|
-
pydispatch/dispatch.py
|
|
10
|
-
pydispatch/properties.py
|
|
11
|
-
pydispatch/utils.py
|
|
12
|
-
python_dispatch.egg-info/PKG-INFO
|
|
13
|
-
python_dispatch.egg-info/SOURCES.txt
|
|
14
|
-
python_dispatch.egg-info/dependency_links.txt
|
|
15
|
-
python_dispatch.egg-info/top_level.txt
|
|
16
|
-
tests/test_aio_listeners.py
|
|
17
|
-
tests/test_aio_lock.py
|
|
18
|
-
tests/test_events.py
|
|
19
|
-
tests/test_global_dispatcher.py
|
|
20
|
-
tests/test_properties.py
|
|
21
|
-
tests/test_subclass_init.py
|
|
22
|
-
tests/test_version_attribute.py
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
pydispatch
|
python-dispatch-0.2.2/setup.cfg
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
[metadata]
|
|
2
|
-
name = python-dispatch
|
|
3
|
-
version = 0.2.2
|
|
4
|
-
author = Matthew Reid
|
|
5
|
-
author_email = matt@nomadic-recording.com
|
|
6
|
-
url = https://github.com/nocarryr/python-dispatch
|
|
7
|
-
project_urls =
|
|
8
|
-
Documentation = https://python-dispatch.readthedocs.io
|
|
9
|
-
Source = https://github.com/nocarryr/python-dispatch
|
|
10
|
-
Tracker = https://github.com/nocarryr/python-dispatch/issues
|
|
11
|
-
description = Lightweight Event Handling
|
|
12
|
-
long_description = file: README.md
|
|
13
|
-
long_description_content_type = text/markdown
|
|
14
|
-
license = MIT
|
|
15
|
-
license_file = LICENSE.txt
|
|
16
|
-
keywords = event properties dispatch
|
|
17
|
-
platforms = any
|
|
18
|
-
python_requires = >=3.6
|
|
19
|
-
install_requires =
|
|
20
|
-
importlib_metadata;python_version<'3.8'
|
|
21
|
-
classifiers =
|
|
22
|
-
Development Status :: 3 - Alpha
|
|
23
|
-
Intended Audience :: Developers
|
|
24
|
-
License :: OSI Approved :: MIT License
|
|
25
|
-
Operating System :: OS Independent
|
|
26
|
-
Programming Language :: Python
|
|
27
|
-
Topic :: Software Development
|
|
28
|
-
Programming Language :: Python :: 3
|
|
29
|
-
Programming Language :: Python :: 3.6
|
|
30
|
-
Programming Language :: Python :: 3.7
|
|
31
|
-
Programming Language :: Python :: 3.8
|
|
32
|
-
Programming Language :: Python :: 3.9
|
|
33
|
-
Programming Language :: Python :: 3.10
|
|
34
|
-
Programming Language :: Python :: 3.11
|
|
35
|
-
Topic :: Software Development :: Libraries
|
|
36
|
-
Topic :: Software Development :: Libraries :: Python Modules
|
|
37
|
-
|
|
38
|
-
[options]
|
|
39
|
-
packages = find:
|
|
40
|
-
|
|
41
|
-
[options.packages.find]
|
|
42
|
-
exclude = tests
|
|
43
|
-
|
|
44
|
-
[options.package_data]
|
|
45
|
-
* = LICENSE*, README*
|
|
46
|
-
|
|
47
|
-
[tool:pytest]
|
|
48
|
-
testpaths = tests doc pydispatch
|
|
49
|
-
addopts = --doctest-modules --doctest-glob="*.rst" --doctest-glob="*.md"
|
|
50
|
-
doctest_plus = enabled
|
|
51
|
-
asyncio_mode = auto
|
|
52
|
-
|
|
53
|
-
[egg_info]
|
|
54
|
-
tag_build =
|
|
55
|
-
tag_date = 0
|
|
56
|
-
|
python-dispatch-0.2.2/setup.py
DELETED