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
4d202f7d
Commit
4d202f7d
authored
Oct 04, 2019
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring.
parent
7556de06
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
34 deletions
+33
-34
content.py
hdlmake/module/content.py
+31
-29
core.py
hdlmake/module/core.py
+2
-5
No files found.
hdlmake/module/content.py
View file @
4d202f7d
...
...
@@ -47,6 +47,37 @@ class ModuleContent(ModuleConfig):
if
"action"
in
self
.
manifest_dict
:
self
.
action
=
self
.
manifest_dict
[
"action"
]
.
lower
()
def
_create_file_list_from_paths
(
self
,
paths
):
"""
Build a Source File Set containing the files indicated by the
provided list of paths
"""
from
hdlmake.srcfile
import
create_source_file
,
SourceFileSet
srcs
=
SourceFileSet
()
# Check if this is the top module and grab the include_dirs
if
self
.
parent
is
None
:
include_dirs
=
self
.
manifest_dict
.
get
(
'include_dirs'
,
[])
else
:
include_dirs
=
self
.
top_manifest
.
manifest_dict
.
get
(
'include_dirs'
,
[])
for
path_aux
in
paths
:
if
os
.
path
.
isdir
(
path_aux
):
# If a path is a dir, add all the files of that dir.
dir_
=
os
.
listdir
(
path_aux
)
for
f_dir
in
dir_
:
f_dir
=
os
.
path
.
join
(
self
.
path
,
path_aux
,
f_dir
)
if
not
os
.
path
.
isdir
(
f_dir
):
srcs
.
add
(
create_source_file
(
path
=
f_dir
,
module
=
self
,
library
=
self
.
library
,
include_dirs
=
include_dirs
))
else
:
srcs
.
add
(
create_source_file
(
path
=
path_aux
,
module
=
self
,
library
=
self
.
library
,
include_dirs
=
include_dirs
))
return
srcs
def
_process_manifest_files
(
self
):
"""Process the files instantiated by the HDLMake module"""
from
hdlmake.srcfile
import
SourceFileSet
...
...
@@ -130,32 +161,3 @@ class ModuleContent(ModuleConfig):
makefiles_paths
=
self
.
_make_list_of_paths
(
included_makefiles_aux
)
self
.
incl_makefiles
.
extend
(
makefiles_paths
)
def
_create_file_list_from_paths
(
self
,
paths
):
"""
Build a Source File Set containing the files indicated by the
provided list of paths
"""
from
hdlmake.srcfile
import
create_source_file
,
SourceFileSet
srcs
=
SourceFileSet
()
# Check if this is the top module and grab the include_dirs
if
self
.
parent
is
None
:
include_dirs
=
self
.
manifest_dict
.
get
(
'include_dirs'
,
[])
else
:
include_dirs
=
self
.
top_manifest
.
manifest_dict
.
get
(
'include_dirs'
,
[])
for
path_aux
in
paths
:
if
os
.
path
.
isdir
(
path_aux
):
dir_
=
os
.
listdir
(
path_aux
)
for
f_dir
in
dir_
:
f_dir
=
os
.
path
.
join
(
self
.
path
,
path_aux
,
f_dir
)
if
not
os
.
path
.
isdir
(
f_dir
):
srcs
.
add
(
create_source_file
(
path
=
f_dir
,
module
=
self
,
library
=
self
.
library
,
include_dirs
=
include_dirs
))
else
:
srcs
.
add
(
create_source_file
(
path
=
path_aux
,
module
=
self
,
library
=
self
.
library
,
include_dirs
=
include_dirs
))
return
srcs
hdlmake/module/core.py
View file @
4d202f7d
...
...
@@ -43,14 +43,11 @@ class ModuleConfig(object):
def
init_config
(
self
,
module_args
):
"""This initializes the module configuration.
The function is executed by Module constructor"""
parent
=
module_args
.
parent
self
.
parent
=
module_args
.
parent
url
=
module_args
.
url
source
=
module_args
.
source
s
elf
.
s
ource
=
module_args
.
source
fetchto
=
module_args
.
fetchto
self
.
source
=
source
self
.
parent
=
parent
if
self
.
source
==
'local'
:
self
.
url
,
self
.
branch
,
self
.
revision
=
url
,
None
,
None
...
...
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