Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
Hdlmake
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Hdlmake
Commits
e33b2126
Commit
e33b2126
authored
Jun 07, 2019
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
configparser: refactoring.
parent
0cbb9727
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
18 deletions
+7
-18
configparser.py
hdlmake/manifest_parser/configparser.py
+7
-18
No files found.
hdlmake/manifest_parser/configparser.py
View file @
e33b2126
...
...
@@ -329,15 +329,13 @@ types:[<type 'int'>]
(
opt_name
,
str
(
type
(
val
)),
val
,
str
(
opt
.
types
),
self
.
config_file
))
ret
[
opt_name
]
=
val
# This is only for the options of the dictionary class:
if
isinstance
(
val
,
type
(
dict
())):
try
:
for
key
in
val
:
if
key
not
in
self
[
opt_name
]
.
keys
:
raise
RuntimeError
(
"Encountered unallowed key: "
"
%
s for option '
%
s'"
%
(
key
,
opt_name
))
except
AttributeError
:
# no allowed_keys member - don't check
pass
if
isinstance
(
val
,
dict
):
for
key
in
val
:
if
key
not
in
self
[
opt_name
]
.
keys
:
raise
RuntimeError
(
"Unallowed key: '{}' for option '{}'"
.
format
(
key
,
opt_name
))
# Set the default values for those values that were not produced
# by the Python exec operation.
#for opt in self.options:
...
...
@@ -347,12 +345,3 @@ types:[<type 'int'>]
# except AttributeError: # no default value in the option
# pass
return
ret
def
_test
():
"""This funtion provides an embedded test for the Manifest parser"""
import
doctest
doctest
.
testmod
()
if
__name__
==
"__main__"
:
_test
()
Write
Preview
Markdown
is supported
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