From d95692b5ff8fe0f459b58f758f5cb6a7dce112df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Ribeiro?= Date: Tue, 15 Sep 2020 23:58:11 +0100 Subject: [PATCH] Add watchdog.tricks to the API documentation --- docs/source/api.rst | 5 +++++ src/watchdog/tricks/__init__.py | 28 ++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/docs/source/api.rst b/docs/source/api.rst index c0327ff1..18a9b4f6 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -70,6 +70,11 @@ API Reference .. automodule:: watchdog.utils.dirsnapshot +`watchdog.tricks` +================= + +.. automodule:: watchdog.tricks + .. toctree:: :maxdepth: 2 diff --git a/src/watchdog/tricks/__init__.py b/src/watchdog/tricks/__init__.py index 7e1c9fe2..0de2b3f8 100644 --- a/src/watchdog/tricks/__init__.py +++ b/src/watchdog/tricks/__init__.py @@ -16,6 +16,30 @@ # See the License for the specific language governing permissions and # limitations under the License. +""" +:module: watchdog.tricks +:synopsis: Utility event handlers. +:author: yesudeep@google.com (Yesudeep Mangalapilly) + +Classes +------- +.. autoclass:: Trick + :members: + :show-inheritance: + +.. autoclass:: LoggerTrick + :members: + :show-inheritance: + +.. autoclass:: ShellCommandTrick + :members: + :show-inheritance: + +.. autoclass:: AutoRestartTrick + :members: + :show-inheritance: + +""" import os import signal @@ -127,9 +151,9 @@ class AutoRestartTrick(Trick): """Starts a long-running subprocess and restarts it on matched events. The command parameter is a list of command arguments, such as - ['bin/myserver', '-c', 'etc/myconfig.ini']. + `['bin/myserver', '-c', 'etc/myconfig.ini']`. - Call start() after creating the Trick. Call stop() when stopping + Call `start()` after creating the Trick. Call `stop()` when stopping the process. """