Skip to content

Commit

Permalink
:add: current directory for file conf driver
Browse files Browse the repository at this point in the history
  • Loading branch information
b3j0f committed Dec 20, 2015
1 parent 0d40e74 commit 6a9de2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Driver
######

Drivers are the mean to parse configuration resources, such as files, etc. from a configuration model provided by a Configurable object.
By default, conf drivers are able to parse json/ini files. Those last use a relative path given by the environment variable ``B3J0F_CONF_DIR`` or ``~/etc`` if not given.
By default, conf drivers are able to parse json/ini files. Those last use a relative path given by the environment variable ``B3J0F_CONF_DIR`` or from directories (in this order) ``/etc``, ``/usr/local/etc``, ``~/etc``, ``~/.config``, ``~/config`` or current execution directory.

Example
-------
Expand Down
2 changes: 2 additions & 0 deletions b3j0f/conf/driver/file/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def _addconfig(config, *paths):
CONF_DIRS, join(HOME, '.config'), join(HOME, 'config'), join(HOME, 'etc')
)

_addconfig(CONF_DIRS, '.') # add current directory

B3J0F_CONF_DIR = 'B3J0F_CONF_DIR' #: conf dir environment variable name.

if B3J0F_CONF_DIR in environ: # add b3j0F_CONF_DIR if necessary
Expand Down

0 comments on commit 6a9de2c

Please sign in to comment.