First commit, basic config (with db) and app handler
this has 100% test coverage and i intend to keep it that way. api docs have a good start but still need narrative. several more things must be added before i can seriously consider incorporating into rattail but this seemed a good save point
This commit is contained in:
commit
5c3c42d6b3
36 changed files with 3322 additions and 0 deletions
20
docs/Makefile
Normal file
20
docs/Makefile
Normal file
|
@ -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)
|
12
docs/api/index.rst
Normal file
12
docs/api/index.rst
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
Package API
|
||||
===========
|
||||
|
||||
This is the "raw" API documentation for the ``wuttjamaican`` package. It hopefully
|
||||
contains all pertinent info regarding available functions, classes and their
|
||||
attributes and method signatures etc.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
wuttjamaican/index
|
6
docs/api/wuttjamaican/app.rst
Normal file
6
docs/api/wuttjamaican/app.rst
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
``wuttjamaican.app``
|
||||
====================
|
||||
|
||||
.. automodule:: wuttjamaican.app
|
||||
:members:
|
6
docs/api/wuttjamaican/conf.rst
Normal file
6
docs/api/wuttjamaican/conf.rst
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
``wuttjamaican.conf``
|
||||
=====================
|
||||
|
||||
.. automodule:: wuttjamaican.conf
|
||||
:members:
|
6
docs/api/wuttjamaican/db.conf.rst
Normal file
6
docs/api/wuttjamaican/db.conf.rst
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
``wuttjamaican.db.conf``
|
||||
========================
|
||||
|
||||
.. automodule:: wuttjamaican.db.conf
|
||||
:members:
|
6
docs/api/wuttjamaican/db.rst
Normal file
6
docs/api/wuttjamaican/db.rst
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
``wuttjamaican.db``
|
||||
===================
|
||||
|
||||
.. automodule:: wuttjamaican.db
|
||||
:members:
|
6
docs/api/wuttjamaican/db.sess.rst
Normal file
6
docs/api/wuttjamaican/db.sess.rst
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
``wuttjamaican.db.sess``
|
||||
========================
|
||||
|
||||
.. automodule:: wuttjamaican.db.sess
|
||||
:members:
|
6
docs/api/wuttjamaican/exc.rst
Normal file
6
docs/api/wuttjamaican/exc.rst
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
``wuttjamaican.exc``
|
||||
====================
|
||||
|
||||
.. automodule:: wuttjamaican.exc
|
||||
:members:
|
16
docs/api/wuttjamaican/index.rst
Normal file
16
docs/api/wuttjamaican/index.rst
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
``wuttjaimaican``
|
||||
=================
|
||||
|
||||
.. automodule:: wuttjamaican
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
app
|
||||
conf
|
||||
db
|
||||
db.conf
|
||||
db.sess
|
||||
exc
|
||||
util
|
6
docs/api/wuttjamaican/util.rst
Normal file
6
docs/api/wuttjamaican/util.rst
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
``wuttjamaican.util``
|
||||
=====================
|
||||
|
||||
.. automodule:: wuttjamaican.util
|
||||
:members:
|
38
docs/conf.py
Normal file
38
docs/conf.py
Normal file
|
@ -0,0 +1,38 @@
|
|||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# For the full list of built-in configuration values, see the documentation:
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
||||
|
||||
project = 'WuttJamaican'
|
||||
copyright = '2023, Lance Edgar'
|
||||
author = 'Lance Edgar'
|
||||
release = '0.1'
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
||||
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinx.ext.todo',
|
||||
]
|
||||
|
||||
templates_path = ['_templates']
|
||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
||||
|
||||
intersphinx_mapping = {
|
||||
'python-configuration': ('https://python-configuration.readthedocs.io/en/latest/', None),
|
||||
'rattail': ('https://rattailproject.org/docs/rattail/', None),
|
||||
'rattail-manual': ('https://rattailproject.org/docs/rattail-manual/', None),
|
||||
'sqlalchemy': ('http://docs.sqlalchemy.org/en/latest/', None),
|
||||
}
|
||||
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
||||
|
||||
html_theme = 'alabaster'
|
||||
html_static_path = ['_static']
|
70
docs/index.rst
Normal file
70
docs/index.rst
Normal file
|
@ -0,0 +1,70 @@
|
|||
|
||||
WuttJamaican
|
||||
============
|
||||
|
||||
aka. Whatcha Makin
|
||||
|
||||
This package provides a "base layer" of sorts, for apps built with it.
|
||||
|
||||
It mostly is a distillation of certain patterns developed within the
|
||||
Rattail Project, which are deemed generally useful. (At least,
|
||||
according to the author.) It roughly corresponds to the "base layer"
|
||||
as described in the Rattail Manual (see :doc:`rattail-manual:base/index`).
|
||||
|
||||
Good documentation and 100% test coverage are priorities for this project.
|
||||
|
||||
Much remains to be done, and it may be slow going since I'll be trying
|
||||
to incorporate this package into the main Rattail package along the
|
||||
way. So we'll see where this goes...
|
||||
|
||||
At this point the main focus is the configuration interface.
|
||||
|
||||
|
||||
Basic Usage
|
||||
-----------
|
||||
|
||||
Install with:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
pip install wuttjamaican
|
||||
|
||||
Create a config file, e.g. ``my.conf``:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[foo]
|
||||
bar = A
|
||||
baz = 2
|
||||
feature = true
|
||||
|
||||
In your app, load the config and reference its values as needed::
|
||||
|
||||
import wuttjamaican as wj
|
||||
|
||||
config = wj.make_config('/path/to/my.conf')
|
||||
|
||||
config.get('foo.bar') # returns 'A'
|
||||
|
||||
config.get('foo.baz') # returns '2'
|
||||
config.get_int('foo.baz') # returns 2
|
||||
|
||||
config.get('foo.feature') # returns 'true'
|
||||
config.get_bool('foo.feature') # returns True
|
||||
|
||||
|
||||
Contents
|
||||
--------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
|
||||
api/index
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
35
docs/make.bat
Normal file
35
docs/make.bat
Normal file
|
@ -0,0 +1,35 @@
|
|||
@ECHO OFF
|
||||
|
||||
pushd %~dp0
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
if "%SPHINXBUILD%" == "" (
|
||||
set SPHINXBUILD=sphinx-build
|
||||
)
|
||||
set SOURCEDIR=.
|
||||
set BUILDDIR=_build
|
||||
|
||||
%SPHINXBUILD% >NUL 2>NUL
|
||||
if errorlevel 9009 (
|
||||
echo.
|
||||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
||||
echo.installed, then set the SPHINXBUILD environment variable to point
|
||||
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
||||
echo.may add the Sphinx directory to PATH.
|
||||
echo.
|
||||
echo.If you don't have Sphinx installed, grab it from
|
||||
echo.https://www.sphinx-doc.org/
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
||||
goto end
|
||||
|
||||
:help
|
||||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
||||
|
||||
:end
|
||||
popd
|
Loading…
Add table
Add a link
Reference in a new issue