Commit graph

73 commits

Author SHA1 Message Date
Gina Häußge
ba5e99c187 Use namedtuple for plugin.origin data structure and include package version 2015-06-03 10:44:27 +02:00
Gina Häußge
a42868d7eb Allow marking plugins as uninstalled
Sometimes they will still get discovered by python even though their packages have since been uninstalled.
This will also lead to them being reloaded after an uninstall and a subsequent plugin reload.

Marking them as uninstalled and not handing out uninstalled plugins when collecting them solves this.
2015-05-29 16:25:18 +02:00
Gina Häußge
61af59cca1 New hooks for command processing in comm layer
Added phase specific hooks for queuing, queued, sending and sent phases of a command ("octoprint.comm.protocol.gcode.<phase>"). Removed old queuing phase hook and declared as obsolete hook in plugin manager to prevent plugins that depend on it from being enabled.

Adding those new hooks also necessitated refactoring the whole command processing, made it more modular and added phase specific handler functions that allow handling all blocking commands centrally for example.
2015-05-28 17:06:24 +02:00
Gina Häußge
2cfa3d9218 Refuse to enable plugins that utilize obsolete hooks
Since it cannot be reliably determined by the system if a hook is essential for a plugin's functionality or not, it makes more sense to just disable plugins that utilize obsolete hooks then risk running half working plugins.
2015-05-28 12:56:42 +02:00
Gina Häußge
4c7520efb9 New hook "octoprint.server.http.bodysize" and lifecycle support for restart needing hooks
The new hook allows extending the list of rules for maximum body sizes differing from the default of 100KB and can be used by plugins to allow uploads to them that exceed that file size.

Also extended the plugin manager to detect plugins that implement restart needing hooks (such as the above one) and handling those plugins the same as plugins containing implementations that inherit from octoprint.plugin.core.RestartNeedingPlugin
2015-05-11 15:47:40 +02:00
Gina Häußge
5e54f3a523 Persist package name for plugins loaded from entry point
This allows later deinstallation even if module and package name differ.
2015-04-27 18:43:00 +02:00
Gina Häußge
4c1ba0fd0b [doc] <pluginname> => <plugin identifier> 2015-04-27 16:10:23 +02:00
Gina Häußge
3f272b209d Added method to SimpleApiPlugins to allow locking API to only admins 2015-04-21 19:39:48 +02:00
Gina Häußge
a996f7b6fb New hook octoprint.filemanager.preprocessor
Allows preprocessing files that are uploaded or otherwise added to the system (e.g. through slicing) before their contents are saved to disk
2015-04-17 14:45:58 +02:00
Gina Häußge
6bb4a3e28c Potential fix for the "No PKG-INFO found for package" issue 2015-04-16 18:37:03 +02:00
Gina Häußge
2aa31024e6 Finalizing first version of plugin lifecycle management 2015-04-14 17:55:46 +02:00
Gina Häußge
97aecdf4cf First throw at working plugin lifecycle management
Plugins may be enabled and disabled during runtime. If they are of types which allow hot loading, this will be done. Otherwise they will be marked as pending and updated after a restart. Same for installation and uninstallation.
2015-04-02 23:02:42 +02:00
Gina Häußge
f0b48a6b43 Merge branch 'devel' into dev/pluginLifecycleMgmt
Conflicts:
	src/octoprint/plugin/core.py
2015-04-01 11:55:48 +02:00
Gina Häußge
0ed8afd999 Fix: Validate plugins separately from constructor
Otherwise plugins that inject data via __plugin_init__ won't work properly
2015-04-01 11:54:11 +02:00
Gina Häußge
68fa2f9fa3 WIP 2015-04-01 11:51:08 +02:00
Gina Häußge
3ebf5e5240 Merge branch 'devel' into dev/pluginLifecycleMgmt
Conflicts:
	src/octoprint/plugin/core.py
2015-04-01 11:02:05 +02:00
Gina Häußge
66e3ee28b6 Started work on plugin lifecycle management
Plugins may be loaded, unloaded, activated and deactivated. Errors while trying to load a plugin or initializing an implementation will only result in it staying deactive but registered in the system, allowing it to be further processed e.g. by a plugin manager
2015-04-01 10:55:13 +02:00
Gina Häußge
8a41cef00b [Doc] Restructured the plugins section so it makes more sense 2015-03-31 20:08:32 +02:00
Gina Häußge
5c228e6071 [Doc] Big overhaul of TemplatePlugin docs & component ordering 2015-03-31 18:23:18 +02:00
Gina Häußge
2d54ab5fcf Fix: identifer => identifier (is it really that hard to type foosel?) 2015-03-30 22:08:49 +02:00
Gina Häußge
8ff0096eb6 Fix & Docs: Plugins may only have one mixin implementation
Multiple mixins are allowed of course. Allowing multiple implementations lead to too many problems due to plugin names for referring to the APIs of SimpleApiPlugins or the assets of AssetPlugins.

 Hence __plugin_implementations__ has been deprecated in favor of __plugin_implementation__. The plugin subsystem will automatically copy the first implementation from __plugin_implementations__ to __plugin_implementation__ and log a deprecation warning.

 Adjusted documentation accordingly. Also added docs for helpers.
2015-03-30 16:50:06 +02:00
Gina Häußge
d62ac5239b [Doc] PluginSettings.getFoo -> PluginSettings.get_foo, also fixed an example for settings preprocessors 2015-03-27 11:18:55 +01:00
Gina Häußge
fb2719ce8a [Doc] let's see if moving the figures out of the tables solves the PDF issue 2015-03-26 10:55:51 +01:00
Gina Häußge
954397b6a6 Changed logging of plugin subsystem slightly
Detected plugins are now logged in a better readable way and with additional information.

Also marked folder for bundled plugins as bundled - forgot to do that earlier.
2015-03-25 18:56:11 +01:00
Gina Häußge
97c8c7826c [Docs] Documented AppPlugins 2015-03-23 18:15:18 +01:00
Gina Häußge
05c11911fb [Docs] Plugin and PluginInfo docs now includes members, OctoPrintPlugin now includes ref to base class 2015-03-20 11:33:54 +01:00
Gina Häußge
f2eeb50381 Lots of documentation for slicing related things and some refactorings 2015-03-19 20:58:24 +01:00
Gina Häußge
22c73d831a More cleanup for the feedback controls
Preprocessing for better performancy, unit tests for preprocessing, controls don't need a type anymore (makes things way less complicated and repetitive)
2015-03-10 21:49:18 +01:00
Gina Häußge
d447308ef0 Even more documentation of the internal modules 2015-03-06 01:42:49 +01:00
Jarek Szczepanski
49fbe75387 Fixed docs for BlueprintPlugin 2015-03-01 21:46:21 +01:00
Gina Häußge
cd3ead3f30 More documentation 2015-02-27 20:28:24 +01:00
Gina Häußge
84c32a3cd9 Unit tests for octoprint.plugin.PluginSettings
And some small fixes of that class in the process...
2015-02-27 10:29:08 +01:00
Gina Häußge
4997814abe Moved PluginSettings interface from CamelCase to snake_case (backwards compatible)
Added wrappers to ensure existing plugins being able to work, although them using the old camel case method names now causes a deprecation warning being logged
2015-02-26 13:43:01 +01:00
Gina Häußge
543b8df48b Extended documentation to include replace feature for plugin template components 2015-02-24 09:29:02 +01:00
Gina Häußge
6cdd8de248 docs: Fixed a wrong reference 2015-02-13 15:50:09 +01:00
Gina Häußge
197ed7b912 More documentation 2015-02-13 12:50:02 +01:00
Gina Häußge
be9021d377 Some more unit tests for the plugin manager 2015-02-05 19:20:51 +01:00
Gina Häußge
9a476073cb Made call_plugin method more error resilient
Should catch any exceptions thrown by the plugin, log them and only hand them off if the caller requested to be informed about such things. This way if something goes wrong with a StartupPlugin there should be no problem anymore to still get the server up and running.
2015-02-03 10:17:39 +01:00
Gina Häußge
17d0b17a86 Blueprints of BlueprintPlugins now also get instantiated with defined template and static folder, plugins may override this via get_blueprint_kwargs 2015-01-30 22:22:08 +01:00
Gina Häußge
6f52e7a008 More error resilience when (re)loading plugins 2015-01-30 18:06:52 +01:00
Gina Häußge
86734076e0 Fixed a bug which caused self.implementations to be able to return None instead of [] if no implementations were provided by a plugin 2015-01-30 18:04:15 +01:00
Gina Häußge
6b6bef4e86 First inject static additional injects, then follow up with factory created ones
This way plugins are already prepopulated with stuff like basefolder and logger and such when the factories are executed.
2015-01-30 13:56:18 +01:00
Gina Häußge
d3bd990009 The plugin system now also injects self._settings into SettingsPlugins and create the blueprint for BlueprintPlugins
Also adjusted a lot of documentation for that stuff and continued writing the Getting Started guide for plugin development.
2015-01-30 13:22:35 +01:00
Gina Häußge
d96e56e3c7 Also include module_name in plugin origin tuple for entry points 2015-01-26 22:30:31 +01:00
Gina Häußge
2d2285861f Also track disabled plugins and allow defining/retrieving license information in plugins 2015-01-26 22:21:58 +01:00
Gina Häußge
19f9400b11 Read pkginfo data for plugins retrieved via entry_point and use that to populate author, version, name, description and url data in PluginInfo object
This data can still be overwritten from within the Plugin itself by setting the correponding __plugin_xyz__ variables, however it allows getting rid of some repetition if that data has already been specified in setup.py
2015-01-26 17:27:34 +01:00
Gina Häußge
922ee39109 Plugins can now also supply information regarding the plugin author and website, metadata also tracks from where they were loaded 2015-01-26 12:51:44 +01:00
Gina Häußge
416b897596 Fixed a documentation bug
Thanks @Booli
2015-01-19 11:15:09 +01:00
Gina Häußge
762ec228da More work on the documentation 2015-01-16 17:11:31 +01:00
Gina Häußge
f619c1f8c4 Made data_bind handling of Template Plugin more easier
allowBindings: true is automatically added if necessary, regardless of plugin_supplied data_bind value, should make usage easier.
2015-01-16 12:35:24 +01:00