Commit 10f59f88 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

RF: Change cfgdir precedence - site-packages comes first

parent 3a3cb431
......@@ -198,24 +198,24 @@ def findConfigDir(dirname='configs'):
A ``RuntimeError`` is raised if the config directory cannot be found.
"""
# The user can also refer to "built-in"
# config files just by giving a file path
# The user can refer to "built-in" config
# files just by giving a file path
# with/without suffix, relative to one of
# the following locations (in order of
# precedence):
#
# - in $FUNPACK_CONFIG_DIR, or
# - within the funpack package directory, (<thisdir>/configs/) or,
# - if we are running from a git checkout, installed in the running
# python env (<pyenv>/lib/pythonX.Y/site-packages/funpack/configs/)
# python env (<pyenv>/lib/pythonX.Y/site-packages/funpack/configs/), or
# - within the funpack package directory, (<thisdir>/configs/)
cfgdirs = []
if 'FUNPACK_CONFIG_DIR' in os.environ:
cfgdirs.append(os.environ['FUNPACK_CONFIG_DIR'])
cfgdirs.append(op.join(op.dirname(__file__), dirname))
cfgdirs.extend(op.join(sitedir, 'funpack', dirname)
for sitedir in site.getsitepackages())
cfgdirs.append(op.join(op.dirname(__file__), dirname))
for cfgdir in cfgdirs:
if op.isdir(cfgdir):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment