Skip to content

Commit

Permalink
docs: explain how project works on README
Browse files Browse the repository at this point in the history
  • Loading branch information
vinyguedess committed May 8, 2020
1 parent 9321b05 commit 2a48f9e
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Makefile
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
Expand Down
1 change: 0 additions & 1 deletion README.md

This file was deleted.

29 changes: 29 additions & 0 deletions README.rst
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")
18 changes: 18 additions & 0 deletions docs/examples/main.py
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")
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
from setuptools import setup


with open(os.path.join("README.md")) as file:
with open(os.path.join("README.rst")) as file:
readme = file.read()


setup(
name="onany",
packages=["onany"],
version="0.1.0",
version="0.1.2",
license="MIT",
description="Event manager library",
long_description=readme,
Expand Down

0 comments on commit 2a48f9e

Please sign in to comment.