From 3914ff4dd6cf2029a103b5cfa51ab99af8b1a1b8 Mon Sep 17 00:00:00 2001 From: mayun110 Date: Sat, 9 Sep 2023 17:49:40 +0800 Subject: [PATCH] =?UTF-8?q?fix=20Windows=E4=B8=8B=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/plugins/dirmonitor/__init__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/plugins/dirmonitor/__init__.py b/app/plugins/dirmonitor/__init__.py index 8a4b3445..0b9bbcf1 100644 --- a/app/plugins/dirmonitor/__init__.py +++ b/app/plugins/dirmonitor/__init__.py @@ -1,3 +1,4 @@ +import platform import re import shutil import threading @@ -122,7 +123,15 @@ class DirMonitor(_PluginBase): continue # 存储目的目录 - paths = mon_path.split(":") + system = platform.system() + if system == "Windows": + if mon_path.count(":") > 1: + paths = [mon_path.split(":")[0] + ":" + mon_path.split(":")[1], + mon_path.split(":")[2] + ":" + mon_path.split(":")[3]] + else: + paths = [mon_path] + else: + paths = mon_path.split(":") target_path = None if len(paths) > 1: mon_path = paths[0]