From 752ff618b23b6e8f3f8c6416039464e60ac65d76 Mon Sep 17 00:00:00 2001 From: gooker_young Date: Sat, 27 Jun 2026 09:00:22 +0800 Subject: [PATCH] =?UTF-8?q?refactor(system=20tasks):=20=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E4=BB=A3=E7=A0=81=E5=B9=B6=E6=96=B0=E5=A2=9E=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E8=B5=84=E6=BA=90=E7=AE=A1=E7=90=86=E5=99=A8=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将原有的单行TaskSpec调用拆分为多行格式化写法,同时补充restart_explorer任务到任务列表中 --- src/pyflowx/tasks/system.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/pyflowx/tasks/system.py b/src/pyflowx/tasks/system.py index 27fd635..6150117 100644 --- a/src/pyflowx/tasks/system.py +++ b/src/pyflowx/tasks/system.py @@ -26,20 +26,28 @@ def reset_icon_cache() -> list[px.TaskSpec]: return [] return [ - px.TaskSpec("kill_explorer", fn=lambda: subprocess.run(["taskkill", "/f", "/im", "explorer.exe"], check=False), verbose=True), + px.TaskSpec( + "kill_explorer", + fn=lambda: subprocess.run(["taskkill", "/f", "/im", "explorer.exe"], check=False), + verbose=True, + ), px.TaskSpec( "delete_icon_cache", fn=lambda: subprocess.run(["del", "/a", "/q", r"%localappdata%\IconCache.db"], check=False), - verbose=True + verbose=True, ), px.TaskSpec( "delete_icon_cache_all", fn=lambda: subprocess.run( ["del", "/a", "/q", r"%localappdata%\Microsoft\Windows\Explorer\iconcache*"], check=False ), - verbose=True + verbose=True, + ), + px.TaskSpec( + "restart_explorer", + fn=lambda: subprocess.run(["cmd", "/c", "start", "explorer.exe"], check=False), + verbose=True, ), - px.TaskSpec("restart_explorer", fn=lambda: subprocess.run(["cmd", "/c", "start", "explorer.exe"], check=False), verbose=True), ]