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
71431bfc
Commit
71431bfc
authored
May 23, 2017
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initialize the pool when the instance is created
parent
dc19b1b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
29 deletions
+7
-29
__main__.py
hdlmake/__main__.py
+1
-28
action.py
hdlmake/action/action.py
+6
-1
No files found.
hdlmake/__main__.py
View file @
71431bfc
...
...
@@ -24,13 +24,11 @@
from
__future__
import
print_function
from
__future__
import
absolute_import
import
os
import
argparse
import
sys
from
.manifest_parser
import
ManifestParser
from
.module_pool
import
ModulePool
from
.
import
fetch
as
fetch_mod
from
._version
import
__version__
...
...
@@ -55,32 +53,7 @@ def main():
# Create a ModulePool object, this will become our workspace
modules_pool
=
ModulePool
(
options
)
# Set the module_pool environment by providing the options: this is a must!
#modules_pool.env = Env(options)
# Now, we add the first module, the one from which we are launching
# the program:
# Note that we are asking for not processing the manifest and specifying
# that there is not a parent module.
# 1- Hdlmake create a new Module() object
# 2- There is not a top_module yet in modules_pool, so only this time...:
# - this becomes the top_module
# - the manifest is parsed & processed
# And dependent modules are added to the modules pool, but...
# .. How should we handle recursive fetching?
# Note: CERN BE-CO-HT advocates for defaulting to non-recursive.
modules_pool
.
new_module
(
parent
=
None
,
url
=
os
.
getcwd
(),
source
=
fetch_mod
.
LOCAL
,
fetchto
=
"."
)
# Check if our top_module has been successfully assigned and
# contains a Manifest.py (ModulePool class)
# if not modules_pool.get_top_module().manifest_dict:
# logging.info("No manifest found. At least an empty one is needed")
# logging.info("To see some help, type hdlmake --help")
# sys.exit("Exiting")
# Execute the appropriated action for the freshly created modules pool
_action_runner
(
modules_pool
)
...
...
hdlmake/action/action.py
View file @
71431bfc
...
...
@@ -31,6 +31,7 @@ import sys
from
hdlmake.util
import
shell
from
hdlmake.util.termcolor
import
colored
from
hdlmake
import
new_dep_solver
as
dep_solver
from
hdlmake
import
fetch
as
fetch_mod
def
set_logging_level
(
options
):
...
...
@@ -61,11 +62,15 @@ class Action(list):
"""This is the base class providing the common Action methods"""
def
__init__
(
self
,
options
):
super
(
Action
,
self
)
.
__init__
()
self
.
top_module
=
None
self
.
_deps_solved
=
False
self
.
options
=
options
set_logging_level
(
options
)
super
(
Action
,
self
)
.
__init__
()
self
.
new_module
(
parent
=
None
,
url
=
os
.
getcwd
(),
source
=
fetch_mod
.
LOCAL
,
fetchto
=
"."
)
def
new_module
(
self
,
parent
,
url
,
source
,
fetchto
):
"""Add new module to the pool.
...
...
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