mirror of
https://github.com/dtomlinson91/panaetius.git
synced 2025-12-22 04:55:44 +00:00
Updating documentation for new __header__ functionality
This commit is contained in:
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -2,5 +2,6 @@
|
||||
"python.linting.pylintEnabled": false,
|
||||
"python.linting.prospectorEnabled": true,
|
||||
"python.linting.enabled": true,
|
||||
"python.pythonPath": ".venv/bin/python"
|
||||
"python.pythonPath": ".venv/bin/python",
|
||||
"restructuredtext.confPath": "${workspaceFolder}/docs/source"
|
||||
}
|
||||
@@ -3,8 +3,34 @@ Configuration
|
||||
|
||||
panaetius is fairly easy to configure. There are just a couple of options to be aware of.
|
||||
|
||||
Manual configuration of ``Config`` instance
|
||||
--------------------------------------------
|
||||
|
||||
Configuring with a ``__header__.py`` is deprecated. Manually set this value.
|
||||
|
||||
Use the following snippet to configure (in ``__init__.py``):
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import panaetius
|
||||
from panaetius.config import Config
|
||||
|
||||
CONFIG = Config(path="~/.config/island-code-extractor", header="island-code-extractor")
|
||||
|
||||
panaetius.set_config(CONFIG, "reddit.secret")
|
||||
|
||||
Access this in your code by importing the ``CONFIG`` instance from your module:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from island_code_extractor import CONFIG
|
||||
from island_code_extractor import panaetius
|
||||
|
||||
CONFIG.reddit_output_path
|
||||
panaetius.logger.info("Using logger")
|
||||
|
||||
__header__.py
|
||||
----------
|
||||
-------------
|
||||
|
||||
You should set a ``__header__.py`` next to your script or module.
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ Setting a config file
|
||||
|
||||
The main functionality of ``panaetius`` is using a config file to store variables.
|
||||
|
||||
Your ``config.toml`` can be created and found in ~/.config/__header__/config.toml where __header__ is equal to the variable configured/set. `See how to configure`_ this variable in the configuration section of panaetius.
|
||||
Your ``config.toml`` can be created and found in ``~/.config/__header__/config.toml`` where ``__header__`` is equal to the variable configured/set. `See how to configure`_ this variable in the configuration section of panaetius.
|
||||
|
||||
.. _See how to configure: https://panaetius.readthedocs.io/en/latest/configuration.html#header-py
|
||||
|
||||
|
||||
Reference in New Issue
Block a user