-
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.
Add Package Structure docs and configuration usage example
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## Hierarchy | ||
|
||
The webqueue2api Package consists of four packages in total: | ||
|
||
- `webqueue2api`: The root packages. This contains both the `api` and the `parser` packages as well as global configuration. | ||
- `api`: Contains a [Flask](https://flask.palletsprojects.com/) app that can be used with any WSGI server to host the webqueue2 API and utilities such as authentication code. | ||
- `resources`: Contains [Flask-RESTful](https://flask-restful.readthedocs.io/en/latest/) resources for the webqueue2 API. | ||
- `parser`: Contains parers for a Queue and an Item as well as utilities and custom errors. | ||
|
||
## Configuration | ||
Each package contains package level configuration objects (see: [dataclasses on PyPI](https://pypi.org/project/dataclasses/)) in `config.py` files. All of the configurations are combined into the top level `webqueue2api.config` symbol. | ||
|
||
These configuration objects store default values for each package. Default values can be changed by editing these objects directly or by editing the object values before their use. | ||
|
||
!!! example "Changing the parser's queue directory by editing object values." | ||
```python | ||
import webqueue2api | ||
|
||
# Load Queue from default directory | ||
ce_queue = Queue("ce") | ||
|
||
# load Queue from modified directory | ||
webqueue2api.config.parser.queue_directory = "/absolute/path" | ||
other_queue = Queue("other") | ||
``` |
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,4 +1,5 @@ | ||
# YAML Configuration for Awesome Pages mkdocs Plugin | ||
# See: https://github.com/lukasgeiter/mkdocs-awesome-pages-plugin | ||
nav: | ||
- ... | ||
- Getting Started.md | ||
- Package Structure.md |