diff --git a/tools/gitee_tag_manager.py b/tools/gitee_tag_manager.py index 235eda5ec8f8e2f88527040e3a2ce99e572d9732..3c5d8e0b3adb71f4c2c726bd692b1f12aeab4df9 100644 --- a/tools/gitee_tag_manager.py +++ b/tools/gitee_tag_manager.py @@ -89,7 +89,7 @@ class GiteeTagManager: def clone_package(self, pkg): """clone package""" - logging.info("start clone package: {}".format(pkg)) + logging.info("Started to clone package: {}".format(pkg)) clone_flag = False _, temp_path, _ = self.run("mktemp -d") temp_path = temp_path.strip() @@ -108,20 +108,20 @@ class GiteeTagManager: self.run("rm -rf {}".format(pkg_path)) except Exception as e: self.run("rm -rf {}".format(temp_path)) - logging.info("finish clone package: {}".format(pkg)) + logging.info("Finished to clone package: {}".format(pkg)) if (not clone_flag) and (os.path.exists(temp_path)): shutil.rmtree(temp_path) return clone_flag, temp_path def add_tag(self, pkg, pkg_path): """pkg add tag""" - logging.info("start add tag for package: {}".format(pkg)) + logging.info("Started to add tag for package: {}".format(pkg)) tag_flag = False # 1. tag already exist _, tags, _ = self.run(f"cd {pkg_path} && git tag && cd - > /dev/null") if self.tag_name in tags: - logging.warning("package: {} tag already exist!".format(pkg)) + logging.warning("Package: {} tag already exist!".format(pkg)) tag_flag = True return tag_flag @@ -134,10 +134,10 @@ class GiteeTagManager: # 3. check result _, tags, _ = self.run(f"cd {pkg_path} && git tag && cd - > /dev/null") if self.tag_name in tags: - logging.info("package: {} add tag: {} ok!".format(pkg, self.tag_name)) + logging.info("Package: {} add tag: {} ok!".format(pkg, self.tag_name)) tag_flag = True - logging.info("finish add tag for package: {}".format(pkg)) + logging.info("Finished to add tag for package: {}".format(pkg)) return tag_flag def delete_tag(self, pkg): @@ -165,21 +165,21 @@ class GiteeTagManager: try: clone_flag, temp_path = self.clone_package(pkg) if not clone_flag: - logging.error("clone pkg: {} failed!".format(pkg)) + logging.error("Clone pkg: {} failed!".format(pkg)) self.failed_list.append(pkg) return except Exception as e: - logging.error("clone pkg: {} Exception: {}!".format(pkg, e)) + logging.error("Clone pkg: {} Exception: {}!".format(pkg, e)) self.failed_list.append(pkg) return # 2. tag manage try: if not self.tag_manage(pkg, temp_path): - logging.error("tag pkg: {} failed!".format(pkg)) + logging.error("Tag pkg: {} failed!".format(pkg)) self.failed_list.append(pkg) except Exception as e: - logging.error("tag pkg: {} Exception: {}!".format(pkg, e)) + logging.error("Tag pkg: {} Exception: {}!".format(pkg, e)) self.failed_list.append(pkg) def manage(self): @@ -192,7 +192,7 @@ class GiteeTagManager: if not pkg_list: raise SystemExit("ERROR: there is no package to deal with") # 3. manage tag with ThreadPoolExecutor - logging.info("start tag manager!") + logging.info("Started to tag manager!") with ThreadPoolExecutor(max_workers=30) as job: obj_list = [] @@ -209,10 +209,10 @@ class GiteeTagManager: self.failed_list = list(set(self.failed_list)) pkg_num = len(pkg_list) failed_num = len(self.failed_list) - logging.info("all package number: {}".format(pkg_num)) - logging.info("tag success package number: {}".format(pkg_num - failed_num)) - logging.info("tag failed package number: {}".format(failed_num)) - logging.info("tag failed package list: {}".format(self.failed_list)) + logging.info("All package number: {}".format(pkg_num)) + logging.info("Tag success package number: {}".format(pkg_num - failed_num)) + logging.info("Tag failed package number: {}".format(failed_num)) + logging.info("Tag failed package list: {}".format(self.failed_list)) if self.failed_list: raise SystemExit("ERROR: some packages failed!")