Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
funpack
Commits
10f59f88
Commit
10f59f88
authored
Jun 24, 2022
by
Paul McCarthy
🚵
Browse files
RF: Change cfgdir precedence - site-packages comes first
parent
3a3cb431
Changes
1
Hide whitespace changes
Inline
Side-by-side
funpack/util.py
View file @
10f59f88
...
...
@@ -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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment