Merge remote-tracking branch 'origin/devel' into devel
This commit is contained in:
commit
8a70b5cd7f
1 changed files with 3 additions and 3 deletions
|
|
@ -600,18 +600,18 @@ class BlueprintPlugin(OctoPrintPlugin):
|
||||||
return flask.make_response("Expected a text to echo back.", 400)
|
return flask.make_response("Expected a text to echo back.", 400)
|
||||||
return flask.request.values["text"]
|
return flask.request.values["text"]
|
||||||
|
|
||||||
__plugin_implementations__ = [MyPlugin()]
|
__plugin_implementations__ = [MyBlueprintPlugin()]
|
||||||
|
|
||||||
Your blueprint will be published by OctoPrint under the base URL ``/plugin/<plugin identifier>/``, so the above
|
Your blueprint will be published by OctoPrint under the base URL ``/plugin/<plugin identifier>/``, so the above
|
||||||
example of a plugin with the identifier "myblueprintplugin" would be reachable under
|
example of a plugin with the identifier "myblueprintplugin" would be reachable under
|
||||||
``/plugin/myblueprintplugin/echo``.
|
``/plugin/myblueprintplugin/echo``.
|
||||||
|
|
||||||
Just like with regular blueprints you'll be able to create URLs via ``url_for``, just use the prefix
|
Just like with regular blueprints you'll be able to create URLs via ``url_for``, just use the prefix
|
||||||
``plugin.<plugin identifier>``, e.g.:
|
``plugin.<plugin identifier>.<method_name>``, e.g.:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
flask.url_for("plugin.myblueprintplugin.echo") # will return "/plugin/myblueprintplugin/echo"
|
flask.url_for("plugin.myblueprintplugin.myEcho") # will return "/plugin/myblueprintplugin/echo"
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue