add warning message if no watches configured

This commit is contained in:
2020-11-05 12:58:34 +01:00
parent 642837f960
commit 1852110c0d

View File

@@ -58,12 +58,12 @@ class Pyinotifyd:
self._shutdown_timeout = timeout
def start(self, loop=None):
assert len(self._watches) > 0, \
"pyinotifyd: unable to start, no watches configured"
if not loop:
loop = self._loop
self._log.info("starting")
if len(self._watches) == 0:
self._log.warning("no watches configured, the daemon will not do anything"
for watch in self._watches:
self._log.info(f"start watching '{watch.path}' for inotify events")
self._notifiers.append(watch.event_notifier(self._wm, loop))