Skip to content

Commit

Permalink
Documentation updated
Browse files Browse the repository at this point in the history
  • Loading branch information
exhuma committed Aug 31, 2012
1 parent a44a939 commit 2714fa4
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions README.txt
@@ -1,26 +1,25 @@
A system to resolve config files for python projects
====================================================


.. note::

This is a small piece of code which I ended up copy/pasting over and over
from project to project. I decided to refactor it out into a separate
project to facilitate updates. It's something I use for myself. If you
find it useful for yourself, feel free to use it!


A very simple and small utility to provide a way to search for configuration
files. For now it is only tested on posix systems, but it should also work on
Windows.

For posix systems it will search for config files in the following order:

- A file named in the environment variable ``<APP_NAME>_CONFIG``
- The current active working directory (of the running process)
- ``~/.<group_name>/<app_name>/<conf_name>``
- ``/etc/<group_name>/<app_name>/<conf_name>``
- ``~/.<group_name>/<app_name>/<conf_name>``
- The current active working directory (of the running process)
- A file named in the environment variable ``<APP_NAME>_CONFIG``

The complete search path can be overwritten by setting the environment variable
``<APP_NAME>_PATH``, separating the different paths by either ``:`` (posix) or
``;`` (windows).

The last file found will always take precedence by extending/overwriting
previously loaded files. As an example you can have system globals in
``/etc``, and then on a per-user basis override values. Existing values are
kept, so config files further down the lookup chain do not contain all values.

Even further down the lookup chain you can use the working-directory or
``<APP_NAME>_CONFIG`` to override values on a per-application instance basis.

0 comments on commit 2714fa4

Please sign in to comment.