From 447675a0eb8d12277cc50706246d087c786a1088 Mon Sep 17 00:00:00 2001 From: caohongtao Date: Wed, 3 Jan 2024 15:35:45 +0800 Subject: [PATCH] Fix!,Much log formatting issues and misspelled words Signed-off-by: caohongtao --- src/oebuild/app/plugins/bitbake/bitbake.py | 2 +- src/oebuild/app/plugins/bitbake/in_container.py | 4 ++-- src/oebuild/app/plugins/bitbake/in_host.py | 2 +- src/oebuild/app/plugins/clear/clear.py | 6 +++--- src/oebuild/app/plugins/compile/compile.py | 4 ++-- src/oebuild/app/plugins/deploy/com_target.py | 12 ++++++------ src/oebuild/app/plugins/generate/generate.py | 6 +++--- src/oebuild/app/plugins/init/init.py | 8 ++++---- src/oebuild/app/plugins/manifest/manifest.py | 2 +- src/oebuild/app/plugins/run_qemu/run_qemu.py | 2 +- src/oebuild/app/plugins/update/update.py | 8 ++++---- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/oebuild/app/plugins/bitbake/bitbake.py b/src/oebuild/app/plugins/bitbake/bitbake.py index 2fb8190..4c66bc5 100644 --- a/src/oebuild/app/plugins/bitbake/bitbake.py +++ b/src/oebuild/app/plugins/bitbake/bitbake.py @@ -76,7 +76,7 @@ class Bitbake(OebuildCommand): command = self._get_command(unknow=unknown) if not self.check_support_bitbake(): - logger.error("please do it in compile workspace which contain compile.yaml") + logger.error("Please do it in compile workspace which contain compile.yaml") return if not os.path.exists('.env'): diff --git a/src/oebuild/app/plugins/bitbake/in_container.py b/src/oebuild/app/plugins/bitbake/in_container.py index 24a49dc..2bd0503 100644 --- a/src/oebuild/app/plugins/bitbake/in_container.py +++ b/src/oebuild/app/plugins/bitbake/in_container.py @@ -47,11 +47,11 @@ class InContainer(BaseBuild): ''' execute bitbake command ''' - logger.info("bitbake starting ...") + logger.info("Bitbake starting ...") # check docker image if exists docker_proxy = DockerProxy() if not docker_proxy.is_image_exists(parse_compile.docker_image): - logger.error('''the docker image does not exists, please run fellow command: + logger.error('''The docker image does not exists, please run fellow command: `oebuild update docker`''') return diff --git a/src/oebuild/app/plugins/bitbake/in_host.py b/src/oebuild/app/plugins/bitbake/in_host.py index 7c9fef1..970ce09 100644 --- a/src/oebuild/app/plugins/bitbake/in_host.py +++ b/src/oebuild/app/plugins/bitbake/in_host.py @@ -55,7 +55,7 @@ class InHost(BaseBuild): src_dir=self.configure.source_dir()) except NativesdkNotExist as n_e: logger.error(str(n_e)) - logger.error("please set valid nativesdk directory") + logger.error("Please set valid nativesdk directory") return except NativesdkNotValid as n_e: logger.error(str(n_e)) diff --git a/src/oebuild/app/plugins/clear/clear.py b/src/oebuild/app/plugins/clear/clear.py index 91fd296..69b306b 100644 --- a/src/oebuild/app/plugins/clear/clear.py +++ b/src/oebuild/app/plugins/clear/clear.py @@ -66,7 +66,7 @@ class Clear(OebuildCommand): try: self.client = DockerProxy() except DockerException: - logger.error("please install docker first!!!") + logger.error("Please install docker first!!!") return self.clear_docker() @@ -75,7 +75,7 @@ class Clear(OebuildCommand): clear container ''' # get all build directory and get .env from every build directory - logger.info("clearing container, please waiting ...") + logger.info("Clearing container, please waiting ...") env_list = [] build_list = os.listdir(self.configure.build_dir()) for build_dir in build_list: @@ -91,7 +91,7 @@ class Clear(OebuildCommand): container = self.client.get_container(container_id=container_id) DockerProxy().stop_container(container=container) DockerProxy().delete_container(container=container) - logger.info("delete container: %s successful",container.short_id) + logger.info("Delete container: %s successful",container.short_id) except: continue diff --git a/src/oebuild/app/plugins/compile/compile.py b/src/oebuild/app/plugins/compile/compile.py index c12b126..e030855 100644 --- a/src/oebuild/app/plugins/compile/compile.py +++ b/src/oebuild/app/plugins/compile/compile.py @@ -76,7 +76,7 @@ class Compile(OebuildCommand): try: self.client = DockerProxy() except DockerException: - logger.error("please install docker first!!!") + logger.error("Please install docker first!!!") return if(args.source_directory) is None: @@ -99,7 +99,7 @@ class Compile(OebuildCommand): # parse_compile = ParseCompile(self.compile_conf_dir) if not self.client.is_image_exists(default_image): - logger.error(f'''the docker image does not exists, please run fellow command: + logger.error(f'''The docker image does not exists, please run fellow command: `oebuild update docker`''') container:Container = self.client.container_run_simple(image=default_image, volumes=[]) diff --git a/src/oebuild/app/plugins/deploy/com_target.py b/src/oebuild/app/plugins/deploy/com_target.py index a9907d1..115f4ea 100644 --- a/src/oebuild/app/plugins/deploy/com_target.py +++ b/src/oebuild/app/plugins/deploy/com_target.py @@ -41,23 +41,23 @@ class ComTarget: self.client = DockerProxy() if not self._check_compile_directory(): - logger.error("you must be worked in compile directory") + logger.error("You must be worked in compile directory") sys.exit(-1) if not self._check_if_docker_compile(): - logger.error("the deploy function only be supported in working with docker build") + logger.error("The deploy function only be supported in working with docker build") sys.exit(-1) if not self._check_yocto_poky(): - logger.error("""please make sure that yocto-poky source code in src directory, or you can run: - oebuild update layer""") + logger.error('''Please make sure that yocto-poky source code in src directory, or you can run: + oebuild update layer''') sys.exit(-1) if not self._check_conf_directory(): - logger.error("you must work in a exist build directory, that mean you built before or initialize environment at least") + logger.error("You must work in a exist build directory, that mean you built before or initialize environment at least") sys.exit(-1) - logger.info("initializing environment, please wait ...") + logger.info("Initializing environment, please wait ...") parse_env = ParseEnv(env_dir='.env') self.deal_env_container(parse_env, oebuild_util.DEFAULT_DOCKER) container:Container = self.client.get_container(self.container_id) diff --git a/src/oebuild/app/plugins/generate/generate.py b/src/oebuild/app/plugins/generate/generate.py index ac56b0c..31f9369 100644 --- a/src/oebuild/app/plugins/generate/generate.py +++ b/src/oebuild/app/plugins/generate/generate.py @@ -153,7 +153,7 @@ class Generate(OebuildCommand): args = args.parse_args(unknown) if not self.configure.is_oebuild_dir(): - logger.error('your current directory had not finishd init') + logger.error('Your current directory had not finished init') sys.exit(-1) yocto_dir = self.configure.source_yocto_dir() @@ -168,7 +168,7 @@ class Generate(OebuildCommand): args.platform = platform build_dir = self._init_build_dir(args=args) if build_dir is None: - logger.error("build directory can not mkdir") + logger.error("Build directory can not mkdir") return # copy compile.yaml to build directory copyfile(args.compile_dir, os.path.join(build_dir, "compile.yaml")) @@ -344,7 +344,7 @@ oebuild bitbake build_dir = os.path.join(self.configure.build_dir(), args.directory) if not os.path.abspath(build_dir).startswith(self.configure.build_dir()): - logger.error("build path must in oebuild workspace") + logger.error("Build path must in oebuild workspace") return None if not os.path.exists(build_dir): diff --git a/src/oebuild/app/plugins/init/init.py b/src/oebuild/app/plugins/init/init.py index 5644e1d..5680b7c 100644 --- a/src/oebuild/app/plugins/init/init.py +++ b/src/oebuild/app/plugins/init/init.py @@ -95,7 +95,7 @@ class Init(OebuildCommand): return if not self.init_workspace(args.directory): - logger.error("mkdir %s faild", args.directory) + logger.error("mkdir %s failed", args.directory) return os.chdir(args.directory) @@ -147,7 +147,7 @@ please execute the follow commands next os.mkdir(oebuild_dir) return oebuild_dir except FileExistsError: - logger.error("mkdir .oebuild faild") + logger.error("mkdir .oebuild failed") return "" @staticmethod @@ -160,7 +160,7 @@ please execute the follow commands next os.makedirs(src_dir) return src_dir except FileExistsError: - logger.error("mkdir src faild") + logger.error("mkdir src failed") return None @staticmethod @@ -183,4 +183,4 @@ please execute the follow commands next compil = oebuild_util.get_compile_yaml_dir() shutil.copyfile(compil, os.path.join(updir, COMPILE_YAML)) except FileNotFoundError: - logger.error("mkdir compile.yaml.sample faild") + logger.error("mkdir compile.yaml.sample failed") diff --git a/src/oebuild/app/plugins/manifest/manifest.py b/src/oebuild/app/plugins/manifest/manifest.py index 866066c..33c1e4c 100644 --- a/src/oebuild/app/plugins/manifest/manifest.py +++ b/src/oebuild/app/plugins/manifest/manifest.py @@ -70,7 +70,7 @@ class Manifest(OebuildCommand): def do_run(self, args: argparse.Namespace, unknown = None): if not self.configure.is_oebuild_dir(): - logger.error('your current directory had not finishd init') + logger.error('Your current directory had not finished init') sys.exit(-1) if not (unknown and unknown[0] in self.manifest_command): diff --git a/src/oebuild/app/plugins/run_qemu/run_qemu.py b/src/oebuild/app/plugins/run_qemu/run_qemu.py index b48937e..c3422b2 100644 --- a/src/oebuild/app/plugins/run_qemu/run_qemu.py +++ b/src/oebuild/app/plugins/run_qemu/run_qemu.py @@ -78,7 +78,7 @@ the container {self.container_id} failed to be destroyed, please run try: self.client = DockerProxy() except DockerException: - logger.error("please install docker first!!!") + logger.error("Please install docker first!!!") return logger.info('Run QEMU......') diff --git a/src/oebuild/app/plugins/update/update.py b/src/oebuild/app/plugins/update/update.py index 6b2630b..951b9ef 100644 --- a/src/oebuild/app/plugins/update/update.py +++ b/src/oebuild/app/plugins/update/update.py @@ -89,7 +89,7 @@ class Update(OebuildCommand): args = args.parse_args(unknown) if not self.configure.is_oebuild_dir(): - logger.error('your current directory had not finishd init') + logger.error('Your current directory had not finished init') sys.exit(-1) # if args.list is not None: @@ -107,7 +107,7 @@ class Update(OebuildCommand): elif args.item == "layer": update_layer = True else: - logger.error('please run oebuild update [yocto docker layer]') + logger.error('Please run oebuild update [yocto docker layer]') sys.exit(-1) @@ -204,6 +204,6 @@ class Update(OebuildCommand): docker_image = docker_config.repo_url + ":" + check_docker_tag.get_tag() client = DockerProxy() - logger.info("pull %s ...", docker_image) + logger.info("Pull %s ...", docker_image) client.pull_image_with_progress(docker_image) - logger.info("finishd pull %s ...", docker_image) + logger.info("Finished pull %s ...", docker_image) -- Gitee