-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Help text for just shell and just console * Install sphinx and myst-parser * Sphinxbuild hooked into justfile * Properly generating a man page * Remove myst-parser from dev deps * Clean up man page copy a little
- Loading branch information
Showing
7 changed files
with
245 additions
and
94 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 |
---|---|---|
|
@@ -13,3 +13,5 @@ scratchpad.ipynb | |
.tox/ | ||
node_modules | ||
venv | ||
site | ||
_build |
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,22 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
|
||
# pyee uses mkdocs for its primary documentation. However, it uses sphinx to | ||
# generate a man page. | ||
|
||
# For the full list of built-in configuration values, see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
import toml | ||
|
||
with open("../pyproject.toml", "r") as f: | ||
pyproject_toml = toml.load(f) | ||
|
||
project = "pyee" | ||
copyright = "2023, Josh Holbrook" | ||
author = "Josh Holbrook" | ||
release = f'v{pyproject_toml["project"]["version"]}' | ||
|
||
templates_path = ["_templates"] | ||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "index.md"] | ||
|
||
root_doc = "man" |
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,70 @@ | ||
pyee | ||
==== | ||
|
||
pyee is a rough port of | ||
`node.js's EventEmitter <https://nodejs.org/api/events.html>`_. Unlike its | ||
namesake, it includes a number of subclasses useful for implementing async | ||
and threaded programming in python, such as async/await as seen in python 3.5+. | ||
|
||
Install | ||
------- | ||
|
||
You can install this project into your environment of choice using ``pip``:: | ||
|
||
pip install pyee | ||
|
||
Usage | ||
----- | ||
|
||
pyee supplies a ``EventEmitter`` class that is similar to the | ||
``EventEmitter`` class from Node.js. In addition, it supplies subclasses for | ||
``asyncio``, ``twisted``, ``concurrent.futures`` and ``trio``, as supported | ||
by the environment. | ||
|
||
|
||
Example | ||
------- | ||
|
||
:: | ||
|
||
In [1]: from pyee.base import EventEmitter | ||
|
||
In [2]: ee = EventEmitter() | ||
|
||
In [3]: @ee.on('event') | ||
...: def event_handler(): | ||
...: print('BANG BANG') | ||
...: | ||
|
||
In [4]: ee.emit('event') | ||
BANG BANG | ||
|
||
In [5]: | ||
|
||
|
||
API | ||
--- | ||
|
||
pyee contains a number of modules, each intended for a different concurrency | ||
paradigm or framework: | ||
|
||
- ``pyee`` - synchronous ``EventEmitter``, like Node.js | ||
- ``pyee.asyncio`` - asyncio support | ||
- ``pyee.twisted`` - twisted support | ||
- ``pyee.executor`` - concurrent.futures support | ||
- ``pyee.trio`` - trio support | ||
|
||
In addition, it contains two experimental modules: | ||
|
||
- ``pyee.uplift`` - support for "uplifting" event emitters from one paradigm | ||
to another - ie., adopting synchronous event emitters for use with asyncio | ||
- ``pyee.cls`` - support for "evented classes", which call class methods on | ||
events | ||
|
||
For in-depth API documentation, visit `the docs on readthedocs.io <https://pyee.rtfd.io>`_. | ||
|
||
Links | ||
----- | ||
|
||
* `Fork Me On GitHub! <https://github.com/jfhbrook/pyee>`_ | ||
* `The Docs on readthedocs.io <https://pyee.rtfd.io>`_ |
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
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
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
Oops, something went wrong.