Commit graph

2481 commits

Author SHA1 Message Date
Gina Häußge
caef322b65 The Plugin Manager is now bundled with OctoPrint 2015-05-29 16:31:43 +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
0143911fe1 Added an EditorConfig file
See http://editorconfig.org/
2015-05-29 11:58:36 +02:00
Gina Häußge
f2192ba232 Fix: Re-open detected serial port with specified baudrate
The serial port was previously kept open from the Stk500 initialization, which defaults to 115200 baud.

Closes #892
2015-05-29 11:36:36 +02:00
Gina Häußge
1a80aa854f Fix: "gcode" var was not properly parsed for queuing and queued command phases
Thanks @C-o-r-E for the heads-up
2015-05-28 20:20:51 +02:00
Gina Häußge
42e32487da Merge branch 'devel' of github.com:foosel/OctoPrint into devel 2015-05-28 19:17:26 +02:00
Gina Häußge
1e3f75c852 Merge branch 'rotate90' of https://github.com/markwal/OctoPrint into pr/markwal/rotate90
Conflicts:
	src/octoprint/static/css/octoprint.css
	src/octoprint/static/less/octoprint.less
2015-05-28 19:14:02 +02:00
Gina Häußge
1e65335173 Merge pull request #914 from aerickson/scripts_set_priority
scripts: init and default files now specify a process priority.
2015-05-28 17:59:27 +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
1458503561 Logging for the virtual printer... 2015-05-28 17:03:03 +02:00
Gina Häußge
046fffdd14 Fixed a deadlock in the communication layer when pausing via M0
Using reentrant locks to allow sending of additional commands
2015-05-28 16:10:48 +02:00
Andrew Erickson
3aa04448ff scripts: init and default files now specify a process priority.
default to priority of 18 (nicelevel of -2).
2015-05-28 05:04:58 -07: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
Mark Walker
a294fb4e8b Use a namespace for the jquery event so it will be less likely to stomp
on another event handler that may be added elsewhere.
2015-05-27 23:11:33 -07:00
Gina Häußge
ceb0e29da3 Changed existing octoprint.server.http.* hooks to prefix routes with /plugin/<identifier>/
This will hopefully prevent conflicting routes between multiple plugins from being registered and also ensures a more consistent behaviour compared to BlueprintPlugin mixins.

 Thanks to @Salandora for bringing this up.
2015-05-27 14:30:41 +02:00
Gina Häußge
3823216319 Some new styles for forms usable by plugins 2015-05-27 13:36:33 +02:00
Gina Häußge
3ac2d5dd34 Fixed Z-Timelapse for Z changes on `G1` moves
Solves #909
2015-05-26 18:46:50 +02:00
Gina Häußge
5a89cc6a2a [doc] Added example for the octoprint.server.http.routes hook 2015-05-26 14:29:22 +02:00
Gina Häußge
5c2a9ce5db Allow downloading all uploaded files, not just gcode and stl
Hidden files (starting with .) will produce a 404. This also excludes .metadata.yaml from being downloadable. The alternative of adding all extensions defined by plugins to the regex dynamically was not chosen since that would necessitate to make plugins implementing the "octoprint.filemanager.extension_tree" hook restart needing plugins in the lifecycle management for a minimal gain in perceived security.

Solves #897
2015-05-26 13:55:04 +02:00
Gina Häußge
2317d0cf27 Documentation for new hook "octoprint.server.http.routes" 2015-05-26 13:16:57 +02:00
Gina Häußge
ad054338b5 More/fixed documentation on the octoprint.server.util module 2015-05-26 13:16:01 +02:00
Mark Walker
42f06d5147 Request issue #895: Rotate webcam image
Added a setting to allow -90 degree rotation. Combined with fliph and
flipv, I think this means every one of the 8 major orientations is covered
(2^3). 0, 90, 180, 270 times 2 (mirror image in each rotation). I chose
-90 instead of 90 because that keeps the upper left corner pinned to the
same spot.
The extra ms-transforms aren't for this issue exactly but allowed me to
test my changes in ie. I've tested Chrome, Firefox and IE11. I don't
have Safari handy, but if it breaks it *should* be only when this is
enabled.
2015-05-24 17:02:32 -07:00
Gina Häußge
7263fb74a9 Merge pull request #901 from markwal/handleErrorsShortform
Only eat two characters when the error indicator is '!!'
2015-05-21 19:04:23 +02:00
Gina Häußge
e8ca6709b9 New hook "octoprint.server.http.routes" to extend static tornado routes through plugins
TODO: docs

Thanks @Salandora
2015-05-21 18:07:15 +02:00
Mark Walker
50c95e439d Only eat two characters when the error indicator is '!!' 2015-05-20 20:06:24 -07:00
Gina Häußge
fa57f160dc Log cancelled prints only once
Thanks to @imrahil for the headsup
2015-05-13 14:00:12 +02:00
Gina Häußge
45cda586d2 Fix: Make pip install -e . work properly by linking to ./src, not ./ 2015-05-13 08:37:36 +02:00
Gina Häußge
24a020a5f0 Added "plugins" extra to OctoPrint
Installs dependencies necessary/recommended for plugin development. At the moment that is only cookiecutter.
2015-05-12 21:38:04 +02:00
Gina Häußge
37ee1d6780 octoprint.setuptools => octoprint_setuptools (own package)
Otherwise we get import issues during build since the octoprint module depends on the dependencies already being present what they obviously can't be at the beginning of setup.
2015-05-12 20:36:38 +02:00
Gina Häußge
9e9189727f Removed javascript babel files superseded by new central i18n js template 2015-05-12 17:38:22 +02:00
Gina Häußge
05fd4fbc8a Some final touches to the new setuptools submodule
CleanCommand should never touch .git subfolders. Plugin CleanCommand should remove plugin's egg-info files
2015-05-12 17:34:00 +02:00
Gina Häußge
95062747ef Extracted setuptools related things into reusable package
Babel related commands and the Clean command for setup.py are not reusable by plugins as well. Also added a factory method for plugin setup parameters.
2015-05-12 17:20:31 +02:00
Gina Häußge
6465e2dc2f Don't try to include a i18n js file when g.locale is not set 2015-05-12 13:54:36 +02:00
Gina Häußge
074d7a017e Wrapped some texts in translation brackets 2015-05-12 12:22:26 +02:00
Gina Häußge
739a185d1b Logging for flask view caching 2015-05-12 12:22:10 +02:00
Gina Häußge
9f54985ce5 Also support client side translations for plugins 2015-05-12 11:58:48 +02:00
Gina Häußge
b908ff5821 Enhanced flask-babel to also allow plugins to provide translated strings
This way plugins can maintain their own translations of their UIs. Some monkey patching was necessary, not the cleanest solution but it should work.
2015-05-11 18:44:30 +02:00
Gina Häußge
098df12d94 Added changelog entry for #888 2015-05-11 16:54:37 +02:00
Gina Häußge
6029340f78 Merge branch 'sockjslikebunnies' of https://github.com/markwal/OctoPrint into pr/markwal/sockjslikebunnies 2015-05-11 16:22:34 +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
Mark Walker
c8b8bcb22e Magic CLOSE_NORMAL
See https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
WebSocket defines 1000 as CLOSE_NORMAL, SockJS uses it without
a name and doesn't provide one for us, so for now we define our own
2015-05-11 05:52:36 -07:00
Gina Häußge
797a5c8a5c Cura plugin: Fix potential key error in error reporting 2015-05-11 13:10:23 +02:00
Gina Häußge
6323ce56ed Fix: Properly close selected files in case of errors or intentional disconnects on the serial interface
File handle was formerly kept open. Thanks to @Salandora for the initial work on this. See also PR #883
2015-05-11 12:23:56 +02:00
Gina Häußge
86a4e7f495 Only treat wait as ack while printing 2015-05-11 11:47:15 +02:00
Mark Walker
91bdffab33 Stop sockjs from multiplying on reconnect
Have you ever noticed when developing that every time you stop and start
the server, the terminal window gets an extra duplicate line for every
reconnect attempt?  Well, it's because (I think) "delete" in javascript
just removes the indicated name from the namespace, it doesn't actually
free up an object. Those zombie objects are still there and wake up (for
some transports) on reconnect. Might be different in SockJS v1 or later.
2015-05-10 18:58:18 -07:00
Gina Häußge
9568806219 Fix: Don't reload page when disabling access control in first run dialog
Cache clearing doesn't work reliably with location.reload(true), leading to cache induced infinite loop when disabling access control (since generated template still assumes first run dialog to be active). Disabling for now, need to find a better way to reload the page while clearing the browser's and server's cache (same issue exists for plugins needing a client side triggered reload).

Fixes #886
2015-05-10 00:54:44 +02:00
Gina Häußge
5fa30e4145 Ignore feed rates of 0, those don't make sense anyhow
Fixes #887
2015-05-10 00:36:09 +02:00
Gina Häußge
fa9821083d Support fast communication recovery during printing when printer sends "wait" line
Common setting in Repetier, Marlin might support this sooner or later as well.
2015-05-08 13:47:52 +02:00
Gina Häußge
9d3a029e10 Added missing event when closing the settings dialog 2015-05-07 15:23:40 +02:00
Gina Häußge
ea93ba6a77 Fixed grid in GCODE viewer for rectangular bed with origin in lower left 2015-05-07 13:05:43 +02:00