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
Bliss
python-handel
Commits
1411a95b
Commit
1411a95b
authored
Aug 31, 2017
by
Vincent Michel
Browse files
Do not use configparser (non-standard ini files)
parent
5cdd3daf
Changes
1
Hide whitespace changes
Inline
Side-by-side
handel/interface.py
View file @
1411a95b
...
...
@@ -416,11 +416,5 @@ def get_config_files(path):
def
get_config
(
filename
):
"""Read and return the given config file as a dictionary."""
# Make sure the file exists
open
(
filename
).
close
()
# Customize parser
config
=
configparser
.
ConfigParser
(
comment_prefixes
=
[
'START'
,
'END'
,
'#'
,
'*****'
])
# Read and parse
config
.
read
([
filename
])
return
{
section
:
dict
(
config
[
section
])
for
section
in
config
.
sections
()}
with
open
(
filename
)
as
f
:
return
f
.
read
()
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