From 61ff43722fa1b2377712be2888a44585c8df9cbf Mon Sep 17 00:00:00 2001 From: "Sam G." Date: Tue, 14 May 2024 15:49:23 -0700 Subject: [PATCH] clean up repo files, README, auxiliary files (pre-BFG) --- .gitignore | 5 +++++ README.md | 22 +++++++++++++++++----- docs/Makefile | 20 ++++++++++++++++++++ execlog/listener.py | 1 - execlog/listeners/__init__.py | 4 ---- pyproject.toml | 2 +- 6 files changed, 43 insertions(+), 11 deletions(-) create mode 100644 docs/Makefile diff --git a/.gitignore b/.gitignore index 78c4f94..4ceb80c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ __pycache__/ *.egg-info/ .ipynb_checkpoints/ .python-version +.pytest_cache # vendor and build files dist/ @@ -11,3 +12,7 @@ build/ docs/_autoref/ docs/_autosummary/ docs/_build/ + +# local +notebooks/ +/Makefile diff --git a/README.md b/README.md index 96ccac4..2dbbc9e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,19 @@ # Overview -`execlog` is a lightweight multi-threaded job framework +`execlog` is a lightweight multi-threaded job framework written in Python. It implements a +simple event-based model over core Python utilities like `ThreadPoolExecutor` to +facilitate reactivity and manage concurrent responses. -- **Handler**: live-reload handshake manager for connecting pages -- **Listener**: -- **Router** -- **Server**: +There are a few top-level classes exposed by the package: + +- **Router**: Central event routing object. Routers facilitate route registration, + allowing for _pattern_-based matching of _events_ to arbitrary _callback_ functions. For + example, you could have a function that converts a PDF file to a collection images + (_callback_), and want this function to be called for a new files (_event_) that match + the glob `*.pdf` (_pattern_). +- **Listener**: Connective event listening object, often created directly by router + instances. Listeners pay attention to events arising along registered routes of an + affiliated router, passing them through (after optional delays, debouncing, filtering, + etc). In the above example, the associated `Listener` instance might wrap a tool like + iNotify to dynamically respond to file events. +- **Server**: Long-running process manager for listeners and optional live-reloading via + HTTP. Interfaces with listener `start()` and `shutdown()` for graceful interruption. diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d4bb2cb --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/execlog/listener.py b/execlog/listener.py index 5aff47d..78807f2 100644 --- a/execlog/listener.py +++ b/execlog/listener.py @@ -1,5 +1,4 @@ ''' - See also: - https://inotify-simple.readthedocs.io/en/latest/#gracefully-exit-a-blocking-read diff --git a/execlog/listeners/__init__.py b/execlog/listeners/__init__.py index 2ef9507..0d01181 100644 --- a/execlog/listeners/__init__.py +++ b/execlog/listeners/__init__.py @@ -1,5 +1 @@ -''' -Thing -''' - from execlog.listeners.path import PathListener diff --git a/pyproject.toml b/pyproject.toml index e605e99..472be41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "execlog" -version = "0.1.1" +version = "0.4.1" authors = [ { name="Sam Griesemer", email="samgriesemer@gmail.com" }, ]