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
b2ff69ad
Commit
b2ff69ad
authored
Jun 01, 2016
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A little more of refactoring in the first stages
parent
4e899c2a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
32 deletions
+10
-32
__main__.py
hdlmake/__main__.py
+5
-25
module_pool.py
hdlmake/module_pool.py
+5
-7
No files found.
hdlmake/__main__.py
View file @
b2ff69ad
...
...
@@ -40,13 +40,6 @@ from .action import (CheckCondition, CleanModules, FetchModules, GenerateFetchMa
QsysHwTclUpdate
,)
from
._version
import
__version__
#from argument_parser import get_argument_parser
#try:
# from build_hash import BUILD_ID
#except:
# BUILD_ID = "unrecognized"
def
main
():
"""This is the main function, where HDLMake starts.
...
...
@@ -92,7 +85,7 @@ def main():
# 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 (for both modules_pool and global_mod)
# - the manifest is parsed
# - the manifest is parsed
& processed
modules_pool
.
new_module
(
parent
=
None
,
url
=
global_mod
.
current_path
,
source
=
fetch_mod
.
LOCAL
,
...
...
@@ -113,15 +106,6 @@ def main():
global_mod
.
top_module
=
top_mod
# Now, process the top module manifest: this is a specific functions for module_pool!
# -- try to guess the origin url
# -- process manifest for top module
modules_pool
.
process_top_module_manifest
()
#url = modules_pool._guess_origin(global_mod.top_module.path)
#if url:
# global_mod.top_module.url = url
#global_mod.top_module.process_manifest()
#
# Load global tool object (global_mod.py)
#
...
...
@@ -150,16 +134,9 @@ def main():
global_mod
.
tool_module
=
tool_module
#env.top_module = modules_pool.get_top_module()
#env.check_env(verbose=False)
#env.check_env_wrt_manifest(verbose=False)
# #
#
EXECUTE THE COMMANDS/ACTIONS HERE
#
#
DECODE THE COMMANDS/ACTIONS HERE
#
# #
if
options
.
command
==
"check-env"
:
env
.
check_env
(
verbose
=
True
)
quit
()
...
...
@@ -226,6 +203,9 @@ def main():
elif
options
.
command
==
"tree"
:
action
=
[
Tree
]
# #
# EXECUTE THE COMMAND SEQUENCE #
# #
try
:
for
command
in
action
:
action_instance
=
command
(
modules_pool
=
modules_pool
,
...
...
hdlmake/module_pool.py
View file @
b2ff69ad
...
...
@@ -101,14 +101,12 @@ class ModulePool(list):
global_mod
.
top_module
=
new_module
self
.
top_module
=
new_module
new_module
.
parse_manifest
()
return
new_module
new_module
.
process_manifest
()
url
=
self
.
_guess_origin
(
global_mod
.
top_module
.
path
)
if
url
:
global_mod
.
top_module
.
url
=
url
def
process_top_module_manifest
(
self
):
"""Process the top module without descending to children modules"""
url
=
self
.
_guess_origin
(
global_mod
.
top_module
.
path
)
if
url
:
global_mod
.
top_module
.
url
=
url
global_mod
.
top_module
.
process_manifest
()
return
new_module
def
_guess_origin
(
self
,
path
):
"""Guess origin (git, svn, local) of a module at given 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