Skip to content

Commit

Permalink
Add watchdog.tricks to the API documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
goncalor authored and BoboTiG committed Oct 10, 2020
1 parent 1c6f52a commit d95692b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/source/api.rst
Expand Up @@ -70,6 +70,11 @@ API Reference

.. automodule:: watchdog.utils.dirsnapshot

`watchdog.tricks`
=================

.. automodule:: watchdog.tricks


.. toctree::
:maxdepth: 2
28 changes: 26 additions & 2 deletions src/watchdog/tricks/__init__.py
Expand Up @@ -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
Expand Down Expand Up @@ -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.
"""

Expand Down

0 comments on commit d95692b

Please sign in to comment.