From f27eb9ea7c84c9e53d5729e876b80d9a0374217e Mon Sep 17 00:00:00 2001 From: hongguo Date: Thu, 30 Jun 2022 13:00:33 +0800 Subject: [PATCH] split Signed-off-by: hongguo --- hb_internal/common/config.py | 10 ++++++++++ hb_internal/common/product.py | 6 ++++-- hb_internal/set/set.py | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/hb_internal/common/config.py b/hb_internal/common/config.py index efc365f..085aaa0 100644 --- a/hb_internal/common/config.py +++ b/hb_internal/common/config.py @@ -49,9 +49,19 @@ class Config(metaclass=Singleton): self._target_cpu = config_content.get('target_cpu', None) self._target_os = config_content.get('target_os', None) self._out_path = config_content.get('out_path', None) + self._component_type = config_content.get('component_type', None) self.fs_attr = set() self.platform = platform.system() + @property + def component_type(self): + return self._component_type + + @component_type.setter + def component_type(self, value): + self._component_type = value + self.config_update('component_type', self._component_type) + @property def target_os(self): return self._target_os diff --git a/hb_internal/common/product.py b/hb_internal/common/product.py index 44cc80d..40d9210 100755 --- a/hb_internal/common/product.py +++ b/hb_internal/common/product.py @@ -48,7 +48,8 @@ class Product(): 'path': product_path, 'version': info.get('version', '3.0'), 'os_level': info.get('type', "mini"), - 'config': config_path + 'config': config_path, + 'component_type': info.get('component_type', '') } bip_path = config.built_in_product_path for item in os.listdir(bip_path): @@ -64,7 +65,8 @@ class Product(): 'path': bip_path, 'version': info.get('version', '2.0'), 'os_level': info.get('type', 'standard'), - 'config': config_path + 'config': config_path, + 'component_type': info.get('component_type', '') } @staticmethod diff --git a/hb_internal/set/set.py b/hb_internal/set/set.py index 2fdc7ae..edb53e8 100644 --- a/hb_internal/set/set.py +++ b/hb_internal/set/set.py @@ -71,6 +71,7 @@ def set_product(product_name=None, company=None): config.version = product_info.get('version') config.os_level = product_info.get('os_level') config.product_json = product_info.get('config') + config.component_type = product_info.get('component_type') device_info = Product.get_device_info(config.product_json) config.board = device_info.get('board') -- GitLab