-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: explain how project works on README
- Loading branch information
1 parent
9321b05
commit 2a48f9e
Showing
5 changed files
with
53 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
deploy: | ||
python setup.py sdist | ||
twine upload dist/* | ||
|
||
test: | ||
coverage run -m unittest discover | ||
coverage html | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
======================== | ||
OnAny... thing happening | ||
======================== | ||
|
||
OnAny is a simple yet powerful event manager library, where you can declare listeners and dispatch as much events as needed to them. | ||
|
||
How To | ||
====== | ||
To listen and dispatch events is very simple: | ||
|
||
.. code :: python | ||
from onany import dispatch, listener | ||
@listener("event.name") | ||
def on_event_name(*args, **kwargs): | ||
print("I've been called with {} and {}".format( | ||
args, | ||
kwargs | ||
)) | ||
>>> dispatch( | ||
"event.name", | ||
"first_param", | ||
"second_param", | ||
"third_param", | ||
first="param", | ||
second="param", | ||
third="param") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from onany import dispatch, listener | ||
|
||
|
||
@listener("event.name") | ||
def on_event_name(*args, **kwargs): | ||
print("I've been called with {} and {}".format( | ||
args, | ||
kwargs | ||
)) | ||
|
||
dispatch( | ||
"event.name", | ||
"first_param", | ||
"second_param", | ||
"third_param", | ||
first="param", | ||
second="param", | ||
third="param") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters