diff --git a/.github/data/aklog.rb b/.github/data/aklog.rb index a69edf4..c85e7bb 100644 --- a/.github/data/aklog.rb +++ b/.github/data/aklog.rb @@ -11,14 +11,14 @@ class Aklog < Formula def install libexec.install Dir["*"] bin.install libexec/"aklog" => "aklog" - bin.install libexec/"hilog" => "hilog" + bin.install libexec/"akhos" => "akhos" inreplace bin/"aklog", "exe_path", "#{libexec}" - inreplace bin/"hilog", "exe_path", "#{libexec}" + inreplace bin/"akhos", "exe_path", "#{libexec}" end test do system bin/"aklog", "--version" - system bin/"hilog", "--version" + system bin/"akhos", "--version" end end \ No newline at end of file diff --git a/hilog b/akhos similarity index 84% rename from hilog rename to akhos index b98a880..9de0d06 100755 --- a/hilog +++ b/akhos @@ -10,10 +10,10 @@ has(){ if has "python3"; then # shellcheck disable=SC2068 - python3 ${AK_DIR}/hilog.py $@ + python3 ${AK_DIR}/akhos.py $@ elif has "python"; then # shellcheck disable=SC2068 - python ${AK_DIR}/hilog.py $@ + python ${AK_DIR}/akhos.py $@ else echo >&2 "Failed to execute, please install python before." fi \ No newline at end of file diff --git a/hilog.py b/akhos.py similarity index 98% rename from hilog.py rename to akhos.py index d8b904c..dcb32c5 100644 --- a/hilog.py +++ b/akhos.py @@ -21,7 +21,7 @@ def _to_str_arr(obj: Any) -> List[str]: return _targetList -class HiLogArgs(object): +class AkHosArgs(object): dest_version = "version" dest_package = "package" dest_package_all = "package_all" @@ -48,7 +48,7 @@ def __init__(self): with open(cfg_path, 'r') as f: self.cfg = yaml.load(f, Loader=yaml.SafeLoader) version = self.cfg['version'] - self.HI_LOG_VERSION = f"{version['prefix']}{version['major']}.{version['minor']}.x" + self.AK_HOS_VERSION = f"{version['prefix']}{version['major']}.{version['minor']}.x" # def _define_args_package(self, args_parser: argparse.ArgumentParser): # args_package = args_parser.add_mutually_exclusive_group() @@ -219,8 +219,8 @@ def _parser_run_cmd(self, args: Dict[str, object]) -> bool: def _define_args(self) -> argparse.ArgumentParser: args_parser = argparse.ArgumentParser( - description=f"Harmony开发利器-HiLog-{self.HI_LOG_VERSION} (Harmony developer's Swiss Army Knife for Log)") - args_parser.add_argument('-v', '--' + self.dest_version, action=self.dest_version, version=self.HI_LOG_VERSION) + description=f"Harmony开发利器-HiLog-{self.AK_HOS_VERSION} (Harmony developer's Swiss Army Knife for Log)") + args_parser.add_argument('-v', '--' + self.dest_version, action=self.dest_version, version=self.AK_HOS_VERSION) # package 相关参数 # self._define_args_package(args_parser) # # tag 过滤相关参数 @@ -273,4 +273,4 @@ def run(self, argv: Optional[List] = None): if __name__ == '__main__': - HiLogArgs().run() + AkHosArgs().run() diff --git a/screen_cap_tools.py b/screen_cap_tools.py index fa5324b..8f460fc 100644 --- a/screen_cap_tools.py +++ b/screen_cap_tools.py @@ -30,7 +30,10 @@ def get_phone_cap_dir(self) -> str: def do_capture(self): comm_tools.create_dir_not_exists(self._dir_path) - pic_name = datetime.datetime.now().strftime("%m%d-%H%M%S-%f.png") + if self._is_harmonyos: + pic_name = datetime.datetime.now().strftime("%m%d-%H%M%S-%f.jpeg") + else: + pic_name = datetime.datetime.now().strftime("%m%d-%H%M%S-%f.png") pic_local_path = os.path.join(self._dir_path, pic_name) pic_phone_path = os.path.join(self.get_phone_cap_dir(), pic_name) if self._is_harmonyos: