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
9e378856
Commit
9e378856
authored
Jun 11, 2019
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reformating and cleanup.
parent
ea5484da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
28 deletions
+22
-28
configparser.py
hdlmake/manifest_parser/configparser.py
+0
-1
variables.py
hdlmake/manifest_parser/variables.py
+2
-3
module.py
hdlmake/module/module.py
+20
-24
No files found.
hdlmake/manifest_parser/configparser.py
View file @
9e378856
...
@@ -233,7 +233,6 @@ types:[<type 'int'>]
...
@@ -233,7 +233,6 @@ types:[<type 'int'>]
def
add_config_file
(
self
,
config_file
):
def
add_config_file
(
self
,
config_file
):
"""Add the Manifest to be processed by the parser"""
"""Add the Manifest to be processed by the parser"""
self
.
config_file
=
config_file
self
.
config_file
=
config_file
return
True
def
add_prefix_code
(
self
,
code
):
def
add_prefix_code
(
self
,
code
):
"""Add the arbitrary Python to be executed just before the Manifest"""
"""Add the arbitrary Python to be executed just before the Manifest"""
...
...
hdlmake/manifest_parser/variables.py
View file @
9e378856
...
@@ -290,9 +290,8 @@ class ManifestParser(ConfigParser):
...
@@ -290,9 +290,8 @@ class ManifestParser(ConfigParser):
manifest
=
_search_for_manifest
(
path
)
manifest
=
_search_for_manifest
(
path
)
if
manifest
is
None
:
if
manifest
is
None
:
raise
Exception
(
"No manifest found in path: {}"
.
format
(
path
))
raise
Exception
(
"No manifest found in path: {}"
.
format
(
path
))
else
:
logging
.
debug
(
"Parse manifest in:
%
s"
,
manifest
)
logging
.
debug
(
"Parse manifest in:
%
s"
,
manifest
)
self
.
add_config_file
(
manifest
)
return
self
.
add_config_file
(
manifest
)
def
print_help
(
self
):
def
print_help
(
self
):
"""Print the help for the Manifest parser object"""
"""Print the help for the Manifest parser object"""
...
...
hdlmake/module/module.py
View file @
9e378856
...
@@ -72,8 +72,7 @@ class Module(ModuleContent):
...
@@ -72,8 +72,7 @@ class Module(ModuleContent):
def
remove_dir_from_disk
(
self
):
def
remove_dir_from_disk
(
self
):
"""Delete the module dir if it is already fetched and available"""
"""Delete the module dir if it is already fetched and available"""
if
not
self
.
isfetched
:
assert
self
.
isfetched
return
logging
.
debug
(
"Removing "
+
self
.
path
)
logging
.
debug
(
"Removing "
+
self
.
path
)
command_tmp
=
shell
.
rmdir_command
()
+
" "
+
self
.
path
command_tmp
=
shell
.
rmdir_command
()
+
" "
+
self
.
path
shell
.
run
(
command_tmp
)
shell
.
run
(
command_tmp
)
...
@@ -106,8 +105,7 @@ class Module(ModuleContent):
...
@@ -106,8 +105,7 @@ class Module(ModuleContent):
if
self
.
manifest_dict
or
self
.
isfetched
is
False
:
if
self
.
manifest_dict
or
self
.
isfetched
is
False
:
return
return
if
self
.
path
is
None
:
assert
self
.
path
is
not
None
raise
RuntimeError
()
logging
.
debug
(
"""
logging
.
debug
(
"""
***********************************************************
***********************************************************
...
@@ -119,33 +117,31 @@ PARSE START: %s
...
@@ -119,33 +117,31 @@ PARSE START: %s
manifest_parser
.
add_prefix_code
(
self
.
pool
.
options
.
prefix_code
)
manifest_parser
.
add_prefix_code
(
self
.
pool
.
options
.
prefix_code
)
manifest_parser
.
add_suffix_code
(
self
.
pool
.
options
.
suffix_code
)
manifest_parser
.
add_suffix_code
(
self
.
pool
.
options
.
suffix_code
)
parser_tmp
=
manifest_parser
.
add_manifest
(
self
.
path
)
# Look for the Manifest.py file
manifest_parser
.
add_manifest
(
self
.
path
)
if
not
parser_tmp
==
None
:
if
self
.
parent
is
None
:
# Parse and extract variables from it.
extra_context
=
{}
if
self
.
parent
is
None
:
else
:
extra_context
=
{}
extra_context
=
dict
(
self
.
top_module
.
manifest_dict
)
extra_context
[
"__manifest"
]
=
self
.
path
# The parse method is where most of the parser action takes place!
opt_map
=
None
try
:
opt_map
=
manifest_parser
.
parse
(
extra_context
=
extra_context
)
except
NameError
as
name_error
:
raise
Exception
(
"Error while parsing {0}:
\n
{1}: {2}."
.
format
(
self
.
path
,
type
(
name_error
),
name_error
))
self
.
manifest_dict
=
opt_map
else
:
else
:
self
.
manifest_dict
=
{}
extra_context
=
dict
(
self
.
top_module
.
manifest_dict
)
extra_context
[
"__manifest"
]
=
self
.
path
# The parse method is where most of the parser action takes place!
opt_map
=
None
try
:
opt_map
=
manifest_parser
.
parse
(
extra_context
=
extra_context
)
except
NameError
as
name_error
:
raise
Exception
(
"Error while parsing {0}:
\n
{1}: {2}."
.
format
(
self
.
path
,
type
(
name_error
),
name_error
))
self
.
manifest_dict
=
opt_map
# Process the parsed manifest_dict to assign the module properties
# Process the parsed manifest_dict to assign the module properties
self
.
process_manifest
()
self
.
process_manifest
()
self
.
process_git_submodules
()
self
.
process_git_submodules
()
#
P
arse every detected submodule
#
Recurse: p
arse every detected submodule
for
module_aux
in
self
.
submodules
():
for
module_aux
in
self
.
submodules
():
module_aux
.
parse_manifest
()
module_aux
.
parse_manifest
()
...
...
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