From 29e07826289274d3e15c4f96bd8492d8098b9834 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sun, 8 Feb 2009 18:22:44 +1100 Subject: [PATCH] dnotify: allow a notification request to be cancelled. --- lib/dnotify.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/dnotify.py b/lib/dnotify.py index 7ae7aea..1cd8c41 100644 --- a/lib/dnotify.py +++ b/lib/dnotify.py @@ -38,6 +38,10 @@ class dir(): for f in self.files: f.check() + def cancel(self, victim): + if victim in self.files: + self.files.remove(victim) + class file(): def __init__(self, fname, callback): self.name = fname @@ -58,6 +62,12 @@ class file(): self.callback(self) return True + def cancel(self): + global dirlist + for d in dirlist: + d.cancel(self) + + if __name__ == "__main__" : import signal -- 2.39.5