From 8c81e6ae02f7ca227b88c41f9000a7e47f2edcc1 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 1 Nov 2023 14:13:41 +0800 Subject: [PATCH] add platform --- app/utils/system.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/utils/system.py b/app/utils/system.py index 45e04ec8..dafc3947 100644 --- a/app/utils/system.py +++ b/app/utils/system.py @@ -71,6 +71,20 @@ class SystemUtils: """ return True if platform.machine() == 'aarch64' else False + @property + def platform(self) -> str: + """ + 获取系统平台 + """ + if SystemUtils.is_windows(): + return "Windows" + elif SystemUtils.is_macos(): + return "MacOS" + elif SystemUtils.is_aarch64(): + return "Arm64" + else: + return "Linux" + @staticmethod def copy(src: Path, dest: Path) -> Tuple[int, str]: """