From 7ee3eb377eb3eae21495c6120f17ee793f34c956 Mon Sep 17 00:00:00 2001 From: Snowykami Date: Tue, 10 Dec 2024 13:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DmacOS=E6=8C=82=E8=BD=BD?= =?UTF-8?q?=E7=82=B9=E6=A3=80=E6=9F=A5=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A1=AE?= =?UTF-8?q?=E4=BF=9D=E6=AD=A3=E7=A1=AE=E5=A4=84=E7=90=86=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=92=8C=E5=BA=94=E7=94=A8=E7=A8=8B=E5=BA=8F=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server_status/api.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/server_status/api.py b/server_status/api.py index 04ef6fa..1c7512a 100644 --- a/server_status/api.py +++ b/server_status/api.py @@ -17,6 +17,11 @@ excluded_partition_prefix = ( "/dev", "/tmp", "/snap", + + "/System", + "/Applications", + "/private", + "/Library", ) include_partition_prefix_mac = ("/Volumes") @@ -214,21 +219,13 @@ class Client: if ( ( - platform.system() == "Linux" + platform.system() in ("Linux", "Darwin") and ( part.mountpoint.startswith( excluded_partition_prefix ) ) ) - or - ( - platform.system() == "Darwin" - and ((not part.mountpoint.startswith( - include_partition_prefix_mac - )) or not part.mountpoint == "/") - ) - or usage.total == 0 ): continue