From d963b10c5d1b461072e7fb5bdfae90d40f671bd1 Mon Sep 17 00:00:00 2001 From: Martin van Es <martin@mrvanes.com> Date: Thu, 27 Jan 2022 13:37:09 +0100 Subject: [PATCH] WIP --- utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils.py b/utils.py index 0792dc0..860e3dd 100755 --- a/utils.py +++ b/utils.py @@ -123,8 +123,11 @@ class Resource: class EventProcessor(pyinotify.ProcessEvent): + def __init__(self, server): + self.server = server + def process_IN_CLOSE_WRITE(self, event): - server.process(event.path) + self.server.process(event.path) class Server: @@ -132,7 +135,7 @@ class Server: def __init__(self): self.watch_manager = pyinotify.WatchManager() - self.event_notifier = pyinotify.ThreadedNotifier(self.watch_manager, EventProcessor()) + self.event_notifier = pyinotify.ThreadedNotifier(self.watch_manager, EventProcessor(self)) self.event_notifier.start() def add_watch(self, domain, location): -- GitLab