From 45b413a78dc21e76f36456206942d8ba750b4e87 Mon Sep 17 00:00:00 2001 From: Thomas Oettli Date: Tue, 3 Nov 2020 13:26:51 +0100 Subject: [PATCH] change README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ca80f66..30cbc97 100644 --- a/README.md +++ b/README.md @@ -69,8 +69,10 @@ async def custom_task(event, task_id): logging.info(f"{task_id}: execute example task: {event}") s = TaskScheduler(task=custom_task, files=True, dirs=True) + event_map = EventMap(default_task=custom_task) watch = Watch(path="/tmp", event_map=event_map, rec=True, auto_add=True) + pyinotifyd_config = PyinotifydConfig( watches=[watch], loglevel=logging.INFO, shutdown_timeout=5) ``` @@ -79,9 +81,11 @@ pyinotifyd_config = PyinotifydConfig( ```python s = ShellScheduler( cmd="/usr/local/sbin/task.sh {pathname}", files=True, dirs=False) + event_map = EventMap({"IN_WRITE_CLOSE": s.schedule, "IN_DELETE": s.schedule}) watch = Watch(path="/tmp", event_map=event_map, rec=True, auto_add=True) + pyinotifyd_config = PyinotifydConfig( watches=[watch], loglevel=logging.INFO, shutdown_timeout=5) ```