Merge branch 'maintenance' into devel

This commit is contained in:
Gina Häußge committed 2020-09-28 11:43:17 +02:00
commit a24dad6bdb
84 files changed
+878 -286

No files matched your search

@@ -3,7 +3,9 @@
Action Command Notification support
===================================
The OctoPrint Action Command Notification Support Plugin comes bundled with OctoPrint (starting with 1.4.1).
.. versionadded:: 1.4.1
The OctoPrint Action Command Notification Support Plugin comes bundled with OctoPrint.
It allows firmware to trigger notifications users with the ``PLUGIN_ACTION_COMMAND_NOTIFICATION_SHOW`` permission
using :ref:`action commands <sec-features-action_commands>` about relevant events. These notifications will be shown
@@ -3,7 +3,9 @@
Action Command Prompt support
=============================
The OctoPrint Action Command Prompt Support Plugin comes bundled with OctoPrint (starting with 1.3.9).
.. versionadded:: 1.3.9
The OctoPrint Action Command Prompt Support Plugin comes bundled with OctoPrint.
It allows firmware to trigger dialog prompts for logged in users using :ref:`action commands <sec-features-action_commands>`, e.g. to wait
for user acknowledgement or allow the user to choose between options, and also to close the dialog again
+3 -1
View File
@@ -3,7 +3,9 @@
Announcement Plugin
===================
The OctoPrint Announcement Plugin comes bundled with OctoPrint (starting with 1.2.11).
.. versionadded:: 1.2.11
The OctoPrint Announcement Plugin comes bundled with OctoPrint.
It displays announcements fetched from OctoPrint's websites, such as important updates, release announcements, new
plugins and similar. Through some manual configuration via ``config.yaml`` it also allows adding additional channels
+3 -1
View File
@@ -3,7 +3,9 @@
Application Keys Plugin
=======================
The OctoPrint Application Keys Plugin comes bundled with OctoPrint (starting with version 1.3.10).
.. versionadded:: 1.3.10
The OctoPrint Application Keys Plugin comes bundled with OctoPrint.
It implements a workflow for third party apps or clients to obtain an application specific API key from OctoPrint to interact with it
on a user's behalf, via confirmation of the user through OctoPrint's web interface. Existing keys can be managed
+6
View File
@@ -3,6 +3,8 @@
Backup Plugin
=============
.. versionadded:: 1.3.10
The OctoPrint Backup Plugin comes bundled with OctoPrint (starting with 1.3.10).
It allows the creation and restoration of backups of OctoPrint's settings, data and installed plugins [#]_.
@@ -74,6 +76,8 @@ plugin_backup_backup_created
* ``path``: the path to the backup
* ``excludes``: the list of parts excluded from the backup
.. versionadded:: 1.5.0
.. _sec-bundledplugins-backup-hooks:
Hooks
@@ -86,6 +90,8 @@ octoprint.plugin.backup.additional_excludes
.. py:function:: additional_excludes_hook(excludes, *args, **kwargs)
.. versionadded:: 1.5.0
Use this to provide additional paths on your plugin's data folder to exclude from the backup. Your handler also
get a list of currently excluded sub paths in the base folder, so you can react to them. E.g. exclude things
in your data folder that relate to uploaded GCODE files if `uploads` is excluded, or exclude things that relate
+3 -1
View File
@@ -3,7 +3,9 @@
Discovery Plugin
================
The OctoPrint Discovery Plugin comes bundled with OctoPrint (starting with 1.2.0).
.. versionadded:: 1.2.0
The OctoPrint Discovery Plugin comes bundled with OctoPrint.
It allows discovery of the OctoPrint instances via SSDP/UPNP. If
`pybonjour <https://pypi.python.org/pypi/pybonjour>`_ is installed OctoPrint
+2
View File
@@ -3,6 +3,8 @@
Error Tracking Plugin
=====================
.. versionadded:: 1.3.11
The Error Tracking plugin will cause any logged exceptions in the server and the browser interface to be sent to
OctoPrint's `Sentry instance <https://sentry.io/>`_.
+2
View File
@@ -3,5 +3,7 @@
File Check
==========
.. versionadded:: 1.4.1
The file check plugin - while considered bundled with OctoPrint - is a separate project on its own release
cycle and documented on `its Github repository <https://github.com/OctoPrint/OctoPrint-FileCheck>`_.
+4
View File
@@ -3,5 +3,9 @@
Firmware Check
==============
.. versionadded:: 1.3.7
The firmware check plugin - while considered bundled with OctoPrint - is a separate project on its own release
cycle and documented on `its Github repository <https://github.com/OctoPrint/OctoPrint-FirmwareCheck>`_.
It was formerly called "Printer Safety Check" and directly bundled with OctoPrint.
+2
View File
@@ -3,6 +3,8 @@
GCode Viewer Plugin
===================
.. versionchanged:: 1.4.1
The GCode Viewer plugin provides a GCode viewer based on `Alex Ustyantsev's work <https://github.com/hudbrog/gCodeViewer>`_.
.. _fig-bundledplugins-gcodeviewer-example:
+2 -2
View File
@@ -3,9 +3,9 @@
Logging
=======
The OctoPrint Logging plugin comes bundled with OctoPrint starting with version 1.3.7.
.. versionadded:: 1.3.7
It implements the log management functionality that was formerly part of the core application and adds features to
The OctoPrint Logging plugin implements the log management functionality that was formerly part of the core application and adds features to
configure logging levels for sub modules through the included settings dialog.
.. _fig-bundledplugins-logging-settings:
+3 -2
View File
@@ -3,8 +3,9 @@
Plugin Manager
==============
The OctoPrint Plugin Manager comes bundled with OctoPrint starting with
version 1.2.0.
.. versionadded:: 1.2.0
The OctoPrint Plugin Manager comes bundled with OctoPrint.
It allows management of installed plugins (listing, enabling, disabling
and uninstalling) and installing new plugins from the official
+21
View File
@@ -3,10 +3,14 @@
Software Update Plugin
======================
.. versionadded:: 1.2.0
The Software Update Plugin allows receiving notifications about new releases
of OctoPrint or installed plugins which registered with it and -- if properly
configured -- also applying the found updates.
It comes bundled with OctoPrint.
.. _sec-bundledplugins-softwareupdate-firststeps:
First Steps
@@ -163,6 +167,7 @@ types are currently recognized:
field in Github release data - release will only be included if the
values match. Defaults to being unset, in which case the ``branch``
will be matched.
.. versionadded:: 1.2.16
* ``stable_branch``: Stable channel definition, optional. Structure:
* ``branch``: Branch associated with the channel, acts as ID
* ``name``: Human readable name of the release channel
@@ -170,11 +175,13 @@ types are currently recognized:
field in Github release data - release will only be included if the
values match. Defaults to being unset, in which case the ``branch``
will be matched.
.. versionadded:: 1.2.16
* ``prerelease_channel``: Release channel to limit updates to. If set only
those releases will be included if their ``target_comittish`` matches
the ones associated with the release channel identified by this, either
included in ``prerelease_channels`` or the ``stable_channel``. Only
taken into account if ``prerelease`` is ``true``.
.. versionadded:: 1.2.16
* ``release_compare``: Method to use to compare between current version
information and release versions on Github. One of ``python`` (version
comparison using ``pkg_resources.parse_version``, newer version detected
@@ -208,6 +215,8 @@ types are currently recognized:
``api_user`` to be set. **Important**: Never use your actual Bitbucket login password. Generate
a new app password. App passwords are user specific on Bitbucket.
.. versionadded:: 1.3.5
* ``git_commit``: Checks a local git repository for new commits on its
configured remote. Additional config parameters:
@@ -219,6 +228,8 @@ types are currently recognized:
* ``package``: (mandatory) Name of the package which to check.
.. versionadded:: 1.4.0
* ``httpheader``: Checks an HTTP header on a defined URL for changes. This can be used for easy checks
against things like ``ETag`` or ``Last-Modified`` headers. Additional
config parameters:
@@ -230,12 +241,16 @@ types are currently recognized:
* ``header_prefix``: Prefix to use for the obtained value in the version display. If not provided ``header_name``
will be used. If set to an empty string, no prefix will be added.
.. versionadded:: 1.4.1
* ``jsondata``: Checks the provided JSON endpoint for changes. The JSON endpoint must return an object with the
property ``version``, which should contain the latest version, e.g. ``{"version":"1.2.3"}``. Additional
config parameters:
* ``jsondata``: (mandatory) URL from which to fetch the JSON data
.. versionadded:: 1.4.1
* ``command_line``: Uses a provided script to determine whether an update
is available. Additional config parameters:
@@ -258,12 +273,16 @@ types are currently recognized:
* ``current_version``: Version to report for both local and remote version.
.. versionadded:: 1.3.7
* ``never_current``: Always reports that an update is necessary. Useful for debugging
software update mechanisms during development. Additional config parameters:
* ``local_version``: Current local version. Defaults to ``1.0.0``.
* ``remote_version``: Remote version to offer update to. Defaults to ``1.0.1``.
.. versionadded:: 1.3.7
.. _sec-bundledplugins-softwareupdate-configuration-updatemethods:
Update methods
@@ -309,6 +328,8 @@ supported:
a countdown in the meantime. Useful for debugging software update mechanisms
during development.
.. versionadded:: 1.3.7
.. note::
To allow default configurations for multiple update methods, if more than one of
+2
View File
@@ -3,6 +3,8 @@
Anonymous Usage Tracking Plugin
===============================
.. versionadded:: 1.3.10
The Anonymous Usage Tracking plugin provides valuable insights into how many instances running what versions of
OctoPrint are out there, whether they are successfully completing print jobs and various other metrics.
+2
View File
@@ -3,6 +3,8 @@
Virtual Printer
===============
.. versionchanged:: 1.4.1
The Virtual Printer plugin provides a virtual printer to connect to during development. It is able to simulate various
firmware quirks, communication issues and can be heavily configured through ``config.yaml``. See
:ref:`the development documentation on details and usage <sec-development-virtual-printer>`.
+75
View File
@@ -0,0 +1,75 @@
.. _sec-development-branches:
OctoPrint's branching model
===========================
There are three main branches in OctoPrint:
``master``
The master branch always contains the current stable release plus any changes
since made to *documentation*, *CI related tests* or *Github meta files*. OctoPrint's actual
code will only be modified on new releases. Will have a version number following
the scheme ``<x>.<y>.<z>`` (e.g. ``1.5.1``).
``maintenance``
Improvements and fixes of the current release that make up
the next release go here. More or less continuously updated. You can consider
this a preview of the next release version. It should be very stable at all
times. Anything you spot in here helps tremendously with getting a rock solid
next stable release, so if you want to help out development, running the
``maintenance`` branch and reporting back anything you find is a very good way
to do that. Will usually have a version number following the scheme
``<x>.<y+1>.<0>.dev<commits since increase of y>`` for an OctoPrint version of ``<x>.<y>.<z>``
(e.g. ``1.5.0.dev114``).
``devel``
Ongoing development of what will go into the next big
release (MAJOR version number increases) will happen on this branch. Usually
kept stable, sometimes stuff can break though. Backwards incompatible changes will
be encountered here. Can be considered the "bleeding edge". Will usually have a version
number following the scheme ``<x+1>.<0>.0.dev<commits since increase of y>`` for a current
OctoPrint version of ``<x>.<y>.<z>`` (e.g. ``2.0.0.dev123``).
There are couple more RC and staging branches that see regular use:
``staging/hotfix``
Any preparation for potential hotfix releases takes place here.
Version number follows the scheme ``<x>.<y>.<z+1>`` (e.g. ``1.5.1``) for a current release
of ``<x>.<y>.<z>``.
``rc/maintenance``
This branch is reserved for future releases that have graduated from
the ``maintenance`` branch and are now being pushed on the "Maintenance"
pre release channel for further testing. Version number follows the scheme
``<x>.<y>.<z>rc<n>`` (e.g. ``1.5.0rc1``).
``staging/maintenance``
Any preparation for potential follow-up RCs takes place here.
Version number follows the scheme ``<x>.<y>.<z>rc<n+1>.dev<commits since increase of n>`` (e.g.
``1.5.0rc2.dev3``) for a current Maintenance RC of ``<x>.<y>.<z>``.
``rc/devel``
This branch is reserved for future releases that have graduated from
the ``devel`` branch and are now being pushed on the "Devel" pre release channel
for further testing. Version number follows the scheme ``<x+1>.0.0rc<n>`` (e.g. ``2.0.0rc1``)
for a current stable OctoPrint version of ``<x>.<y>.<z>``.
``staging/devel``
Any preparation for potential follow-up Devel RCs takes place
here. Version number follows the scheme ``<x>.0.0rc<n+1>.dev<commits since increase of n>`` (e.g.
``2.0.0rc2.dev12``) for a current Devel RC of ``<x>.0.0rc<n>``.
Additionally, from time to time you might see other branches pop up in the repository.
Those usually have one of the following prefixes:
``hotfix/...``
Hotfixes under development that are to be merged into the ``staging/hotfix``
and later the ``master`` branch.
``fix/...``
Fixes under development that are to be merged into the ``maintenance``
and ``devel`` branches.
``improve/...``
Improvements under development that are to be merged into the
``maintenance`` and ``devel`` branches.
``dev/...`` or ``feature/...``
New functionality under development that is to be merged
into the ``devel`` branch.
There are also a few older development branches that are slowly being migrated or deleted.
All these branches and branch patterns are set up to automatically get a correct :ref:`version number <sec-development-versions>`
generated through versioneer and thus should also be adhered to during development.
+6 -1
View File
@@ -7,6 +7,11 @@ Development
.. toctree::
:maxdepth: 3
versioning.rst
branches.rst
environment.rst
virtual_printer.rst
profiling.rst
request-profiling.rst
If you are interested in contributing code to OctoPrint, first of all: Thank you! Please make sure to read the
`Contribution Guidelines <https://github.com/OctoPrint/OctoPrint/blob/master/CONTRIBUTING.md>`_!
+31
View File
@@ -0,0 +1,31 @@
.. _sec-development-versions:
OctoPrint's versioning strategy
===============================
OctoPrint's version numbers follow `PEP440 <https://www.python.org/dev/peps/pep-0440/>`_, with a version format of
**MAJOR.MINOR.PATCH** following the contract of `semantic versioning <http://semver.org/>`_.
The **PATCH** version number will increase in case of hotfix releases [#f1]_.
Releases that only change the patch number indicate that they only contain bug fixes, and usually
only hotfixes at that. Example: ``1.5.0`` to ``1.5.1``.
The **MINOR** version number increases with releases that add new functionality while maintaining
backwards compatibility on the documented APIs (both internal and external). Example: ``1.4.x`` to ``1.5.0``.
Finally, the **MAJOR** version number increases if there are breaking API changes that concern any of the
documented interfaces (REST API, plugin interfaces, ...). Example: ``1.x.y`` to ``2.0.0``.
OctoPrint's version numbers are automatically generated using a customized version of
`versioneer <https://github.com/warner/python-versioneer>`_ and depend on the selected git branch, nearest
git tag and commits. Unless a git tag is used for version number determination, the version number will
also contain the git hash within the local version identifier to allow for an exact determination of the
active code base (e.g. ``1.2.9.dev68+g46c7a9c``). Additionally, instances with active uncommitted changes
will contain ``.dirty`` in the local version identifier.
.. rubric:: Footnotes
.. [#f1] Up until 1.4.2, the PATCH version segment was the one increasing most often
due to OctoPrint's maintenance releases but with 1.5.0 this will *fully* adhere
to the concepts in semantic versioning mandating only bug fixes in patch releases.
Maintenance releases will henceforth increase the MINOR segment.
+67
View File
@@ -109,6 +109,9 @@ ClientOpened
**Note:** Name changed in version 1.1.0
.. versionchanged:: 1.1.0
.. versionchanged:: 1.4.0
ClientAuthed
A client has authenticated a user session on the push socket.
@@ -118,6 +121,8 @@ ClientAuthed
valid login session.
* ``username``: the name of the user who authed. On the push socket only available with a valid login session.
.. versionadded:: 1.4.0
ClientClosed
A client has disconnected from the push socket.
@@ -133,12 +138,16 @@ UserLoggedIn
* ``username``: the name of the user who logged in
.. versionadded:: 1.4.0
UserLoggedOut
A user logged out. On the push socket only available with a valid login session with admin rights.
Payload:
* ``username``: the name of the user who logged out
.. versionadded:: 1.4.0
ConnectivityChanged
The server's internet connectivity changed
@@ -147,6 +156,8 @@ ConnectivityChanged
* ``old``: Old connectivity value (true for online, false for offline)
* ``new``: New connectivity value (true for online, false for offline)
.. versionadded:: 1.3.5
.. _sec-events-available_events-printer_commmunication:
Printer communication
@@ -155,6 +166,8 @@ Printer communication
Connecting
The server is attempting to connect to the printer.
.. versionadded:: 1.3.0
Connected
The server has connected to the printer.
@@ -168,6 +181,8 @@ Disconnecting
event might not always be sent when the server and printer get disconnected
from each other. Do not depend on this for critical life cycle management.
.. versionadded:: 1.3.0
Disconnected
The server has disconnected from the printer
@@ -191,6 +206,8 @@ PrinterStateChanged
:func:`~octoprint.printer.PrinterInterface.get_state_id` for possible values.
* ``state_string``: Text representation of the new state.
.. versionadded:: 1.3.0
.. _sec-events-available_events-file_handling:
File handling
@@ -211,6 +228,8 @@ Upload
* ``file``: the file's path within its storage location. To be removed in 1.4.0.
.. versionchanged:: 1.4.0
FileAdded
A file has been added to a storage.
@@ -226,6 +245,8 @@ FileAdded
A copied file triggers this for its new path. A moved file first triggers ``FileRemoved`` for its original
path and then ``FileAdded`` for the new one.
.. versionadded:: 1.3.3
FileRemoved
A file has been removed from a storage.
@@ -240,6 +261,8 @@ FileRemoved
A moved file first triggers ``FileRemoved`` for its original path and then ``FileAdded`` for the new one.
.. versionadded:: 1.3.3
FolderAdded
A folder has been added to a storage.
@@ -253,6 +276,8 @@ FolderAdded
A copied folder triggers this for its new path. A moved folder first triggers ``FolderRemoved`` for its original
path and then ``FolderAdded`` for the new one.
.. versionadded:: 1.3.3
FolderRemoved
A folder has been removed from a storage.
@@ -265,6 +290,8 @@ FolderRemoved
A moved folder first triggers ``FolderRemoved`` for its original path and then ``FolderAdded`` for the new one.
.. versionadded:: 1.3.3
UpdatedFiles
A file list was modified.
@@ -279,6 +306,7 @@ UpdatedFiles
reasons of backwards compatibility and will also be sent on modification of ``printables``. It will however
be removed with 1.4.0.
.. versionchanged:: 1.4.0
MetadataAnalysisStarted
The metadata analysis of a file has started.
@@ -293,6 +321,8 @@ MetadataAnalysisStarted
* ``file``: the file's path within its storage location. To be removed in 1.4.0.
.. versionchanged:: 1.4.0
MetadataAnalysisFinished
The metadata analysis of a file has finished.
@@ -307,6 +337,8 @@ MetadataAnalysisFinished
* ``file``: the file's path within its storage location. To be removed in 1.4.0.
.. versionchanged:: 1.4.0
FileSelected
A file has been selected for printing.
@@ -321,6 +353,8 @@ FileSelected
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``). To be removed in 1.4.0.
* ``filename``: the file's name. To be removed in 1.4.0.
.. versionchanged:: 1.4.0
FileDeselected
No file is selected any more for printing.
@@ -334,6 +368,8 @@ TransferStarted
**Note:** Name changed in version 1.1.0
.. versionchanged:: 1.1.0
TransferDone
A file transfer to the printer's SD has finished.
@@ -365,6 +401,8 @@ PrintStarted
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``). To be removed in 1.4.0.
* ``filename``: the file's name. To be removed in 1.4.0.
.. versionchanged:: 1.4.0
PrintFailed
A print failed.
@@ -383,6 +421,8 @@ PrintFailed
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``). To be removed in 1.4.0.
* ``filename``: the file's name. To be removed in 1.4.0.
.. versionchanged:: 1.4.0
PrintDone
A print completed successfully.
@@ -400,6 +440,8 @@ PrintDone
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``). To be removed in 1.4.0.
* ``filename``: the file's name. To be removed in 1.4.0.
.. versionchanged:: 1.4.0
PrintCancelling
The print is about to be cancelled.
@@ -413,6 +455,8 @@ PrintCancelling
* ``user``: the user who cancelled the print job (if available)
* ``firmwareError``: the firmware error that caused cancelling the print job, if any
.. versionadded:: 1.3.7
PrintCancelled
The print has been cancelled.
@@ -443,6 +487,8 @@ PrintCancelled
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``). To be removed in 1.4.0.
* ``filename``: the file's name. To be removed in 1.4.0.
.. versionchanged:: 1.4.0
PrintPaused
The print has been paused.
@@ -472,6 +518,8 @@ PrintPaused
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``). To be removed in 1.4.0.
* ``filename``: the file's name. To be removed in 1.4.0.
.. versionchanged:: 1.4.0
PrintResumed
The print has been resumed.
@@ -489,6 +537,8 @@ PrintResumed
* ``file``: the file's full path on disk (``local``) or within its storage (``sdcard``). To be removed in 1.4.0.
* ``filename``: the file's name. To be removed in 1.4.0.
.. versionchanged:: 1.4.0
.. _sec-events-available_events-gcode_processing:
GCODE processing
@@ -543,6 +593,8 @@ PositionUpdate
* ``t``: last tool selected *through OctoPrint*
* ``f``: last feedrate for move commands ``G0``, ``G1`` or ``G28`` sent *through OctoPrint*
.. versionadded:: 1.3.0
ToolChange
A tool change command was sent to the printer. The payload contains the former current tool index and the
new current tool index.
@@ -552,6 +604,8 @@ ToolChange
* ``old``: old tool index
* ``new``: new tool index
.. versionadded:: 1.3.5
.. _sec-events-available_events-timelapses:
Timelapses
@@ -577,6 +631,8 @@ CaptureFailed
* ``file``: the name of the image file that should have been saved
* ``error``: the error that was caught
.. versionadded:: 1.3.0
MovieRendering
The timelapse movie has started rendering.
@@ -669,6 +725,8 @@ SlicingProfileAdded
* ``slicer``: the slicer for which the profile was added
* ``profile``: the profile that was added
.. versionadded:: 1.2.12
SlicingProfileModified
A slicing profile was modified.
@@ -677,6 +735,8 @@ SlicingProfileModified
* ``slicer``: the slicer for which the profile was modified
* ``profile``: the profile that was modified
.. versionadded:: 1.2.12
SlicingProfileDeleted
A slicing profile was deleted.
@@ -685,6 +745,8 @@ SlicingProfileDeleted
* ``slicer``: the slicer for which the profile was deleted
* ``profile``: the profile that was deleted
.. versionadded:: 1.2.12
.. _sec-events-available_events-settings:
Settings
@@ -696,6 +758,8 @@ SettingsUpdated
This event may also be triggered if calling code of :py:class:`octoprint.settings.Settings.save` or
:py:class:`octoprint.plugin.PluginSettings.save` sets the ``trigger_event`` parameter to ``True``.
.. versionadded:: 1.2.0
.. _sec-events-available_events-printer_profile:
Printer Profile
@@ -707,3 +771,6 @@ PrinterProfileModified
Payload:
* ``identifier``: the identifier of the modified printer profile
.. versionadded:: 1.3.12
+2
View File
@@ -3,6 +3,8 @@
Access Control
==============
.. versionchanged:: 1.4.0
OctoPrint's bundled access control feature allows granular permission control
over which users or user groups are allowed to access which parts of OctoPrint.
+2
View File
@@ -25,6 +25,8 @@ start
When this command is received from the printer, a job is currently selected and *not* active, OctoPrint
will start it just like if the "Start"/"Restart" button had been clicked.
.. versionadded:: 1.5.0
cancel
When this command is received from the printer, OctoPrint will cancel a current print job just like if the
"Cancel" button had been clicked.
+2
View File
@@ -3,6 +3,8 @@
@ Commands
==========
.. versionadded:: 1.3.7
@ commands (also known as host commands elsewhere) are special commands you may include in GCODE files streamed
through OctoPrint to your printer or send as part of GCODE scripts, through the Terminal Tab, the API or plugins.
Contrary to other commands they will never be sent to the printer but instead trigger functions inside OctoPrint.
+2
View File
@@ -4,6 +4,8 @@
Plugins
*******
.. versionadded:: 1.2.0
Starting with OctoPrint 1.2.0, there's now a plugin system in place which allows to individually
extend OctoPrint's functionality.
+3
View File
@@ -4,6 +4,9 @@
Safe mode
*********
.. versionadded:: 1.3.0
.. versionchanged:: 1.3.13
With the advent of support for plugins in OctoPrint, it quickly became apparent that some of the bugs
reported on OctoPrint's bug tracker were actually bugs with installed third party plugins or language
packs instead of OctoPrint itself.
+108
View File
@@ -207,6 +207,8 @@ octoprint.access.permissions
.. py:function:: additional_permissions_hook(*args, **kwargs)
.. versionadded:: 1.4.0
Return a list of additional permissions to register in the system on behalf of the plugin. Use this
to add granular permissions to your plugin which can be configured for users and user groups in the general
access control settings of OctoPrint.
@@ -261,6 +263,8 @@ octoprint.access.users.factory
.. py:function:: user_manager_factory_hook(components, settings, *args, **kwargs)
.. versionadded:: 1.4.0
Return a :class:`~octoprint.access.users.UserManager` instance to use as global user manager object. This will
be called only once during initial server startup.
@@ -295,6 +299,8 @@ octoprint.accesscontrol.keyvalidator
.. py:function:: acl_keyvalidator_hook(apikey, *args, **kwargs)
.. versionadded:: 1.3.6
Via this hook plugins may validate their own customized API keys to be used to access OctoPrint's API.
``apikey`` will be the API key as read from the request headers.
@@ -326,6 +332,8 @@ octoprint.cli.commands
.. py:function:: cli_commands_hook(cli_group, pass_octoprint_ctx, *args, **kwargs)
.. versionadded:: 1.3.0
By providing a handler for this hook plugins may register commands on OctoPrint's command line interface (CLI).
Handlers are expected to return a list of callables annotated as `Click commands <http://click.pocoo.org/5/>`_ to register with the
@@ -449,6 +457,8 @@ octoprint.comm.protocol.firmware.info
.. py:function:: firmware_info_hook(comm_instance, firmware_name, firmware_data, *args, **kwargs)
.. versionadded:: 1.3.9
Be notified of firmware information received from the printer following an ``M115``.
Hook handlers may use this to react/adjust behaviour based on reported firmware data. OctoPrint parses the received
@@ -482,6 +492,8 @@ octoprint.comm.protocol.firmware.capabilities
.. py:function:: firmware_capability_hook(comm_instance, capability, enabled, already_defined, *args, **kwargs)
.. versionadded:: 1.3.9
Be notified of capability report entries received from the printer.
Hook handlers may use this to react to custom firmware capabilities. OctoPrint parses the received capability
@@ -509,6 +521,8 @@ octoprint.comm.protocol.action
.. py:function:: protocol_action_hook(comm_instance, line, action, name='', params='', *args, **kwargs)
.. versionadded:: 1.2.0
React to a :ref:`action command <sec-features-action_commands>` received from the printer.
Hook handlers may use this to react to custom firmware messages. OctoPrint parses the received action
@@ -553,6 +567,8 @@ This describes actually two hooks:
.. py:function:: protocol_atcommandphase_hook(comm_instance, phase, command, parameters, tags=None, *args, **kwargs)
.. versionadded:: 1.3.7
Trigger on :ref:`@ commands <sec-features-atcommands>` as they progress through the ``queuing`` and ``sending``
phases of the comm layer. See :ref:`the gcode phase hook <sec-plugins-hook-comm-protocol-gcode-phase>` for a
detailed description of each of these phases.
@@ -601,6 +617,8 @@ This actually describes four hooks:
.. py:function:: protocol_gcodephase_hook(comm_instance, phase, cmd, cmd_type, gcode, subcode=None, tags=None, *args, **kwargs)
.. versionadded:: 1.2.0
Pre- and postprocess commands as they progress through the various phases of being sent to the printer. The phases
are the following:
@@ -754,6 +772,8 @@ octoprint.comm.protocol.gcode.received
.. py:function:: gcode_received_hook(comm_instance, line, *args, **kwargs)
.. versionadded:: 1.3.0
Get the returned lines sent by the printer. Handlers should return the received line or in any case, the modified
version of it. If the handler returns None, processing will be aborted and the communication layer will get an
empty string as the received line. Note that Python functions will also automatically return ``None`` if an empty
@@ -787,6 +807,8 @@ octoprint.comm.protocol.gcode.error
.. py:function:: gcode_error_hook(comm_instance, error_message, *args, **kwargs)
.. versionadded:: 1.3.7
Get the messages of any errors messages sent by the printer, with the leading ``Error:`` or ``!!`` already
stripped. Handlers should return True if they handled that error internally and it should not be processed by
the system further. Normal processing of these kinds of errors - depending on the configuration of error
@@ -824,6 +846,9 @@ octoprint.comm.protocol.scripts
.. py:function:: protocol_scripts_hook(comm_instance, script_type, script_name, *args, **kwargs)
.. versionadded:: 1.2.0
.. versionchanged:: 1.3.7
Return a prefix to prepend, postfix to append, and optionally a dictionary of variables to provide to the script ``script_name`` of type ``type``. Handlers should
make sure to only proceed with returning additional scripts if the ``script_type`` and ``script_name`` match
handled scripts. If not, None should be returned directly.
@@ -868,6 +893,8 @@ octoprint.comm.protocol.temperatures.received
.. py:function:: protocol_temperatures_received_hook(comm_instance, parsed_temperatures, *args, **kwargs)
.. versionadded:: 1.3.6
Get the parsed temperatures returned by the printer, allowing handlers to modify them prior to handing them off
to the system. Handlers are expected to either return ``parsed_temperatures`` as-is or a modified copy thereof.
@@ -901,6 +928,8 @@ octoprint.comm.transport.serial.additional_port_names
.. py:function:: additional_port_names_hook(candidates, *args, **kwargs)
.. versionadded:: 1.4.1
Return additional port names (not glob patterns!) to use as a serial connection to the printer. Expected to be
``list`` of ``string``s.
@@ -920,6 +949,8 @@ octoprint.comm.transport.serial.factory
.. py:function:: serial_factory_hook(comm_instance, port, baudrate, read_timeout, *args, **kwargs)
.. versionadded:: 1.2.0
Return a serial object to use as serial connection to the printer. If a handler cannot create a serial object
for the specified ``port`` (and ``baudrate``), it should just return ``None``.
@@ -996,6 +1027,8 @@ octoprint.events.register_custom_events
.. py:function:: register_custom_events_hook(*args, **kwargs)
.. versionadded:: 1.3.11
Return a list of custom :ref:`events <sec-events>` to register in the system for your plugin.
Should return a list of strings which represent the custom events. Their name on the `octoprint.events.Events` object
@@ -1024,6 +1057,8 @@ octoprint.filemanager.analysis.factory
.. py:function:: analysis_queue_factory_hook(*args, **kwargs)
.. versionadded:: 1.3.9
Return additional (or replacement) analysis queue factories used for analysing uploaded files.
Should return a dictionary to merge with the existing dictionary of factories, mapping from extension tree leaf
@@ -1062,6 +1097,8 @@ octoprint.filemanager.extension_tree
.. py:function:: file_extension_hook(*args, **kwargs)
.. versionadded:: 1.2.0
Return additional entries for the tree of accepted file extensions for uploading/handling by the file manager.
Should return a dictionary to merge with the existing extension tree, adding additional extension groups to
@@ -1098,6 +1135,8 @@ octoprint.filemanager.preprocessor
.. py:function:: file_preprocessor_hook(path, file_object, links=None, printer_profile=None, allow_overwrite=False, *args, **kwargs)
.. versionadded:: 1.2.0
Replace the ``file_object`` used for saving added files to storage by calling :func:`~octoprint.filemanager.util.AbstractFileWrapper.save`.
``path`` will be the future path of the file on the storage. The file's name is accessible via
@@ -1130,6 +1169,8 @@ octoprint.filemanager.preprocessor
octoprint.plugin.backup.additional_excludes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 1.5.0
See :ref:`here <sec-bundledplugins-backup-hooks-excludes>`.
.. _sec-plugins-hook-plugin-loginui-theming:
@@ -1137,6 +1178,8 @@ See :ref:`here <sec-bundledplugins-backup-hooks-excludes>`.
octoprint.plugin.loginui.theming
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 1.4.0
See :ref:`here <sec-bundledplugins-loginui-hooks-theming>`.
.. _sec-plugins-hook-plugin-pluginmanager-reconnect:
@@ -1144,6 +1187,8 @@ See :ref:`here <sec-bundledplugins-loginui-hooks-theming>`.
octoprint.plugin.pluginmanager.reconnect_hooks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 1.4.0
See :ref:`here <sec-bundledplugins-pluginmanager-hooks-reconnect_hooks>`.
.. _sec-plugins-hook-plugin-softwareupdate-check_config:
@@ -1151,8 +1196,39 @@ See :ref:`here <sec-bundledplugins-pluginmanager-hooks-reconnect_hooks>`.
octoprint.plugin.softwareupdate.check_config
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 1.2.0
See :ref:`here <sec-bundledplugins-softwareupdate-hooks-check_config>`.
.. _sec-plugins-hooks-plugin-printer-additional_state_data
octoprint.printer.additional_state_data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. py:function:: additional_state_data_hook(initial=False, *args, **kwargs)
.. versionadded:: 1.5.0
Use this to inject additional data into the data structure returned from the printer backend to the frontend
on the push socket or other registered :ref:`~octoprint.printer.PrinterCallback`s. Anything you return here
will be located beneath ``plugins.<your plugin id>`` in the resulting initial and current data push structure.
The ``initial`` parameter will be ``True`` if this the additional update sent to the callback. Your handler should
return a ``dict``, or ``None`` if nothing should be included.
.. warning::
Make sure to not perform any computationally expensive or otherwise long running actions within these handlers as
you could stall the whole state monitor and thus updates being pushed to the frontend.
This includes I/O of any kind.
Cache your data!
:param boolean initial: True if this is the initial update, False otherwise
:return: Additional data to include
:rtype: dict
.. _sec-plugins-hook-printer-factory:
octoprint.printer.factory
@@ -1160,6 +1236,8 @@ octoprint.printer.factory
.. py:function:: printer_factory_hook(components, *args, **kwargs)
.. versionadded:: 1.3.0
Return a :class:`~octoprint.printer.PrinterInstance` instance to use as global printer object. This will
be called only once during initial server startup.
@@ -1191,6 +1269,8 @@ octoprint.printer.estimation.factory
.. py:function:: print_time_estimator_factory(*args, **kwargs)
.. versionadded:: 1.3.9
Return a :class:`~octoprint.printer.estimation.PrintTimeEstimator` subclass (or factory) to use for print time
estimation. This will be called on each start of a print or streaming job with a single parameter ``job_type``
denoting the type of job that was just started: ``local`` meaning a print of a local file through the serial connection,
@@ -1237,6 +1317,8 @@ octoprint.printer.sdcardupload
.. py:function:: sd_card_upload_hook(printer, filename, path, start_callback, success_callback, failure_callback, *args, **kwargs)
.. versionadded:: 1.3.11
Via this hook plugins can change the way files are being uploaded to the sd card of the printer.
Implementations **must** call the provided ``start_callback`` on start of the file transfer and either the ``success_callback``
@@ -1322,6 +1404,8 @@ octoprint.server.api.after_request
.. py:function:: after_request_handlers_hook(*args, **kwargs)
.. versionadded:: 1.3.10
Allows adding additional after-request-handlers to API endpoints defined by OctoPrint itself and installed plugins.
Your plugin might need this to further restrict access to API methods.
@@ -1337,6 +1421,8 @@ octoprint.server.api.before_request
.. py:function:: after_request_handlers_hook(*args, **kwargs)
.. versionadded:: 1.3.10
Allows adding additional before-request-handlers to API endpoints defined by OctoPrint itself and installed plugins.
Your plugin might need this to further restrict access to API methods.
@@ -1352,6 +1438,8 @@ octoprint.server.http.access_validator
.. py:function:: access_validator_hook(request, *args, **kwargs)
.. versionadded:: 1.3.10
Allows adding additional access validators to the default tornado routers.
Your plugin might need to this to restrict acccess to downloads and webcam snapshots further.
@@ -1367,6 +1455,8 @@ octoprint.server.http.bodysize
.. py:function:: server_bodysize_hook(current_max_body_sizes, *args, **kwargs)
.. versionadded:: 1.2.0
Allows extending the list of custom maximum body sizes on the web server per path and HTTP method with custom entries
from plugins.
@@ -1409,6 +1499,8 @@ octoprint.server.http.routes
.. py:function:: server_route_hook(server_routes, *args, **kwargs)
.. versionadded:: 1.2.0
Allows extending the list of routes registered on the web server.
This is interesting for plugins which want to provide their own download URLs which will then be delivered statically
@@ -1476,6 +1568,8 @@ octoprint.server.sockjs.authed
.. py:function:: socket_authed_hook(socket, user, *args, **kwargs):
.. versionadded:: 1.3.10
Allows plugins to be notified that a user got authenticated or deauthenticated on the socket (e.g. due to logout).
:param object socket: the socket object which is about to be registered
@@ -1488,6 +1582,8 @@ octoprint.server.sockjs.register
.. py:function:: socket_registration_hook(socket, user, *args, **kwargs):
.. versionadded:: 1.3.10
Allows plugins to prevent a new :ref:`push socket client <sec-api-push>` to be registered to the system.
Handlers should return either ``True`` or ``False``. ``True`` signals to proceed with normal registration. ``False``
@@ -1507,6 +1603,8 @@ octoprint.server.sockjs.emit
.. py:function:: socket_emit_hook(socket, user, message, payload, *args, **kwargs):
.. versionadded:: 1.3.10
Allows plugins to prevent any messages to be emitted on an existing :ref:`push connection <sec-api-push>`.
Handlers should return either ``True`` to allow the message to be emitted, or ``False`` to prevent it.
@@ -1527,6 +1625,8 @@ octoprint.timelapse.extensions
.. py:function:: timelapse_extension_hook(*args, **kwargs)
.. versionadded:: 1.3.10
Allows extending the set of supported file extensions for timelapse files. Handlers must return a list of
additional file extensions.
@@ -1553,6 +1653,8 @@ octoprint.ui.web.templatetypes
.. py:function:: templatetype_hook(template_sorting, template_rules, *args, **kwargs)
.. versionadded:: 1.2.0
Allows extending the set of supported template types in the web interface. This is interesting for plugins which want
to offer other plugins to hook into their own offered UIs. Handlers must return a list of additional template
specifications in form of 3-tuples.
@@ -1671,6 +1773,8 @@ This actually describes two hooks:
.. py:function:: ui_theming_hook(*args, **kwargs)
.. versionadded:: 1.5.0
Support theming of the login or recovery dialog, just in case the core UI is themed as well. Use to return a list of additional
CSS file URLs to inject into the dialog HTML.
@@ -1700,6 +1804,8 @@ octoprint.timelapse.capture.pre
.. py:function:: capture_pre_hook(filename)
.. versionadded:: 1.4.0
Perform specific actions prior to capturing a timelapse frame.
``filename`` will be the future path of the frame to be saved.
@@ -1715,6 +1821,8 @@ octoprint.timelapse.capture.post
.. py:function:: capture_post_hook(filename, success)
.. versionadded:: 1.4.0
Perform specific actions after capturing a timelapse frame.
``filename`` will be the path of the frame that should have been saved.