Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bliss
python-handel
Commits
622c25a8
Commit
622c25a8
authored
Sep 08, 2017
by
Vincent Michel
Browse files
Make the file API more flexible
parent
e2e754cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
handel/interface.py
View file @
622c25a8
...
...
@@ -406,8 +406,9 @@ def get_handel_version():
# Files
def
get_config_files
(
path
):
def
get_config_files
(
*
path
):
"""Return all the ini files in path (including subdirectories)."""
path
=
os
.
path
.
join
(
*
path
)
ext
=
b
'.ini'
if
isinstance
(
path
,
bytes
)
else
'.ini'
sep
=
b
'/'
if
isinstance
(
path
,
bytes
)
else
'/'
return
[
os
.
path
.
join
(
dp
,
f
).
lstrip
(
path
).
lstrip
(
sep
)
...
...
@@ -416,8 +417,8 @@ def get_config_files(path):
if
f
.
endswith
(
ext
)]
def
get_config
(
path
,
filename
):
def
get_config
(
*
path
):
"""Read and return the given config file as a dictionary."""
filename
=
os
.
path
.
join
(
path
,
filename
)
filename
=
os
.
path
.
join
(
*
path
)
with
open
(
filename
)
as
f
:
return
parse_xia_ini_file
(
f
.
read
())
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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