提交 3ab81451 编写于 作者: X xiyue5

优化打开product_name.json文件后不能hb set

Signed-off-by: Nxiyue5 <liuxiyue5@huawei.com>
上级 f8d7a2fa
......@@ -52,18 +52,20 @@ class Product():
}
bip_path = config.built_in_product_path
for item in os.listdir(bip_path):
product_name = item[0:-len('.json')] if item.endswith('.json') else item
config_path = os.path.join(bip_path, item)
info = read_json_file(config_path)
yield {
'company': 'built-in',
"name": product_name,
'path': bip_path,
'version': info.get('version', '2.0'),
'os_level': info.get('type', 'standard'),
'config': config_path
}
if item[0]==".":
continue
else:
product_name = item[0:-len('.json')] if item.endswith('.json') else item
config_path = os.path.join(bip_path, item)
info = read_json_file(config_path)
yield {
'company': 'built-in',
"name": product_name,
'path': bip_path,
'version': info.get('version', '2.0'),
'os_level': info.get('type', 'standard'),
'config': config_path
}
@staticmethod
def get_device_info(product_json):
info = read_json_file(product_json)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册