cement.ext.ext_watchdog
¶
Cement watchdog extension module.
Note This extension has an external dependency on watchdog
. Cement
explicitly does not include external dependencies for optional
extensions.
- In Cement
>=3.0.8
you must includecement[watchdog]
in your applications dependencies. - In Cement
<3.0.8
you must includewatchdog
in your applications dependencies.
-
class
cement.ext.ext_watchdog.
WatchdogEventHandler
(app, *args, **kw)[source]¶ Bases:
watchdog.events.FileSystemEventHandler
Default event handler used by Cement, that logs all events to the application’s debug log. Additional
*args
and**kwargs
are passed to the parent class.Parameters: app – The application object
-
class
cement.ext.ext_watchdog.
WatchdogManager
(app, *args, **kw)[source]¶ Bases:
cement.core.meta.MetaMixin
The manager class that is attached to the application object via
App.extend()
.Usage:
with MyApp() as app: app.watchdog.start() app.watchdog.stop() app.watchdog.join()
-
add
(path, event_handler=None, recursive=True)[source]¶ Add a directory path and event handler to the observer.
Parameters: path (str) – A directory path to monitor (str)
Keyword Arguments: - event_handler (class) – An event handler class used to handle events
for
path
(class) - recursive (bool) – Whether to monitor the
path
recursively
Returns: True
if the path is added,False
otherwise.Return type: - event_handler (class) – An event handler class used to handle events
for
-
join
(*args, **kw)[source]¶ Join the observer with the parent process. All
*args
and**kwargs
are passed down to the backend observer.
-