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
695b031e
Commit
695b031e
authored
Jul 16, 2016
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the way the module_pool environment is set for a cleaner main process
parent
1ca9d077
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
__main__.py
hdlmake/__main__.py
+7
-5
module_pool.py
hdlmake/module_pool.py
+4
-1
No files found.
hdlmake/__main__.py
View file @
695b031e
...
...
@@ -31,7 +31,6 @@ import sys
from
.util.termcolor
import
colored
from
.manifest_parser
import
ManifestParser
from
.module_pool
import
ModulePool
from
.env
import
Env
from
.
import
fetch
as
fetch_mod
from
._version
import
__version__
...
...
@@ -66,9 +65,8 @@ def main():
# Create a ModulePool object, this will become our workspace
modules_pool
=
ModulePool
()
# Set the environment
env
=
Env
(
options
)
modules_pool
.
set_environment
(
env
)
# Set the module_pool environment by providing the options: this is a must!
modules_pool
.
set_environment
(
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
...
...
@@ -77,6 +75,10 @@ def main():
# 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
,
...
...
@@ -175,7 +177,7 @@ def _action_runner(modules_pool):
# #
try
:
for
command
in
action
:
action_instance
=
command
(
modules_pool
=
modules_pool
)
action_instance
=
command
(
modules_pool
)
action_instance
.
run
()
except
Exception
as
e
:
import
traceback
...
...
hdlmake/module_pool.py
View file @
695b031e
...
...
@@ -30,6 +30,8 @@ import sys
from
.
import
new_dep_solver
as
dep_solver
from
.util
import
path
as
path_mod
from
.
import
fetch
from
.env
import
Env
class
ModulePool
(
list
):
...
...
@@ -40,7 +42,8 @@ class ModulePool(list):
self
.
_deps_solved
=
False
self
.
env
=
None
def
set_environment
(
self
,
env
):
def
set_environment
(
self
,
options
):
env
=
Env
(
options
)
self
.
env
=
env
def
get_module_by_path
(
self
,
path
):
...
...
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