A little more of refactoring in the first stages

parent 4e899c2a
...@@ -40,13 +40,6 @@ from .action import (CheckCondition, CleanModules, FetchModules, GenerateFetchMa ...@@ -40,13 +40,6 @@ from .action import (CheckCondition, CleanModules, FetchModules, GenerateFetchMa
QsysHwTclUpdate,) QsysHwTclUpdate,)
from ._version import __version__ from ._version import __version__
#from argument_parser import get_argument_parser
#try:
# from build_hash import BUILD_ID
#except:
# BUILD_ID = "unrecognized"
def main(): def main():
"""This is the main function, where HDLMake starts. """This is the main function, where HDLMake starts.
...@@ -92,7 +85,7 @@ def main(): ...@@ -92,7 +85,7 @@ def main():
# 1- Hdlmake create a new Module() object # 1- Hdlmake create a new Module() object
# 2- There is not a top_module yet in modules_pool, so only this time...: # 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) # - 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, modules_pool.new_module(parent=None,
url=global_mod.current_path, url=global_mod.current_path,
source=fetch_mod.LOCAL, source=fetch_mod.LOCAL,
...@@ -113,15 +106,6 @@ def main(): ...@@ -113,15 +106,6 @@ def main():
global_mod.top_module = top_mod 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) # Load global tool object (global_mod.py)
# #
...@@ -150,16 +134,9 @@ def main(): ...@@ -150,16 +134,9 @@ def main():
global_mod.tool_module = tool_module 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": if options.command == "check-env":
env.check_env(verbose=True) env.check_env(verbose=True)
quit() quit()
...@@ -226,6 +203,9 @@ def main(): ...@@ -226,6 +203,9 @@ def main():
elif options.command == "tree": elif options.command == "tree":
action = [ Tree ] action = [ Tree ]
# #
# EXECUTE THE COMMAND SEQUENCE #
# #
try: try:
for command in action: for command in action:
action_instance = command(modules_pool=modules_pool, action_instance = command(modules_pool=modules_pool,
......
...@@ -101,14 +101,12 @@ class ModulePool(list): ...@@ -101,14 +101,12 @@ class ModulePool(list):
global_mod.top_module = new_module global_mod.top_module = new_module
self.top_module = new_module self.top_module = new_module
new_module.parse_manifest() 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): return new_module
"""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()
def _guess_origin(self, path): def _guess_origin(self, path):
"""Guess origin (git, svn, local) of a module at given path""" """Guess origin (git, svn, local) of a module at given path"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment