提交 d9e3cd24 编写于 作者: W weiyujin

Code specification rectification

Signed-off-by: Nweiyujin <weiyujin@huawei.com>
上级 a8aadb4c
...@@ -25,6 +25,7 @@ import traceback ...@@ -25,6 +25,7 @@ import traceback
VERSION = "0.4.6" VERSION = "0.4.6"
def find_top(): def find_top():
cur_dir = os.getcwd() cur_dir = os.getcwd()
while cur_dir != "/": while cur_dir != "/":
......
...@@ -31,6 +31,7 @@ entry = importlib.import_module("__entry__") ...@@ -31,6 +31,7 @@ entry = importlib.import_module("__entry__")
sys.exit(entry.main()) sys.exit(entry.main())
""" """
def find_top(): def find_top():
cur_dir = os.getcwd() cur_dir = os.getcwd()
while cur_dir != "/": while cur_dir != "/":
......
...@@ -23,8 +23,8 @@ from hb_internal.build.build_process import Build ...@@ -23,8 +23,8 @@ from hb_internal.build.build_process import Build
from hb_internal.set.set import set_product from hb_internal.set.set import set_product
from hb_internal.common.utils import get_current_time from hb_internal.common.utils import get_current_time
from hb_internal.common.utils import OHOSException from hb_internal.common.utils import OHOSException
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),"../../../"))) sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../")))
from scripts.tools_checker import check_build_requried_packages,check_os_version from scripts.tools_checker import check_build_requried_packages, check_os_version
def add_options(parser): def add_options(parser):
......
...@@ -134,7 +134,7 @@ def check_image_size(out_path): ...@@ -134,7 +134,7 @@ def check_image_size(out_path):
for file in os.listdir(image_path): for file in os.listdir(image_path):
if file.endswith(".img"): if file.endswith(".img"):
image_dict = {} image_dict = {}
img_path = os.path.join(image_path,file) img_path = os.path.join(image_path, file)
image_dict['img_size'] = f'{round(os.path.getsize(img_path) / 1024, 2)}KB' image_dict['img_size'] = f'{round(os.path.getsize(img_path) / 1024, 2)}KB'
image_dict['img_name'] = file image_dict['img_name'] = file
image_list.append(image_dict) image_list.append(image_dict)
......
...@@ -165,7 +165,7 @@ class Product(): ...@@ -165,7 +165,7 @@ class Product():
config = Config() config = Config()
# Get all inherit files # Get all inherit files
files = [ os.path.join(config.root_path, file) for file in read_json_file(product_json).get('inherit', []) ] files = [os.path.join(config.root_path, file) for file in read_json_file(product_json).get('inherit', [])]
# Add the product config file to last with highest priority # Add the product config file to last with highest priority
files.append(product_json) files.append(product_json)
......
...@@ -21,8 +21,8 @@ import sys ...@@ -21,8 +21,8 @@ import sys
from hb_internal import CONFIG_JSON from hb_internal import CONFIG_JSON
from hb_internal.common.utils import read_json_file from hb_internal.common.utils import read_json_file
from hb_internal.common.utils import hb_info from hb_internal.common.utils import hb_info
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),"../../../"))) from scripts.tools_checker import check_build_requried_packages, check_os_version
from scripts.tools_checker import check_build_requried_packages,check_os_version sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../")))
OPTIONS_FUN_LIST = [ OPTIONS_FUN_LIST = [
...@@ -41,7 +41,7 @@ def add_options(parser): ...@@ -41,7 +41,7 @@ def add_options(parser):
def check_dep(): def check_dep():
host_info = check_os_version() host_info = check_os_version()
packages_info = check_build_requried_packages(host_info[1],check=False) packages_info = check_build_requried_packages(host_info[1], check=False)
hb_info('necessary_package: {}'.format(','.join(packages_info[0]))) hb_info('necessary_package: {}'.format(','.join(packages_info[0])))
hb_info('installed_package: {}'.format(','.join(packages_info[1]))) hb_info('installed_package: {}'.format(','.join(packages_info[1])))
hb_info('uninstalled_package: {}'.format(','.join(packages_info[2]))) hb_info('uninstalled_package: {}'.format(','.join(packages_info[2])))
...@@ -82,4 +82,4 @@ def exec_command(args): ...@@ -82,4 +82,4 @@ def exec_command(args):
para_to_function(para) para_to_function(para)
break break
else: else:
check_os_info() check_os_info()
\ No newline at end of file
...@@ -18,14 +18,14 @@ import os ...@@ -18,14 +18,14 @@ import os
import sys import sys
import argparse import argparse
sys.path.append(
os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__)))))
from hb_internal.common.config import Config from hb_internal.common.config import Config
from hb_internal.common.utils import read_json_file from hb_internal.common.utils import read_json_file
from hb_internal.common.utils import dump_json_file from hb_internal.common.utils import dump_json_file
from hb_internal.preloader.parse_lite_subsystems_config import parse_lite_subsystem_config from hb_internal.preloader.parse_lite_subsystems_config import parse_lite_subsystem_config
from hb_internal.preloader.parse_vendor_product_config import get_vendor_parts_list from hb_internal.preloader.parse_vendor_product_config import get_vendor_parts_list
sys.path.append(
os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__)))))
def _get_base_parts(base_config_dir, os_level): def _get_base_parts(base_config_dir, os_level):
...@@ -49,6 +49,7 @@ def _get_inherit_parts(inherit, source_root_dir): ...@@ -49,6 +49,7 @@ def _get_inherit_parts(inherit, source_root_dir):
inherit_parts.update(get_vendor_parts_list(_info)) inherit_parts.update(get_vendor_parts_list(_info))
return inherit_parts return inherit_parts
def _get_sys_relate_parts(system_component_info, _parts, source_root_dir): def _get_sys_relate_parts(system_component_info, _parts, source_root_dir):
_info = read_json_file(os.path.join(source_root_dir, system_component_info)) _info = read_json_file(os.path.join(source_root_dir, system_component_info))
ret = {} ret = {}
...@@ -60,6 +61,7 @@ def _get_sys_relate_parts(system_component_info, _parts, source_root_dir): ...@@ -60,6 +61,7 @@ def _get_sys_relate_parts(system_component_info, _parts, source_root_dir):
ret[part] = featrue ret[part] = featrue
return ret return ret
def _get_device_info(device_name, config_dir): def _get_device_info(device_name, config_dir):
device_config_file = os.path.join(config_dir, device_config_file = os.path.join(config_dir,
'{}.json'.format(device_name)) '{}.json'.format(device_name))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册