From f7eb12a3eeb00a63f69becc194999a41475b3931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 14 Oct 2016 14:15:19 +0200 Subject: [PATCH] Docs for {Reload|Restart}NeedingPlugin --- docs/plugins/concepts.rst | 4 ++++ docs/plugins/hooks.rst | 8 ++++++++ docs/plugins/mixins.rst | 17 +++++++++++++++++ src/octoprint/plugin/core.py | 2 +- src/octoprint/plugin/types.py | 2 +- 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/docs/plugins/concepts.rst b/docs/plugins/concepts.rst index 0fc29ea5..ceaf3aca 100644 --- a/docs/plugins/concepts.rst +++ b/docs/plugins/concepts.rst @@ -35,6 +35,10 @@ any :ref:`settings overlays /`` (if the path already begins with a ``/`` that will be stripped first). + .. important:: + + Implementing this hook will make your plugin require a restart of OctoPrint for enabling/disabling it fully. + **Example** The following plugin example sets the maximum body size for ``POST`` requests against four custom URLs to 100, 200, @@ -779,6 +783,10 @@ octoprint.server.http.routes view of the blueprint will thus not be reachable since processing of the request will directly be handed over to your defined handler class. + .. important:: + + Implementing this hook will make your plugin require a restart of OctoPrint for enabling/disabling it fully. + **Example** The following example registers two new routes ``/plugin/add_tornado_route/download`` and ``/plugin/add_tornado_route/forward`` diff --git a/docs/plugins/mixins.rst b/docs/plugins/mixins.rst index 138de00e..95bf3e5c 100644 --- a/docs/plugins/mixins.rst +++ b/docs/plugins/mixins.rst @@ -276,3 +276,20 @@ SlicerPlugin :members: :show-inheritance: +.. _sec-plugins-mixins-restartneeding: + +RestartNeedingPlugin +~~~~~~~~~~~~~~~~~~~~ + +.. autoclass:: octoprint.plugin.RestartNeedingPlugin + :members: + :show-inheritance: + +.. _sec-plugins-mixins-reloadneeding: + +ReloadNeedingPlugin +~~~~~~~~~~~~~~~~~~~ + +.. autoclass:: octoprint.plugin.ReloadNeedingPlugin + :members: + :show-inheritance: diff --git a/src/octoprint/plugin/core.py b/src/octoprint/plugin/core.py index 944700ee..c95f1326 100644 --- a/src/octoprint/plugin/core.py +++ b/src/octoprint/plugin/core.py @@ -1396,7 +1396,7 @@ class Plugin(object): class RestartNeedingPlugin(Plugin): """ - Mixin for plugin types that need a restart in order to be enabled. + Mixin for plugin types that need a restart after enabling/disabling them. """ class SortablePlugin(Plugin): diff --git a/src/octoprint/plugin/types.py b/src/octoprint/plugin/types.py index 2bcc9f3b..f0bb76a7 100644 --- a/src/octoprint/plugin/types.py +++ b/src/octoprint/plugin/types.py @@ -101,7 +101,7 @@ class OctoPrintPlugin(Plugin): class ReloadNeedingPlugin(Plugin): """ - Mixin for plugin types that need a reload of the UI in order to become usable. + Mixin for plugin types that need a reload of the UI after enabling/disabling them. """ class StartupPlugin(OctoPrintPlugin, SortablePlugin):