From ebef0bf87a22630ea2d5160aaf51051767e92fa6 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Sat, 27 Jul 2024 15:30:05 -0500 Subject: Simplify get_parent logic --- server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 7d33a66..6dd226d 100644 --- a/server.py +++ b/server.py @@ -29,8 +29,10 @@ con.commit() def get_parent(path): if path in watchdirs: - return os.stat("/").st_ino - return os.stat(pathlib.Path(path).parent).st_ino + parent = "/" + else: + parent = pathlib.Path(path).parent + return os.stat(parent).st_ino class EventHandler(FileSystemEventHandler): -- cgit v1.2.3-70-g09d2