diff options
author | Anthony Wang | 2024-07-27 15:30:05 -0500 |
---|---|---|
committer | Anthony Wang | 2024-07-27 15:30:05 -0500 |
commit | ebef0bf87a22630ea2d5160aaf51051767e92fa6 (patch) | |
tree | cf6c938d81c6f16d3010e981916c82172e480729 | |
parent | 2cadf76f9da405d8b4ada0121d2f9f7fdc842f6c (diff) |
Simplify get_parent logic
-rw-r--r-- | server.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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): |