Compare commits

...
Author SHA1 Message Date
Gina Häußge 1d0657a8eb Preparing release of 1.2.18 2016-11-30 11:24:50 +01:00
Gina Häußge ec04364b47 Preparing release of 1.2.18rc1 2016-11-22 12:47:29 +01:00
Gina Häußge a88cd9fcfc Copy settings in on_settings_load so we don't mutate them 2016-11-21 13:44:26 +01:00
Gina Häußge 59e4394cdd Allow type specific default values for restricted settings
See #1567
2016-11-21 13:43:53 +01:00
Gina Häußge bc82a18a03 Merge branch 'rc/maintenance' into maintenance 2016-11-08 15:25:05 +01:00
Gina Häußge 6976ac9edd Preparing release of 1.2.17 2016-11-08 11:31:16 +01:00
Gina Häußge 2952b2622e Do not hiccup on ipv6 addresses in the HTTP Host header
Fixed port extraction. Now supports hostname, hostname + port,
ipv4, ipv4 + port, ipv6, ipv6 + port

Fixes #1571
2016-11-07 16:17:16 +01:00
Gina Häußge 7efdeced62 Merge branch 'rc/maintenance' into maintenance 2016-10-17 14:23:43 +02:00
Gina Häußge 2f79d9d226 Preparing release of 1.2.17rc4 2016-10-17 12:25:51 +02:00
Gina Häußge 88f8077b77 Plugin JS files might be empty, need to handle that
Otherwise webassets will explode with empty file list on bundle creation.
2016-10-17 12:16:53 +02:00
Gina Häußge 696904bc49 Support M1{09|90} R<temp> in virtual printer too 2016-10-17 10:41:39 +02:00
Gina Häußge cd578dc2e1 Checking M109/M190 for R should actually check for R and not S
Thanks @FHeilmann
2016-10-17 10:29:16 +02:00
Gina Häußge e15956883a Add support for R parameter in M109/M190 2016-10-14 18:19:08 +02:00
Gina Häußge 3f8dde75d5 Persist settings after changing default printer profile
Fixes #1541
2016-10-14 16:23:47 +02:00
Gina Häußge bc5044b125 Fix target temperature propagation from comm layer
When setting the tracked target temperature from a sent temperature
command, the changes in tracked temperature were not propagated
from the comm layer to registered callbacks.

But since the standard printer also didn't make a copy of the mutable
dict of tool temperatures, those were in fact updated even without
propagation in the printer implementation when the values in the
comm layer got updated, whereas the bed temperature - an immutable
tupel - was not.

Two wrongs sometimes do in fact make a right. In this case that led
to target temperature changes on the tools immediately reflecting
in printer.get_current_temperatures after the command was sent,
but changes to the bed target taking until the next M105 response
to propagate.

Decoupling the data structures and adding propagation commands
to the comm layer solves this issue.

Fixes #1543
2016-10-14 16:01:03 +02:00
Gina Häußge c863562d12 Limit cura profile importer to .ini files and clarified support again 2016-10-14 11:58:39 +02:00
Gina Häußge 27fb397681 ffmpeg: Only modify the -framerate parameter for setting video fps
-r only allows a limited set of target framerates according to the mpeg2
 standard, but -framerate allows to specify how long each frame should
 be shown, giving us full control over "virtual" fps without causing errors
 when the user selects a non-standard frame rate
2016-10-13 19:23:15 +02:00
Gina Häußge eabff453cd Preparing release of 1.2.17rc3 2016-10-13 16:12:57 +02:00
Gina Häußge 6cd6b98c2b Core JS needs to go after plugin JS, or we might run into race conditions 2016-10-13 16:11:13 +02:00
Gina Häußge 91ef5480b1 Preparing release of 1.2.17rc2 2016-10-13 12:12:09 +02:00
Gina Häußge 419f3370a2 Split JS/CSS/LESS assets between core+bundled plugins and external plugins
That way a JS error in an external plugin won't nuke the whole UI, which IMHO
is worth the additional requests needed to load the split up files.

See #1544 for an example of such a situation.
2016-10-13 12:07:00 +02:00
Gina Häußge 1370c7a9cc Inject plugin_info object into plugin implementations as well 2016-10-13 12:03:05 +02:00
Gina Häußge 982d121d3b Revert "Preparing release of 1.2.17"
This reverts commit 28de87441f.
2016-10-12 18:36:41 +02:00
Gina Häußge 67634e4f7c Merge branch 'improve/loggingHandlers' into maintenance 2016-10-12 18:15:12 +02:00
Gina Häußge 3d26e478e3 Fix a bug causing the update of OctoPrint to not work under certain circumstances
The bug only manifests if a user had installed 1.2.16 earlier and never once hit "Save" in the
settings before attempting to update to 1.2.17. With 1.2.16 the updater script and settings for
OctoPrint's own update mechanism were changed to prefer "checkout_folder" instead of
"update_folder". In earlier versions however "update_folder" was still used. Saving settings
even once (even without any changes!) will migrate the data. But if that's not done a
KeyError will be raised when trying to retrieve "update_folder" from the check config, with
"checkout_folder" as its fallback.

Rather stupid error really.
2016-10-12 18:13:46 +02:00
Gina Häußge 28de87441f Preparing release of 1.2.17 2016-10-12 16:50:22 +02:00
Gina Häußge 688a998dd2 Use CleaningTimedRotatingFileHandler in bundled plugins 2016-10-11 10:54:16 +02:00
Gina Häußge 343631b3c6 Custom SerialLoggingHandler
Does roll overs on next connections to the printer
2016-10-11 10:53:37 +02:00
Gina Häußge 139b2277d1 Fix missing absolute import declarations 2016-10-10 19:45:34 +02:00
Gina Häußge e8123a6ab1 Custom logging handler that cleans files on startup 2016-10-10 19:27:18 +02:00
Gina Häußge 891fd18f0e Preparing release of 1.2.17rc1 2016-10-06 15:31:28 +02:00
Gina Häußge 41fe997af4 Make sure to also delete any un-suffixed cookies when deleting a cookie
Follow-up to a161feb
2016-10-06 15:25:13 +02:00
Gina Häußge 6c21ee32a8 Fix broken filtering on ItemListHelper
Filter toggling didn't remove the specific filter but always the last item
in the filter list. No, I don't know either why I didn't notice this earlier m(
2016-10-05 19:52:28 +02:00
Gina Häußge bcef804a4a Updated less.js to current version 2.7.1 2016-10-05 12:54:57 +02:00
Gina Häußge 39d5446789 Fixed encoding bug in HTTP request processing, causing weird flask issues
If a content type header was present on a multipart form data part it would turn
the rewritten body into a unicode instead of a byte array, causing a later conversion
to a byte stream to not capture.

Fixed both the fact that the rewritten body would turn into unicode by making
sure the content type header was provided as byte array and fixed the byte stream
conversion to also trigger on unicode instances.

Solves #1531
2016-10-05 12:33:02 +02:00
Gina Häußge a161feb106 Fix bug causing remember_me cookie not to deleted properly on logout 2016-10-04 18:34:45 +02:00
Gina Häußge 8c74b9e74d SettingsPlugins may now mark paths as restricted
That way they can ensure that no sensitive settings data may be
 sent on the REST API.
2016-10-04 16:10:01 +02:00
Gina Häußge bc0880711b Log full stack trace on socket connection errors when debug logging
Might help bring some clarity for #1523
2016-10-04 10:18:48 +02:00
Gina Häußge e038cfa4dc Track bypassed views on cache too
Only keep the cache keys, but that way we know when
we were going to cache something and then didn't
due to environmental factors, e.g. headers on request
or response.

Necessary to be able to track if the preliminary caching
has been done during startup to properly reflect that
on cached.gif
2016-09-28 13:44:59 +02:00
Gina Häußge e700891dba Marked some paths for github's linguist 2016-09-23 14:26:58 +02:00
Gina Häußge 080a6e9ccd Extend atomic_write to allow setting & persisting file permissions 2016-09-23 14:26:33 +02:00
Gina Häußge 3a13dd9022 Fixed printerParameters config migrator
Was marking the config as dirty just when printerParameters entry existed,
which always exists - various sub entries of that are what needs to be checked
instead.
2016-09-23 12:37:41 +02:00
Gina Häußge 3d959c1d5f maintenance branch is now 1.2.17.dev 2016-09-23 12:29:56 +02:00
Gina Häußge 354042b84d Preparing release of 1.2.16 2016-09-23 09:51:45 +02:00
Gina Häußge 26fb208f48 Preparing release of 1.2.16rc2 2016-09-16 12:54:48 +02:00
Gina Häußge 2fc86e095f 1.2.16rc1 was actually pushed out on 2016-09-09, not -08 2016-09-12 12:49:04 +02:00
Gina Häußge 0167015b46 Fix generate/delete API key functionality in user settings
Closes #1491
2016-09-12 12:48:10 +02:00
Gina Häußge 8b99c89acf Return 400 Bad Request if a multipart request lacks the boundary
It's mandatory according to RFC2046, section 5.1

See also #1486
2016-09-12 12:48:10 +02:00
Gina Häußge 0bb6f5215d "prerelease" key might not be in check if tracking stable releases 2016-09-12 09:25:34 +02:00
Gina Häußge 079430e3c8 Preparing release of 1.2.16rc1 2016-09-09 11:52:56 +02:00
Gina Häußge 7efa311b04 Updated the german translation again after adding a sentence 2016-09-09 11:52:54 +02:00
Gina Häußge c6d9575127 Added link to "Using Release Channels" to the SWU settings dialog 2016-09-09 11:34:25 +02:00
Gina Häußge bbe6e44d44 Only use non-postfixed cookie if no postfixed one exists
Example:

  * both "session" and "session_P5000" cookies available: "session" value from "session_P5000"
  * only "session" cookie available: "session" value from "session"
  * only "session_P5000" cookie available: "session" value from "session_P5000"
2016-09-08 15:42:51 +02:00
Gina Häußge 53b74f9caa Only construct HTTP_HOST header from SERVER_NAME and _PORT if it's unset
If HTTP_HOST is set, following PEP333 it takes precedence over SERVER_NAME and
_PORT, so we set those from it.
2016-09-08 15:18:09 +02:00
Gina Häußge a7bd770180 Allow overriding file name sanitization by sub classes of LocalStorage 2016-09-08 12:50:04 +02:00
Gina Häußge 2b22d26eac Fixed a small issue with RFC 5987 headers arriving as unicode in parser
Also added API docs regarding header encoding, incl support for RFC 5987
for filename fields in Content-Disposition headers in multipart/form-data
parts, incl. an example of an upload request with a utf-8 encoded filename.
2016-09-07 18:44:46 +02:00
Gina Häußge 13728c231c Also explicitely support ISO-8859-1 encoded multipart headers
Solves an issue with clients encoding filenames in multipart
 headers in ISO-8859-1, causing an HTTP 500 response code.

 This change makes ISO-8859-1 encoded headers work, sends
 a 400 Bad Request instead of 500 Internal Server Error if the
 request multipart headers cannot be decoded as either UTF-8
 or ISO-8859-1, defines UTF-8 content type for multipart text
 fields in rebuilt body and also adds support for RFC 5987 for the
 multipart file upload "filename" header component.
2016-09-07 17:03:59 +02:00
Gina Häußge 209a88bd6a And consequently yet another update of the german translation 2016-09-07 12:10:34 +02:00
Gina Häußge 2256a1e825 Found an untranslated piece of UI 2016-09-07 12:05:54 +02:00
Gina Häußge 122ec39728 And another update of the german translation 2016-09-07 11:55:31 +02:00
Gina Häußge d4428de9a0 Some rewording 2016-09-07 11:55:17 +02:00
Gina Häußge 536d46f15d Updated german translation 2016-09-07 10:21:21 +02:00
Gina Häußge 62d5f04373 Merge branch 'fix/portRestrictedCookies' into maintenance 2016-09-05 12:11:12 +02:00
Gina Häußge b48af7133e Fixed validator for tornado 2016-09-05 12:10:58 +02:00
Gina Häußge 9a9502b281 "prerelease" might not be in check (chances for that are actually high), don't hiccup on that 2016-09-05 12:09:13 +02:00
Gina Häußge 9d9eb3390d Cookie names are now port specific, based on the request associated with a response
* make sure server_port headers are properly set in reverse proxied scenarios
  * overwrite request and response classes to
    * always apply reverse proxy environment changes (so far missing for tornado
      context)
    * strip cookie name suffixes from cookie names on requests and
    * be sure to set cookie name suffixes for cookie names on responses
    * include script root in path used for cookies
  * some minor refactoring in octoprint.server setup routines
  * removed ReverseProxied class (didn't work for tornado context)
  * add unit tests for the whole reverse proxy, request and response customization
2016-09-05 12:06:56 +02:00
Gina Häußge ce28b637ab Better solution for access to .md files when running from source
The SelectedFileSystemLoader doesn't collect everything and the
kitchen sink from disk...
2016-08-29 17:50:14 +02:00
Gina Häußge 21b7339187 SWU: Move branch config to update check & fix release version detection again 2016-08-26 14:18:17 +02:00
Gina Häußge df1a97b0e1 SWU: Only enforce unequality comparison on release channel switch 2016-08-26 10:40:01 +02:00
Gina Häußge 66da377b64 SWU: Minor fixes in the octoprint check population 2016-08-26 10:19:20 +02:00
Gina Häußge 34e5b5d50f SWU: Sort github releases by version, not publication date
We can't rely on the publication date anymore with the introduction of prerelease
channels, since e.g. a current devel prerelease might have been published
earlier than the latest stable but should still be considered the latest release for
this release channel
2016-08-26 10:18:35 +02:00
Gina Häußge 882cf3a142 SWU: git reset => git reset --hard for forced version 2016-08-25 16:49:18 +02:00
Gina Häußge d9a4ff47b6 Make sure to switch back to master for stable release channel 2016-08-25 16:30:35 +02:00
Gina Häußge d538b3fd38 Adjust swu plugin settings to selected update method 2016-08-25 15:45:25 +02:00
Gina Häußge f8386649bf Fix release channel selector 2016-08-25 13:32:18 +02:00
Gina Häußge b5bc03e711 First throw at release channels
We start out with master (Stable), rc/maintenance (Maintenance) and rc/devel (Devel)
2016-08-25 09:41:12 +02:00
Gina Häußge 0a78c92407 Do access logging via custom request header instead of global flag
We don't want any weird things to happen due to multithreading...
2016-08-18 16:14:03 +02:00
Gina Häußge 60c46a3fc4 Fixed use of preemptive cache exceptions in "unless" implementation 2016-08-18 14:05:12 +02:00
Gina Häußge 8782f77577 Slightly modified logging for cached.gif 2016-08-18 14:01:25 +02:00
Gina Häußge 08f9529c6d Merge remote-tracking branch 'origin/maintenance' into maintenance 2016-08-18 13:58:38 +02:00
Gina Häußge 6499bd160f Only wait for preemptive cache if it's enabled for path & view 2016-08-18 13:56:46 +02:00
Gina Häußge 599098a589 Have intermediary reload only after preliminary caching 2016-08-18 12:27:30 +02:00
Gina Häußge aa57277ff8 Only report files as enqueued for analysis which actually are 2016-08-18 08:39:19 +02:00
Gina Häußge 74a94469b6 Fix an issue with global_get from 3rd party plugins 2016-08-17 14:50:53 +02:00
Gina Häußge 217e54d81c Make sure we are still in printing state before sending next line
We might just have "eaten" a line used for triggering a pause (e.g. an M0)
and thus might not be eligible to send the next line from the streamed file
anymore.

Solves #1448
2016-08-16 09:29:29 +02:00
Gina Häußge b05beb27b5 Don't sanitize . or .. folder names 2016-08-15 16:13:35 +02:00
Gina Häußge d81ec15f43 Improvements in fuzzy print time algorithm
Also use new fuzzy print time in gcode viewer to have some consistency.
2016-08-15 15:42:06 +02:00
Gina Häußge 39372a9475 Also sanitize leading .
That way hidden files that are uploaded will be "de-hidden".

Note that NO "de-hiding" of existing files will take place!
2016-08-15 14:19:36 +02:00
Gina Häußge e8cac14c2f Make sure uploads folder only has sanitized entries
Should make sure stuff doesn't break when people perform manual
file operations on the uploads folder (e.g. uploading files
that don't match the sanitization scheme).

Should solve #1434
2016-08-15 14:19:35 +02:00
Gina Häußge 5bef0926a6 Add [ and ] to valid chars in filenames
See #1434
2016-08-15 14:19:34 +02:00
Gina Häußge 7772fdc7bf Tooltips for state panel 2016-08-15 14:19:33 +02:00
Gina Häußge cd736c44df Improved fuzzy print time display 2016-08-15 14:19:32 +02:00
Gina Häußge 11bdc176a0 Fix minute comparison for dumb estimate fallback
Probably solves the core reason that caused #1428 to be
reported in the first place, totally inaccurate early linear
approximations (when nothing better is available) making
it to the user.

It should now display "Calcuting..." until the approximation
stabilizes OR the configured max percentage or max time without
an estimate are reached.
2016-08-15 14:17:27 +02:00
Gina Häußge fe97a8d6bd maintenance is now 1.2.16.dev 2016-07-30 09:56:49 +02:00
Gina Häußge afdb98a92f Postponing the release of 1.2.15 until tomorrow 2016-07-29 21:50:45 +02:00
Gina Häußge 7b48270239 Preparing release of 1.2.15 2016-07-29 16:30:55 +02:00
Gina Häußge 90340487f7 Merge branch 'fix/revertTimeoutAdjustment' into maintenance 2016-07-29 08:54:11 +02:00
Gina Häußge 1f19fd1e1d Partially revert 937487037
This commit might be at the root of the problems reported
in #1423
2016-07-29 07:45:03 +02:00
Gina Häußge 9b13eb8a6c Support serial hook handlers to not return written bytes 2016-07-29 00:13:03 +02:00
Gina Häußge 444a36d0f0 state_string must always be initialized
See #1425
2016-07-28 23:24:29 +02:00
Gina Häußge 7c5cc8d256 Make sure we have at least two timestamps in lastmodified calculation
Otherwise our max(*timestamps) call might fail
2016-07-28 15:19:34 +02:00
Gina Häußge e76a3ea54f maintenance is now 1.2.15.dev 2016-07-28 14:30:21 +02:00
Gina Häußge 14969e5508 Preparing release of 1.2.14 2016-07-28 12:15:22 +02:00
Gina Häußge f671006582 Use circle instead of info symbol for print time left quality indicator 2016-07-28 11:37:27 +02:00
Gina Häußge bd352f4658 Make sure to clear_to_send in timeout handling for active resends 2016-07-28 11:30:23 +02:00
Gina Häußge 046536dd70 If a line is filtered while printing, read next line to continue sending
We want to make sure that while printing we always continue sending something,
either from the command queue or the printed file.
2016-07-28 11:18:57 +02:00
Gina Häußge f9cb29ac91 A bunch of documentation fixes and updates 2016-07-28 09:43:41 +02:00
Gina Häußge fad2e8f1b8 Visual distinction of state panel UI clusters 2016-07-27 18:38:40 +02:00
Gina Häußge f2ecb96c83 Add indicator of origin of print time left estimate to UI 2016-07-27 18:38:17 +02:00
Gina Häußge 0a81e8b161 Use centered text in progress bars
* print progress shows percentage
  * upload progress shows what it always showed, but fully centered
  * GCODE viewer progress shows what it always showed, but fully centered
2016-07-27 15:05:16 +02:00
Gina Häußge eb822c83a3 Add LESS/CSS for (centered) text in progress bars & knockout helper 2016-07-27 15:04:07 +02:00
Gina Häußge ec8427cbb8 Fix a bug causing the "Streaming ..." text to vanish on transfer to SD 2016-07-27 14:46:00 +02:00
Gina Häußge 3585eb05a2 Fix a tiny typo 2016-07-27 10:13:11 +02:00
Gina Häußge 1fd776153c Another attempt at saner print time estimation
Seriously though, this topic is driving me nuts...

  * track origin of print time left estimate
  * less draconian threshold for estimation helper for all prints, not just
    sd prints
  * sanity check estimated/statistical total print time, if not sane force "dumb"
    estimate
  * force "dumb" estimate if no other estimate is available after set percentage or
    print time
2016-07-26 18:06:21 +02:00
Gina Häußge 75012472a2 Revert "Synchronize access to selected file"
This reverts commit b5e19f0676.
2016-07-26 11:18:10 +02:00
Gina Häußge 55d5df7f14 Report CLOSED/CLOSED_WITH_ERROR states as "Offline"
Provide error string for the latter case in state as well.
2016-07-22 10:51:38 +02:00
Gina Häußge 6e73c31a68 Report correct printer state even after disconnecting
Error string on close with error would get lost, that happens no longer
2016-07-22 10:50:48 +02:00
Gina Häußge d7ae147764 Tickle printer on timeout when idle and blocked 2016-07-22 09:46:58 +02:00
Gina Häußge 9eb1485e84 Add max timeouts configuration to settings 2016-07-21 18:46:54 +02:00
Gina Häußge 4f11f6362b Saner defaults for max timeouts
10 max consecutive with 30s default communication timeout
is a bit too long to wait
2016-07-21 18:46:34 +02:00
Gina Häußge 4f1a55c2df Added AWOL debug command to virtual printer 2016-07-21 16:25:49 +02:00
Gina Häußge cfc5f45aa5 Merge branch 'maintenance' into fix/timeoutDetection
Conflicts:
	src/octoprint/settings.py
	src/octoprint/util/comm.py
2016-07-21 16:13:35 +02:00
Gina Häußge 2f26104b98 Better sleep debug command in virtual printer 2016-07-21 16:11:09 +02:00
Gina Häußge b5e19f0676 Synchronize access to selected file 2016-07-21 16:10:57 +02:00
Gina Häußge 3614033b0d No endless circles if we can't write any bytes to serial 2016-07-21 16:10:00 +02:00
Gina Häußge 44ec821294 Track consecutive timeouts
Should allow to detect if a device actually has gone missing.

See #1388
2016-07-21 16:02:28 +02:00
Gina Häußge c6225aa834 Introduce single output method in virtual printer for easier debugging 2016-07-21 13:25:39 +02:00
Gina Häußge 5d21399a73 Custom markdown filter, 3rd party one wasn't thread safe 2016-07-21 11:50:29 +02:00
Gina Häußge d61371a495 Make sure to include all md files in manifest 2016-07-18 12:13:16 +02:00
Gina Häußge 92f9ed465e Removed two unused locks from StateMonitor 2016-07-14 19:46:44 +02:00
Gina Häußge 0a8a7ba589 Fixed some imports 2016-07-14 19:43:22 +02:00
Gina Häußge bfcd00e466 Fix: Send non-protocol messages from the printer to clients
Solves #1385
2016-07-14 19:42:43 +02:00
Gina Häußge 20fc7f25bc Fix: Ensure log entries and messages from printer are unicode
Otherwise even one line that can't be converted while sending the
backlog to the client can kill the whole backlog.
2016-07-14 19:20:05 +02:00
Gina Häußge 297c434d64 Ease up a bit on the version pinning 2016-07-14 11:41:39 +02:00
Gina Häußge 1e7ea28195 Merge branch 'fix/serialRxBufferHandling' into maintenance 2016-07-13 17:24:13 +02:00
Gina Häußge 937487037a Shorter timeout during heatup & no scary message on end
Set read timeout on serial port to a much shorter value (default 2.0s)
during a heatup. Firmware should usually send the current temperature
back every second, so if that stops we can consider the heatup to be finished
even if we don't see an ok.

That is important in cases such as SD printing, where we might see a
heatup sequence we didn't trigger ourselves, during which we shouldn't spam
the printer with commands it potentially can't process but after which we
still should take up normal communication again. In case of a heatup sequence
triggered by an SD print we won't see an ok and hence only can now through a
timeout that things are now done printer side. In such a case the user should not
get thrown a scary timeout message in their general direction either.

Solves #1409
2016-07-13 17:21:45 +02:00
Gina Häußge 2cc9631791 Reset printAfterSelect once it's triggered
Should solve #1407
2016-07-13 13:01:33 +02:00
Gina Häußge 2b9aef5874 Keep sending if serial line was only sent partially
So far the sending routine did not track the amount of bytes that were
actually sent. This is now fixed such that if the number of sent bytes
is less then the number of bytes of the whole message, the sending
rountine will continue to send the unsent parts of the message until
it succeeds (or a timeout occurs).

Also adjusted the virtual printer to imitate a real serial interface with
regards to having it return the written bytes and allowing a partial
sending (returning the number of bytes that actually were sent).
2016-07-12 17:48:47 +02:00
Gina Häußge 0fec3aeca9 Merge branch 'patch-1' of https://github.com/cvignac/OctoPrint into maintenance 2016-07-12 11:52:27 +02:00
cvignac 12fcfda481 Typo correction in slicing.rst
In 'Retrieve all slicing profiles' :
'GET /api/slicing/profiles' -> 'GET /api/slicing'
2016-07-10 15:40:24 +03:00
Gina Häußge 58ee5f17f7 Fix simulation of moves on virtual printer 2016-07-08 16:44:40 +02:00
Gina Häußge a7fe2d5148 Clean up old AND invalid entries in preemptive cache config 2016-07-07 10:22:37 +02:00
Gina Häußge d96a91ecc3 Fix modal background of update confirmation not vanishing 2016-07-06 15:30:36 +02:00
Gina Häußge 924d5c8d7d More error resilience in template rendering
Wrapped potentially external and problematic includes in
custom try-endtry-blocks
2016-07-06 15:09:38 +02:00
Gina Häußge 5126fc1093 Fixed an import error introduced through moving the jinja trycatch extension
(cherry picked from commit 3ea77c7)
2016-07-06 15:03:43 +02:00
Gina Häußge 162c4f11dd Moved jinja ExceptionHandlerExtension to octoprint.util.jinja
(cherry picked from commit 3d0fc8d)
2016-07-06 15:03:34 +02:00
Gina Häußge 240fe70902 Custom try-catch block for jinja
Allows some more error checking in templates. Not used at the moment but
might come in handy in the future.
(cherry picked from commit 7708eea)
2016-07-06 15:01:55 +02:00
Gina Häußge bef989961d Added @MoonshineSG to AUTHORS.md 2016-07-06 13:30:28 +02:00
Gina Häußge eeaf68d61a Better timeout defaults for intermediary page
In some situations an error could be displayed otherwise since
online.gif was available, intermediary.gif wasn't anymore, but pinging
the latter timed out before the next ping of the former.

(cherry picked from commit 7809ba8)
2016-07-06 13:16:01 +02:00
Gina Häußge 674d625150 Transfer query & fragment on intermediary page reload
Also user window.location.reload if URL to reload is the same as the current one,
otherwise reloading will be a no-op if a fragment is provided.

(cherry picked from commit a367902)
2016-07-06 13:15:50 +02:00
MoonshineSG bfecb5fadf fix intermediary.html for url with parameters
(cherry picked from commit 2cc5eaf)
2016-07-06 13:15:34 +02:00
Mark Walker 5eefee3a4d RepRapFirmware style M23 select file
RepRapFirmware enumerates the gcode files starting at /gcode, it will
also interpret any relative path as being relative to that folder.
However a full absolute path will actually interpret as from the real
root of the SD card :-(

(cherry-picked from ac68570)
2016-07-06 05:17:44 +00:00
Mark Walker 02b0e906f1 Allow M23 "File opened" response with no filename
(cherry-picked from ba4b7c0)
2016-07-06 05:17:29 +00:00
Mark Walker 3069e05766 Add RepRapPro style file opened to virtual printer
(cherry-picked from 257c4ed)
Conflicts:
	src/octoprint/plugins/virtual_printer/virtual.py
2016-07-06 05:14:10 +00:00
Gina Häußge 8c80e3ac4a Scalar3D => Vector3D 2016-07-05 14:53:16 +02:00
Gina Häußge 79d660f377 Further GCODE interpreter fixes & optimizations
* Introduce Vector3D type to help with coordinate back and
    forth calculations
  * Fix typo in movement calculation (Y twice instead of Y and Z)
  * Removed some code duplication
2016-07-05 13:22:16 +02:00
Salandora 2ae2405792 Add diff part to retract too because of things like G1 X-10 Y-10 Z1 E-5
(cherry picked from commit de325c3)
2016-07-05 13:16:07 +02:00
Salandora 6e42e3e0ef Add calculation for moves in Z direction
(cherry picked from commit b9cf42f)
2016-07-05 13:16:02 +02:00
Salandora ad3ae405f6 Check for moveType == move instead of x,y,z is not None, otherwise x,y,z,e moves wouldn't be seen as extrude/retract moves
(cherry picked from commit 1b6a46c)
2016-07-05 13:15:55 +02:00
Gina Häußge 93b247b088 Display fuzzy time estimates in frontend 2016-07-05 13:15:20 +02:00
Gina Häußge 6018bf8428 Fix overeager preemptive caching, even on broken protocols 2016-07-04 19:28:20 +02:00
Gina Häußge a49bc9ca75 Fixed wrong placeholders in format string for exception 2016-07-04 19:02:12 +02:00
Gina Häußge cdbc8fcfbd Merge branch 'improve/wrongUploadError' into maintenance 2016-07-04 13:20:30 +02:00
Gina Häußge e453201c1a Better "upload error" message with supported extensions 2016-07-04 13:20:15 +02:00
Gina Häußge ec97765c80 Scroll to uploaded file, highlight it 2016-07-04 13:17:16 +02:00
Gina Häußge be34f7309d Scroll to uploaded file, highlight it 2016-07-04 13:14:38 +02:00
Gina Häußge dbf1273e9d Use first destination extension for default target name 2016-07-02 18:10:05 +02:00
Gina Häußge 944775abde Fixed registered destination extensions in cura plugin 2016-07-02 18:07:59 +02:00
Gina Häußge e7c21b1978 Support alternative source file types in SlicerPlugin
Also limit list of slicers in slicer dialog to compatible slicers.

Implements #935
2016-07-02 18:05:11 +02:00
Gina Häußge 73a85646c5 Added only pause/resume sub commands to job API
Implements #1393
2016-06-30 12:56:18 +02:00
Gina Häußge 0376bc4235 Only use first value for X-Scheme for reverse proxy setup
Solves #1391
2016-06-29 12:16:28 +02:00
Gina Häußge c70708e915 Fixed changelog for 1.2.13
Will stay this way now for 1.2.13 though, already released. Follow up versions
should reflect the contents of the release notes however.
2016-06-16 13:26:30 +02:00
Gina Häußge 01c5b77f7b maintenance branch is now 1.2.14.dev 2016-06-16 13:14:33 +02:00
Gina Häußge cb2e0d449f Preparing release of 1.2.13 2016-06-16 12:19:17 +02:00
Gina Häußge 6c20e58529 Handle browsers w/o support for visibility tracking 2016-06-16 12:10:14 +02:00
Gina Häußge 611c1ccf4a Disable GCODE viewer if browser is unsupported 2016-06-16 12:08:46 +02:00
Gina Häußge 397f762182 Don't trigger initial passive login before viewmodels are available
Closes #1374
2016-06-15 17:15:57 +02:00
Gina Häußge ad201b040d Don't parse B: in position as bed temperature
Closes #1373
2016-06-15 16:27:51 +02:00
Gina Häußge 0274b0f25b Have virtual printer report back with "B:" in line
Similar to Marlin with enabled COREXY. Useful for testing
parser behaviour.
2016-06-15 16:22:37 +02:00
Gina Häußge 0bb467e884 Ensure temperature graph to be properly initialized 2016-06-09 13:41:14 +02:00
Gina Häußge be711dd691 maintenance branch is now 1.2.13.dev 2016-06-09 12:16:27 +02:00
Gina Häußge 685ce16c85 Preparing release of 1.2.12 (part three)
Forgot to add the news category of the blog to the announcement
plugin and also updated the list of patrons again.
2016-06-09 09:31:36 +02:00
Gina Häußge 885b48911e Preparing release of 1.2.12 (part two)
Another update of the CHANGELOG after fixing a bug. Shifted release date
to tomorrow to leave more time for final tests that was now eaten up by the
last minute bug fix.

Also updated CONTRIBUTING file to explain new prerelease branch.
2016-06-08 16:48:39 +02:00
Gina Häußge d7ef60b4d2 Slight change in function definition of reused functions (JS) 2016-06-08 16:33:08 +02:00
Gina Häußge 63cec660ca Solve a race condition that could cause 401 responses and a broken UI
Closes #1364. See ticket for details.
2016-06-08 16:21:25 +02:00
Gina Häußge 4c34cb84c7 Preparing release of 1.2.12 2016-06-08 13:09:04 +02:00
Gina Häußge d3d4d4e407 Merge branch 'prerelease' into maintenance 2016-06-08 11:21:22 +02:00
Gina Häußge e9f80c6616 Added new prerelease branch to versioneer config
Can be used in the future for tracking prereleases and testing
proper version updates without having to push to master directly.
2016-06-08 11:19:21 +02:00
Gina Häußge 5006b019af Add events for slicing profile manipulation
Events SlicingProfile(Added|Modified|Deleted). Initially thought to be necessary
to properly refresh available profiles in slicing dialog, not needed for that after
all but still left in and documented, might be useful for someone.
2016-06-06 18:12:32 +02:00
Gina Häußge 4f3e4f7f38 Force rescanning of available slicing profiles for slicer on update
Should make newly uploaded profiles available in the slicing dialog without
having to first deselect and then reselected the current slicer.
2016-06-06 16:20:47 +02:00
Gina Häußge a0697f8bad Use movie prefix for timelapse notifications
Also added a missing lock.

Also part of the fix for #1320
2016-06-02 12:03:57 +02:00
Gina Häußge 2833372603 Allow deletion of *.mp4 timelapse files
That one was missing in a00faf2.

Fixes #1320
2016-06-02 11:11:06 +02:00
Gina Häußge 8ce1eafd5d Properly track unrendered timelapses that are being processed
UI removes action buttons for them and displays a spinner
indicating that the timelapse in question is either being
recorded or being rendered at the moment.

Should prevent users from accidentally trying to render an
incomplete timelapse.
2016-06-02 10:11:54 +02:00
Gina Häußge 21a4033f73 Don't concurrently delete unrendered timelapses
Could trigger lots of errors if an unrendered timelapse currently
being collected was deleted from a separate thread from right
under the collection thread.

Also only log errors while processing already deleted files
if debug logging is enabled.

Finally trigger MovieDone event AFTER deleting unrendered
files (otherwise just rendered timelapse might still be present
when list of timelapses is queried right after).

Should solve #1326
2016-06-02 10:05:44 +02:00
Gina Häußge 51a1953d99 Move timelapse event processing to timelapse viewmodel 2016-06-01 13:24:29 +02:00
Gina Häußge 30b6211157 Whitelist .g extensions on sd file upload
That way uploading something like auto0.g will not
cause a rename to auto0.gco anymore.

Closes #1314
2016-06-01 12:29:42 +02:00
Gina Häußge 36ec9c4741 Do not sort events in the event queue alphabetically
This should never have been a PriorityQueue, or at the very least it should
never have the data itself in a sortable structure.

Thanks to processing speed of the event queue that seldomly showed,
only in cases where two events entered the queue almost simultanously,
e.g. when starting to render a timelapse movie and immediately failing.

Should solve #1343
2016-06-01 10:29:47 +02:00
Gina Häußge 1581ebbead Fix error when trying to confirm the edit-user-dialog
Closes #1357
2016-05-31 13:32:14 +02:00
Gina Häußge 436ebd7c18 Add help text re units for disk space thresholds
Closes #1338
2016-05-20 11:04:42 +02:00
Gina Häußge 801d60388a Also report 0% print progress to plugins
Fixes #1344
2016-05-20 10:24:47 +02:00
Gina Häußge 821fa4299b Let's go all in and use keyword parameters
Way less error prone than positional arguments!
2016-05-19 18:35:02 +02:00
Gina Häußge b018a56e4c Merge branch 'maintenance-pid_cleanup' of https://github.com/kevans91/OctoPrint into fix/1324 2016-05-19 18:32:46 +02:00
Gina Häußge b1e75a1033 Make connection dialog visible for users again
Should actually not have been limited to admins-only, that was an accident
during switching to 1.2.0 implementation.

Once #1110 is tackled, this should be something configurable based on the role
as well.
2016-05-19 10:42:27 +02:00
Kyle Evans 86fbbefb6e Complete backport of pid cleanup fix for #1324 2016-05-15 09:16:53 -05:00
Gina Häußge 2c0fa7c1d1 Added @kevans91 to AUTHORS.md
(cherry picked from commit 425fa8e)
2016-05-12 10:52:25 +02:00
Kyle Evans 8263c6072a Make Server class octoprint_daemon-aware, make sure terminated() gets invoked on it upon SIGTERM and update respective test
(cherry picked from commit 75f8fac)
2016-05-12 10:44:27 +02:00
Gina Häußge 91b5fc6b0d Force synchronization of sockjs message sending 2016-05-10 09:48:20 +02:00
Gina Häußge 1225a2501d Fix a stupid mistake in the german translation 2016-05-09 15:27:17 +02:00
Gina Häußge 34c068b964 maintenance branch is now 1.2.12.dev 2016-05-09 10:12:46 +02:00
Gina Häußge e79703ba6e Preparing release of 1.2.11 2016-05-04 13:36:06 +02:00
Gina Häußge fb1fd37482 Updated list of supporters for May 2016-05-04 13:29:06 +02:00
Gina Häußge 4830d60269 Announcements: Ensure validity of channel keys, made refreshable 2016-05-04 13:28:28 +02:00
Gina Häußge 76959e06c9 Updated german translation 2016-05-04 09:57:25 +02:00
Gina Häußge 5a8c3654c4 We leave the About dialog untranslated for now 2016-05-04 09:51:50 +02:00
Gina Häußge a9756c4c36 Announcements: no read_until -> take latest from feed 2016-05-03 17:36:43 +02:00
Gina Häußge 9919de9a6c Added padding to announcement reader content pane 2016-05-03 10:22:23 +02:00
Gina Häußge 5091099f83 Added "About" link to settings dialog 2016-05-03 10:21:59 +02:00
Gina Häußge 7c6b9eac48 Added externalize_links filter for jinja2
Links from documents (like changelog, licenses etc) should
also be target blank & rel noopener/noreferrer
2016-05-03 09:59:37 +02:00
Gina Häußge 7a8e6b6b6d Use UTC for feed reader timestamps 2016-05-03 09:17:48 +02:00
Gina Häußge 50ae34dc4f Forgot the css file of the announcements plugin 2016-05-02 17:49:32 +02:00
Gina Häußge cbb692de30 Forgot to rename SPONSORS.md in .gitignore 2016-05-02 17:41:03 +02:00
Gina Häußge cc7dcbf6b6 Added support link to README 2016-05-02 17:38:50 +02:00
Gina Häußge 8f621eca43 Merge branch 'improve/announcementPlugin' into maintenance 2016-05-02 17:38:21 +02:00
Gina Häußge 9e73f1563d Strip paragraphs from summaries for announcement notifications 2016-05-02 17:32:36 +02:00
Gina Häußge 3a570f8ab0 Added OctoPi + Spotlight feeds, article link, better reader design 2016-05-02 17:14:48 +02:00
Gina Häußge 62aee50701 rel="noopener noreferrer" for external links 2016-05-02 11:48:08 +02:00
Gina Häußge 789e9922d1 Some improvements in the about dialog
* Sponsors => Supporters
  * Links to individual About dialog tabs from start page
  * Slight rewording here and there
  * rel="noopener noreferrer" for external links
2016-05-02 11:25:05 +02:00
Gina Häußge 58fc67bd99 Fixed feed links in feed viewer 2016-05-02 11:02:53 +02:00
Gina Häußge d322c365ce Updated feeds 2016-05-02 10:12:18 +02:00
Gina Häußge 652158d17a WIP: Announcement plugin 2016-05-02 10:12:17 +02:00
Gina Häußge 73d981ed6b Show - instead of None in About dialog if plugin has no license set 2016-05-02 10:10:27 +02:00
BillyBlaze 8e98e9c40c Allow an invalid session to logout from logedin state 2016-04-30 10:36:03 +00:00
BillyBlaze 119f727c8d Knockify the distance on the control tab 2016-04-21 19:39:28 +00:00
Gina Häußge 5e6a7ef605 Added sponsor list 2016-04-21 11:56:56 +02:00
Gina Häußge a319e8c497 Added trademark note to about dialog
(cherry picked from commit 48b984c)
2016-04-19 16:42:04 +02:00
Gina Häußge 3cc1c012bb Reset scroll position and selected tab in about dialog
(cherry picked from commit 4e84d62)
2016-04-19 16:41:43 +02:00
Gina Häußge e0b888b2d0 First throw at an "About" dialog
(cherry picked from commit f2c07e8)
2016-04-19 16:41:30 +02:00
Gina Häußge f050b4e5cb Merge remote-tracking branch 'origin/maintenance' into maintenance 2016-04-19 14:57:46 +02:00
BillyBlaze 5a3e9e7aba Fix wrong css data-binding 2016-04-09 21:46:32 +00:00
Salandora 8f0b7dd6d1 Fix timelapse postroll
Images got captured with wrong filename
Additionally fixed some refactoring mistakes
2016-04-02 15:41:27 +02:00
Mark Walker 183ca3291b If no SD card support, remove SD file filter
When SD card support is disabled on the server, remove any client side
filtering to just SD files since there aren't any and there won't be UI
turn remove the filter either.  Should address #1300
2016-03-28 12:59:08 -07:00
Gina Häußge b54e1b44a4 Added checksum checking to virtual printer 2016-03-18 15:00:03 +01:00
Gina Häußge 1a4c06d6f6 Added flag to trigger ok for resend requests
That's necessary to keep communications going in case of a resend request
for firmwares that do not send an ok after a resend request.
2016-03-18 14:59:13 +01:00
Gina Häußge a229cbfd49 maintenance branch is now 1.2.11.dev 2016-03-16 10:55:08 +01:00
Gina Häußge 692166f067 Preparing release of 1.2.10 2016-03-16 09:38:58 +01:00
Gina Häußge 69dca5b58c Updated german translation 2016-03-16 09:22:10 +01:00
Gina Häußge 6305c4d2eb Timeout for comm closing, also wait for send queue on close
We don't want to wait indefinitely for our send and command queues to empty, so
we don't use .join but instead a busy timeout wait routine.

Also fixed a couple of small issues found while preparing comm unit tests.
2016-03-15 17:09:01 +01:00
Gina Häußge b5cf20a1de Have comm layer wait until all lines are sent before disconnect
Added parameter "wait" to "close" method, defaults to True. Will have the
close method wait for all lines to be sent that are currently in the send queue.

In case of an error, no waiting will be done.

Made it necessary to correctly track task completion in the send queue, also
made that change to the command queue while at it.

Backported from devel, commit 7f2476e513
2016-03-14 11:59:02 +01:00
Gina Häußge 5807b606f0 Added @2bitoperations to AUTHORS.md
Was missing from PR #1255
2016-03-14 11:50:50 +01:00
Andrew Malota 398eaf58a9 allow download/management of mp4 timelapse too
(cherry picked from commit a00faf2)
2016-03-14 11:48:58 +01:00
Gina Häußge 4a933228c7 Added PR and issue templates, updated CONTRIBUTING.md 2016-03-14 11:43:15 +01:00
Gina Häußge 56caa7750c Twice as fast checksum calculation
Thanks @nophead!
2016-03-12 09:40:33 +01:00
Gina Häußge 38a47bb2a8 Change wording: not firmware error, but communication error
"Error:" lines can also be produced by OctoPrint itself in case of serial exceptions or
connection failures, so "the firmware reported" was misleading.
2016-03-11 18:06:14 +01:00
Gina Häußge e6f9003549 Reset line numbers before entering sd upload state
Otherwise M110 N0 will not be processed to be prefixed with N0 and hence
not reset the line numbers on the printer to 0.

That was as bug in 1a308a1bc7
2016-03-11 18:01:22 +01:00
Gina Häußge 5cadf85401 Only report transfer rates in the log for sd uploads
For real prints they are misleading - mechanical movement takes time.
2016-03-11 17:58:00 +01:00
Gina Häußge baab1ce70a Use new generic TypedQueue for send queue and command queue
That way no M105 cascades can be triggered by the  M105 polling timer (or the M27
polling timer).

Adjusted logging output to make clear which queue rejected typed entry.

Made timeout handler send M105 with type "temperature" as well to make sure
we don't suddenly have two M105 directly after each other in the send_queue,
one from the polling timer, one from the timeout handler.

Fixes #1275
2016-03-11 17:25:39 +01:00
Gina Häußge cbaf848711 Move TypedQueue to octoprint.util & make generic
put and get are now overwritten to create t-tuple out of provided item
and item_type on put, and to only return item on get.

_put and _get extract item_type and use that for managing the
lookup set.
2016-03-11 17:20:26 +01:00
Gina Häußge 85060b972a Fix _handle_timeout not correctly honoring long runners
Issue was introduced through #1271 fix.
2016-03-11 17:20:13 +01:00
Gina Häußge 29aefdec08 Don't send M20 twice after streaming to SD
Fixes #1274
2016-03-11 16:48:03 +01:00
Gina Häußge 6e01a361c5 Make "Fake Acknowledge" button really fake an ok
So far it only set the clear_to_send flag, now it actually does everything
else a read ok would do.
2016-03-11 16:35:15 +01:00
Gina Häußge 542ccb5421 Slight simplification of setProgressData calls in standard printer 2016-03-11 16:29:59 +01:00
Gina Häußge 6d8eb682c1 Use concatenation instead of format strings in comm layer 2016-03-11 12:45:30 +01:00
Gina Häußge d701c261c3 Less processing overhead when uploading to SD
Better structured "don't handle phases" checks and adjusted
job wrapper that doesn't try to apply tool tracking or temperature
offsets.
2016-03-11 12:35:53 +01:00
Gina Häußge 7b16f38ba3 Fetch timeouts for communication only once from settings 2016-03-11 11:16:27 +01:00
Gina Häußge 337329eda0 Added test stub for quick performance tests of the comm layer
Running comm.py with parameters port, baudrate, local file, remote file will
upload local file to remote file on the printer's sd using the provided connection
parameters.

Example:

    python -m octoprint.util.comm /dev/ttyUSB0 115200 /path/to/some.gcode test.gco

No plugin support! Only regular serial connection supported.
2016-03-11 10:43:02 +01:00
Gina Häußge 47b7552f91 Decouple comm progress reporting from processing 2016-03-11 08:48:18 +01:00
Gina Häußge 6736224962 Removed logging from CountedEvent 2016-03-11 08:28:39 +01:00
Gina Häußge c9009496f6 Don't trigger an M105 on timeout during a resend
Had to reorder message processing a bit in order to be able to
properly handle further resends in timeout situations.

Has the added benefit that "ok" now gets processed very early
and now extra state based processing is needed anymore.
2016-03-10 19:05:16 +01:00
Gina Häußge d393a6730c Don't have M28 response generate extra "ok"
Fixes #1272
2016-03-10 16:03:52 +01:00
Gina Häußge 069bfdd9f8 New flag to have M29 response inject "ok"
Adjusted virtual printer to allow marking of M29 as broken re sending
of ok.

Fixes #1273
2016-03-10 15:58:59 +01:00
Gina Häußge 23d2cdec76 Use 0 as default bed temperature in slicer
Should prevent slicing result to contain bed temperature settings even if
printer has a heated bed configured unless slicing profile also contains a
temperature.

Fixes #1268
2016-03-10 11:55:17 +01:00
Gina Häußge 1a308a1bc7 Reset line numbers for sd streaming as well 2016-03-09 15:44:23 +01:00
Gina Häußge 13098dde00 Removed unused "{start|end}SdFileTransfer" 2016-03-09 15:37:33 +01:00
Gina Häußge 27d1a6ca37 Virtual printer: request correct line in dummy resend 2016-03-09 15:33:17 +01:00
Gina Häußge 1616fb4de8 Better error reporting in comm layer
Option to log last terminal lines before a resend (defaults to off for now),
more exception logging in octoprint.log in various error cases, also log
unsolvable resend requests with requested and current line number.
2016-03-09 15:24:40 +01:00
Gina Häußge 07d8d4b88d Made virtual printer a bit faster 2016-03-09 12:09:44 +01:00
Gina Häußge 2a3d9c291d Fixed a merge error 2016-03-09 11:54:05 +01:00
Gina Häußge b36290a1f2 Added new serial config options to UI
Also pushed more advanced config option into an initially hidden
"Advanced Options" section, similar to other places.
(cherry picked from commit 84b343a)
2016-03-09 11:41:49 +01:00
Gina Häußge 48d74ef2fd Improved handshake procedure on comm layer
"Hello" command sent to printer to trigger initial handshake can now be
configured. Commands that _always_ necessitate to be sent with checksum/
line number (e.g. M110 on Marlin) can be configured as such too.

Also fixed an issue causing the "Hello" command to not be actually enqueued
first thing on opening a connection. Seems to not have caused harm in the
wild, but was unintentional.
(cherry picked from commit 5c2ae37)
2016-03-09 11:23:50 +01:00
Gina Häußge 35e20162ec Revert "Improved connecting phase"
Improved connecting for some printers, destroyed it
completely for others, so this needs some more work/
thought before it's ready for prime time.

This reverts commit c82ec3d3af.
2016-02-22 13:33:34 +01:00
Gina Häußge c82ec3d3af Improved connecting phase
M110 is now sent every second until either a connection is established or the connection
attempt times out. That should prevent connection handshakes from failing due to
some initial garbage on the line that swallows an ok.
2016-02-17 11:33:49 +01:00
Gina Häußge 5c06bd5036 Kill background tasks of virtual printer on disconnect
Otherwise there might be errors with wait-for-heatup or sd printing
situations where self.outgoing is gone suddenly.
2016-02-16 15:09:22 +01:00
Gina Häußge 21034b381c Cancelling a print that is not ongoing doesn't make sense 2016-02-16 10:04:06 +01:00
Gina Häußge beb5850361 Only try to record recovery data if a print was ongoing 2016-02-16 10:03:02 +01:00
Gina Häußge 1ea0cf9213 Always reset the job data on disconnect
If former state was "Printing", so far the full disconnect state handling
wasn't done properly.
2016-02-16 09:52:56 +01:00
Gina Häußge 4081a25f48 Merge branch 'fix/errorOnSdCardFail' into maintenance 2016-02-16 09:28:43 +01:00
Gina Häußge 718a102d44 Merge branch 'fix/wrongTrackingOfM109ForMultiextruder' into maintenance 2016-02-16 09:24:44 +01:00
Gina Häußge 49f4a0c5b0 line == "ok" => line.startswith("ok")
Fixes an issue introduced with M109 fix that causes
"SD card ok" not to be parsed correctly anymore.
2016-02-16 09:23:25 +01:00
Gina Häußge d267a752cd Capture NoSuchStorage error on SD card fails
We currently do not have a storage configured for SD card since
that hasn't yet been ported to the storage interface. So on an
SD card fail we need to capture that error when attempting to log
the print recovery data, or there will be issues processing
the cancel properly. A bit more of error handling is a good
idea here in any case too.

Fixes #1226
2016-02-16 09:13:22 +01:00
Gina Häußge 632724a023 Updated CONTRIBUTING.md
* Don't add red herrings to tickets
  * Provide all information when actually experiencing the same
     symptoms as an existing ticket
2016-02-16 08:42:05 +01:00
Gina Häußge eb48a50139 Fixed wrong tracking of current tool for M109 Tn heat-ups 2016-02-15 19:44:21 +01:00
Gina Häußge 0a3dc4b354 Fixed a bug that prevented the "Upload to SD" button from working
Introduced with the bug fix for #1196

Closes #1224
2016-02-15 09:58:04 +01:00
Gina Häußge fe134e7986 Added back the "test without plugins" clause to the bug reporting guide 2016-02-12 12:10:19 +01:00
Gina Häußge b5f40cfd69 Always read all available lines from stdout and stderr
Should produce faster output.
2016-02-11 10:36:19 +01:00
Gina Häußge 3fb9248d2a More timelapse unit tests 2016-02-10 16:44:46 +01:00
Gina Häußge 3dd0ace076 maintenance branch is now 1.2.10.dev 2016-02-10 16:44:18 +01:00
Gina Häußge abe68adac8 Preparing release of 1.2.9 2016-02-10 14:47:18 +01:00
Gina Häußge 99c65b8cf4 Unit test for unrendered timelapse cleanup 2016-02-10 14:40:10 +01:00
Gina Häußge 742818c2ca Delete unrendered legacy timelapses when encountering them 2016-02-10 14:34:33 +01:00
Gina Häußge d4072a3afd Updated translation files & german translation 2016-02-10 12:43:13 +01:00
Gina Häußge 92c65cb21c Added info about branches and versioning to contribution guide 2016-02-10 11:09:31 +01:00
Gina Häußge d20a9f64a2 Updated AUTHORS.md
(cherry picked from commit ab52e28)
2016-02-10 10:16:04 +01:00
geoporalis ed82488c5b typo fixed
(cherry picked from commit 4e91284)
2016-02-10 10:15:41 +01:00
Gina Häußge 5955d3d32e Added estimates total time from gcode viewer to gcode viewer tab
Implements request in #1204
2016-02-10 09:58:40 +01:00
Gina Häußge 682c3dd8e3 Limit file upload dialogs to supported file extensions
See #1196
2016-02-09 18:03:04 +01:00
Gina Häußge 56f2dc9d8e Make improve/... branches behave as maintenance branches
Felt too wrong to call improvements fixes all the time.
2016-02-09 17:55:29 +01:00
Gina Häußge 71941f337d Include cursor control characters in CSI ANSI regex pattern 2016-02-09 14:48:30 +01:00
Gina Häußge b347e96748 Pip 8 outputs ANSI codes which we don't want in our output 2016-02-09 12:54:59 +01:00
Gina Häußge 8069d08d3b Do not hiccup on manually sent M28 commands
In case of trying to switch to state printing with no selected file that
scenario is now caught by setting an internal manualStreaming flag.
That will stop the M105 polling until M29 is sent (through whatever
means).

Note that printing is not disabled... this is merely for testing stuff and
not encouraged to be used for actually streaming files to the printer,
use the built-in functionality for that!
2016-02-09 11:32:56 +01:00
Gina Häußge 4b7552e56e Fixed file manager unit tests, added tests for print recovery functionality 2016-02-09 10:45:54 +01:00
Gina Häußge c4a1ed2590 Merge branch 'maintenance' into fix/persistPrintRecoveryData 2016-02-08 19:28:40 +01:00
Gina Häußge e443c7df2f Use path in storage instead of full path for print recovery 2016-02-08 16:44:37 +01:00
Gina Häußge b9372d7300 Fixed wrongly positioned parenthesis
Caused an internal server error if / was requested with a different default language than
english that was not available in the i18n bundles.
2016-02-08 13:04:02 +01:00
Gina Häußge 9e8b5312d5 Persist print recovery data on print failures 2016-02-08 12:47:13 +01:00
Gina Häußge f79d496c7c Revert "Only trigger drag overlay for files, not texts"
This reverts commit 1e429606e1.

Commit used functionality that currently is only available in
Chrome and maybe Opera. No alternative solution could be found
that works reliably across browsers.
2016-02-03 11:43:55 +01:00
Gina Häußge 73a587b3e4 Added missing entries to AUTHORS.md 2016-02-03 09:04:27 +01:00
Gina Häußge fac4aad05f Merge branch 'master' of https://github.com/2ndalpha/OctoPrint into pr/2ndalpha/master 2016-02-03 08:58:59 +01:00
Gina Häußge c53c263805 Merge branch 'fix/includeReleasenotesInUpdateNotifications' into maintenance
Conflicts:
	src/octoprint/plugins/softwareupdate/__init__.py
	src/octoprint/static/css/octoprint.css
2016-02-02 20:23:02 +01:00
Gina Häußge 4e31ccf4c5 Big overhaul of timelapse handling
* persistent notification on ongoing timelapse render job (#485)
  * non-colliding timelapse snapshot name generation to not delete
     existing snapshots when new print starts and timelapse has not
     yet been rendered, also only delete snapshots if timelapse rendered (#318)
  * list of unrendered timelapses, with option to delete files
    or to render timelapse
2016-02-02 18:03:56 +01:00
Siim Raud c4e2a8982f Fixed formating 2016-02-02 00:40:52 +02:00
Siim Raud 42dafd7565 Fixed parsing of "retraction_combing" 2016-02-02 00:35:52 +02:00
Gina Häußge 6ce82ceb00 Merge branch 'fix/optionToIgnoreFirmwareErrors' into maintenance 2016-02-01 18:02:29 +01:00
Gina Häußge 6583691e85 Added setting to only cancel ongoing print on firmware error
Also added error popup in such a case so the error will be known even
if the terminal tab scrolled past it.
2016-02-01 18:02:21 +01:00
Gina Häußge 2f44f10eb0 Merge branch 'fix/knockout3.4' into maintenance 2016-02-01 16:56:13 +01:00
Gina Häußge 0e817d43cc Added option to ignore any errors reported by the firmware
Use this carefully. An error reported by your firmware usually hints
at something being off about your printer (e.g. thermistor troubles)
or the firmware not being fully compatible to OctoPrint since
it doesn't recognize a lot of commands.

If you print with this option enabled, it will still fail if you firmware goes
into lockdown, but now it will keep trying to send data to your printer.

That might cause issues. So best not use that option, only if you absolutely
have no other way to get some misbehaving printer to work with
OctoPrint.
2016-02-01 16:55:13 +01:00
Gina Häußge 7f1394a8d6 Migrated ko.computed to ko.pureComputed where it made sense 2016-01-27 17:33:03 +01:00
Gina Häußge caaf1d229c Updated Knockout dependency to version 3.4.0
Closes #939
2016-01-27 17:32:40 +01:00
Gina Häußge 36ae6dd6b9 Added adaptive rate limiting to client
The client now tries to detect if it's fast enough to process the
state updates usually send every 500ms, and if not notifies the
server to throttle the rate (e.g. to 1/1s, 1/1.5s etc).

Additionally, since the terminal tab of the client turned out to
be quite CPU intense when line number calculation, filtering etc
is enabled, the terminal tab now also falls back into a bit less
fancy mode if it detects its being processed too slow and optionally
even disables logging completely during printing (where a lot
of log messages need to be processed in a minimum amount of
time).

That way the UI should stay responsive even on very low powered
clients (e.g. chromium on a Pi), while printing.
2016-01-27 12:04:17 +01:00
Gina Häußge bcd7bb4d20 Don't enable Print button if no job is selected
Fixes #1007
2016-01-25 16:28:52 +01:00
Gina Häußge 8151e617cc Merge branch 'maintenance' of github.com:foosel/OctoPrint into maintenance 2016-01-25 14:41:52 +01:00
Gina Häußge 1e429606e1 Only trigger drag overlay for files, not texts 2016-01-25 14:39:48 +01:00
Gina Häußge 7fbfaadc21 Do not read no return value as "False" return value for onServerDisconnect 2016-01-25 13:51:46 +01:00
Gina Häußge 814355e281 Do not show drag-n-drop overlay if server is offline
Fixes #1196
2016-01-25 13:51:10 +01:00
Gina Häußge c720cc3a4a Added note to not misuse (feature) requests for support questions 2016-01-21 10:58:00 +01:00
Gina Häußge 660de61997 Merge remote-tracking branch 'origin/maintenance' into maintenance 2016-01-19 11:51:15 +01:00
Gina Häußge f4b3206d49 Disable the settings dialog's save button while sending or receiving 2016-01-19 11:19:51 +01:00
Gina Häußge 4abfa6c3b3 Updated installation instructions 2016-01-13 17:12:41 +01:00
Gina Häußge 2a059cf0cb Reset scroll position and selected tab in settings dialog
Also added means to open settings dialog navigating directly to a specific tab
2016-01-12 13:30:10 +01:00
Gina Häußge 7743372ee4 Slugify file names on local storage
Just stripping anything non-ASCII leads to errors with UTF-8 only
filenames.

Closes #1181
2016-01-11 16:42:05 +01:00
Gina Häußge 59027d349f Added button to refresh file list
Also added tooltips for all three file list buttons
2016-01-11 15:41:38 +01:00
Gina Häußge 9fd8b09e34 Fixed custom control M114 example to also match negative coordinates 2016-01-05 11:48:55 +01:00
Gina Häußge 450e24bbc2 Added missing AUTHORS.md entry 2016-01-05 11:42:38 +01:00
Gina Häußge c020c7afe0 Merge branch 'master' of https://github.com/richjoyce/OctoPrint into pr/richjoyce/settings_remove_fix 2016-01-05 11:40:18 +01:00
Richard Joyce 0d7965ebf1 Fix missing kwargs in PluginSettings remove 2016-01-04 09:25:58 -08:00
Paul de Vries 34ceb93509 Initialize loginUser and loginPass with an empty string
Clear loginUser and loginPass after a successful login (e.g. the user made a typo)
2016-01-03 22:02:49 +01:00
Gina Häußge c120261e2b Increased backend fail counter for intermediary page
Also made sure that baseURL always ends in a /
2015-12-18 17:39:30 +01:00
Gina Häußge f0acacec6a Intermediary page needs to remove fragments for baseUrl
Otherwise image pinging won't work properly.
2015-12-18 14:30:53 +01:00
Gina Häußge 9fbe130169 Merge branch 'fix/aclFirstRun' into maintenance 2015-12-17 13:19:26 +01:00
Gina Häußge b96d1b51e0 Disabled ACL is now tracked through enabled flag on UserManager
That allows us to properly enable and disable it at runtime (during first run).
2015-12-17 13:08:45 +01:00
Gina Häußge 570c66b6f3 Trigger command processing on unknown commands
We suffer from the same problem as commands being suppressed in the
send queue here. If a non-GCODE-command we send to the printer
produces no output, our _monitor loop will wait until the next response
produced by another command. Which we won't send though since
we are stuck waiting in the _monitor loop waiting for a response. Hence
we need to manually trigger further command processing from the
send loop here in order to ensure things keep going.
2015-12-17 10:44:43 +01:00
Salandora ccd2ddc056 Fixed a bug with access control during first run
Requests against restricted resources could fail even though the
first run wizard had been completed successfully.
2015-12-16 11:59:45 +01:00
Salandora 54f24b43f0 If no system actions were configured during rendering of the page, no system menu was added to the template.
hat caused system actions added during runtime (e.g. by API) to not show up until a re-rendering of the page.
2015-12-16 11:35:25 +01:00
Gina Häußge eae68f04ca Use PEP440 compatible version compatibility check
Also make sure that if we have a pkg_resources version that returns
tuples we not only remove any intermediary version parts if the base
version is requested, but we also append "*final" to the tuple afterwards,
otherwise the compatibility check will fail.
2015-12-14 14:14:44 +01:00
Gina Häußge 7fcd04ae61 Also use pre-calculated revision information instead of fetching anew 2015-12-14 10:16:29 +01:00
Gina Häußge 1a4920fc36 Display remote version in update message, not local one... 2015-12-10 17:12:02 +01:00
Gina Häußge 8149a3b4a8 Include release notes in update notification
... and confirmation dialog and settings dialog.

github_release fetches release notes link from github. Check configurations
can always set individual release notes links via the new `release_notes`
property. The URL also supports placeholders `{octoprint_version}`,
`{target_version}` and `{target_name}`. A custom release note URL
hence could be configured by a plugin via

    def get_update_information(self):
        return dict(
            myplugin=dict(
                [...]
                release_notes="https://me.github.io/MyPlugin/my/custom/releasenotes.html#version_{target_version}"
                [...]
            )
        )

and if a new release "1.3.4" was now to be released would be displayed to the user as

    https://me.github.io/MyPlugin/my/custom/releasenotes.html#version_1.3.4

The same of course is possible via config.yaml:

    plugins:
      softwareupdate:
        checks:
          myplugin:
            release_notes: 'https://me.github.io/MyPlugin/my/custom/releasenotes.html#version_{target_version}'
2015-12-10 14:41:46 +01:00
Salandora e8bd29ef99 Replace get_versions() calls with octoprint.server.VERSION, to get some time improvment 2015-12-09 10:29:24 +01:00
Gina Häußge 8a7d234571 Merge branch 'fix/commTimeoutOnSupressedScriptCommands' into maintenance 2015-12-08 14:24:47 +01:00
Gina Häußge c5c5383e0e Fixed clean up of preemptive cache entries 2015-12-08 14:23:40 +01:00
Gina Häußge b4d25db9c8 Merge branch 'fix/betterUiCaching' into maintenance 2015-12-08 13:45:37 +01:00
Gina Häußge ef876cfd35 Fire up intermediary server on host and port
That way people will not see connection failed messages while the server is
still starting up.

Served intermediary page als "pings" an image on the backend to detect if
a) the backend is still responding at all ("intermediary.gif") and b) whether the
server has fully started up ("online.gif").

If the backend stops responding for 5s, a message is output that tells the user
that something went really wrong and to please check the log file.

Once the server becomes online, the intermediary page reloads/switches to the
actual UI.
2015-12-08 13:28:12 +01:00
Gina Häußge 547dcdd725 maintenance branch is now 1.2.9.dev 2015-12-07 14:58:19 +01:00
Gina Häußge dedadbc9ac Added another little fix to the change log 2015-12-07 13:23:58 +01:00
Gina Häußge cda399f11a Merge branch 'fix/ignoreCannotOpenSubdir' into maintenance 2015-12-07 13:21:57 +01:00
Gina Häußge ec42c45204 Explained a bit better how the update bug in 1.2.7 actually manifests 2015-12-07 12:56:54 +01:00
Gina Häußge c98d3d1655 Also assume presence of heated bed in "add profile" dialog 2015-12-07 11:53:41 +01:00
Gina Häußge 5e96bd8b6a Fix: "Server Offline" should always win against "Please reload"
Nothing to reload if the server is offline, so show the offline message above
the reload one.
2015-12-07 11:51:20 +01:00
Gina Häußge 2b4a985d85 Assume the presence of a heated bed in the default profile 2015-12-07 11:04:09 +01:00
Gina Häußge 56a51a3800 Let's try releasing 1.2.8 2015-12-07 10:19:57 +01:00
Gina Häußge 0982c8cc62 Ignore the "cannot (open|error) subdir" errors from Marlin 2015-12-07 09:26:25 +01:00
Mark Bastiaans 682e78c256 Added name to authors
(cherry picked from commit 406fe75)
2015-12-04 17:37:27 +01:00
Mark Bastiaans d90a9e7fc4 Fixed checks with os.path.realpath() for systems with symlinked paths
(cherry picked from commit b7c9949)
2015-12-04 17:36:49 +01:00
Gina Häußge 9d6b6cf103 Going to release 1.2.8 after the weekend 2015-12-03 12:02:36 +01:00
Gina Häußge bad88da2fe Fixed a scrolling issue on the terminal tab 2015-12-02 18:12:08 +01:00
Gina Häußge 090671a044 Merge branch 'maintenance' into fix/commTimeoutOnSupressedScriptCommands 2015-12-02 17:26:25 +01:00
Gina Häußge 1e9ea8e85e Updated Changelog again 2015-12-02 17:12:17 +01:00
Gina Häußge c5bc000b56 Increased timeout for waiting for restart after update
20sec is too little.
2015-12-02 17:12:04 +01:00
Gina Häußge 42d288c0e2 Updatefix 1.2.7 plugin needs restart after all 2015-12-02 16:34:57 +01:00
Gina Häußge 935c1da30f Updated Changelog for 1.2.8 again
Now includes note about updatefix plugin and changelog
entry about fixed softwareupdate issue.
2015-12-02 14:06:49 +01:00
Gina Häußge c0774d0dd8 Fix: Do not stall comm when a command is supressed while printing 2015-12-02 11:08:51 +01:00
Gina Häußge 612005c4f6 Fixed a bug preventing OctoPrint from updating via github releases
Noticed while testing update path from 1.2.7 to 1.2.8

*bangs her head against a wall*
2015-12-02 09:25:15 +01:00
Gina Häußge ee1f9029d1 Preparing release of version 1.2.8 2015-12-01 13:18:11 +01:00
Gina Häußge 1d8cf86215 Updated translation source files and german translation 2015-12-01 11:42:57 +01:00
Gina Häußge fbc0b8af91 Merge branch 'maintenance' into fix/betterUiCaching 2015-12-01 10:40:57 +01:00
Gina Häußge b8283b2499 And of course now I spotted another left-over... 2015-12-01 10:29:11 +01:00
Gina Häußge da0f1fa3c8 Some more small changes and updated the flow chart 2015-12-01 10:22:23 +01:00
Gina Häußge 0d18ca421b Typos are my nemesis 2015-11-30 19:46:28 +01:00
Gina Häußge 48dd2657e9 Some more rewording and fixing of typos 2015-11-30 19:40:31 +01:00
Gina Häußge 62f2d11f8b Major overhaul of CONTRIBUTING.md
Now includes all bug reporting related information
as well plus a little flow chart regarding ticket creation.

Also reworded large sections.
2015-11-30 19:31:33 +01:00
Gina Häußge 93bbedae86 Only process bed temps & commands if printer profile has heated bed
Solves #1125
2015-11-30 11:11:35 +01:00
Gina Häußge 40fe74ef45 Cut off terminal after 3000 lines
When autoscroll was disabled, terminal could run on endlessly, eating
memory until the browser crashes. Now a hard upper limit ensures
that not more than 3000 lines are ever stored in the terminal. If autoscroll
is disabled and the limit is reached, no more log lines will be added. That
ensures that the log will not scroll and the current log excerpt will stay put.
2015-11-27 15:05:55 +01:00
Gina Häußge 043b213a96 Move event processing for gcodefiles into corresponding viewmodel
Also fixes a javascript error (gcodeFileViewModel unknown)
2015-11-27 11:31:17 +01:00
Gina Häußge 63d095ab00 Refactored implementation of get_all_template_paths 2015-11-26 19:48:44 +01:00
Gina Häußge 6db57122b4 Catch and log all exceptions that might be raised in the watchdog
Solves #1120
2015-11-26 16:07:29 +01:00
Gina Häußge c595d02f22 reload(true) shouldn't be necessary any more
UI + assets should actually have ETag and LastModified headers and proper
IfMatch handling on the server side and hence the server should do the
right thing on its own.
2015-11-26 14:15:06 +01:00
Gina Häußge 2e23cd39a4 Added ETag and LastModified headers + processing to UI index
That should improve performance tremendously.

Both ETag and LastModified depend on all files the template rendering
depends on. If any of the depended on files changes, both values will
change as well. That allows us to track whether our cached copy is
still current (and force a refresh if not) and also process IfMatch request
headers and reply with a 304 directly so that we do not even have to
transfer the data if nothing changed and the browser still has it.
2015-11-26 13:32:32 +01:00
Gina Häußge 3de4f91f50 Decoupled decorator from PreemptiveCache class
Coupling it led to problems (naturally) when there was no
PreemptiveCache instance available yet.
2015-11-24 18:41:53 +01:00
Gina Häußge 6473937b75 Refactore preemptive flask cache into a proper class
Also now tracks timestamps of last access to a preemptively cached
resource and cleans up stuff that hasn't been accessed in a while (7 days
by default)
2015-11-24 14:37:30 +01:00
Gina Häußge fab5fc4899 Added preemptive caching of / and /i18n/<locale>/messages.js
Introduced a @preemptively_cached decorator that for decorated views
persists the provided data in ~/.octoprint/data/preemptive_flask_cache.yaml
in a list indexed by the view's path if the data is not yet part of the list.

During initialization the server will iterate over the persisted paths and data
and for each persisted path and entry in the list initialize a temporary WSGI
environment based on the data (which is interpretated as keyword arguments
to werkzeug's EnvironmentBuilder) which will then be used to call the view
function in the correct context.

The current implementation for / and /i18n/<locale>/messages.js utilizes
that decorator to allow preemptive caching of those views (/ being probably
the most expensive one in the whole core application) utilizing request base URLs
(internal access, external access, reverse proxy with prefix url etc) that had been
encountered in the past.

Through the new config setting server.preemptiveCaching.exceptions it is
possible to define a set of base URLs to never cache. Preemptive caching can
be globally disabled by setting devel.cache.preemptive to false.
2015-11-23 17:35:25 +01:00
Gina Häußge d0eca800fb Make the current request's baseurl to a part of the cache key
This way we create separate caches for URLs access via different schemes/prefixes/etc.
Otherwise our generated page might not work when accessing OctoPrint from external
after accessing it from internal once.
2015-11-23 12:17:57 +01:00
Gina Häußge a6c24e174d Fixed version reporting on detached HEADs
HEAD "branch" also should disable usage of lookup table.
2015-11-20 13:54:09 +01:00
Gina Häußge a52a5ca338 GCodeViewer: Even if off screen render 100% view on PrintDone event
Otherwise the GCODE Viewer will get stuck "half way through" if
"sync with progress" is enabled but the tab/browser tab loses focus
during printing and only regains it after the print has finished.
2015-11-20 11:40:06 +01:00
Gina Häußge acc85127c5 Track browser tab visibility, only activate webcam/gcode viewer when visible
This might help with #1065 if indeed is related to background tab suspending behaviours in
browsers, but is a completely blind guess at this point since I still have not been able to
reproduce that issue myself.

Backported.

(cherry picked from commit 720cdad)
2015-11-20 11:06:25 +01:00
Gina Häußge 454f16a7c3 Fixed a broken unit test (pro tip: test new tests before committing...) 2015-11-20 10:12:15 +01:00
Gina Häußge a731f748d9 Moved existing hidden file checks to utilize octoprint.util.is_hidden_path 2015-11-20 10:02:06 +01:00
Gina Häußge 9a7bddd530 Also don't include hidden files in other templates 2015-11-19 19:03:04 +01:00
Gina Häußge 83f66e133e Do not include hidden files in listed gcode scripts 2015-11-19 18:58:56 +01:00
Gina Häußge ab97abf13e Some fixes and unit tests for octoprint.util.atomic_write, .bom_aware_open and .tempdir
(cherry picked from commit 4fcb853)
2015-11-19 15:15:35 +01:00
Gina Häußge 7820c17d08 [Cura] Make plugin a bit more verbose regarding usage & setup 2015-11-19 11:42:12 +01:00
Salandora 9ed79adb8d Fix SD Support deactivated bug and added "unknown command" to the whitelist of errors 2015-11-17 19:32:34 +01:00
Gina Häußge b98348de02 Cache rendered page and translation files indefinitely 2015-11-06 11:46:12 +01:00
Gina Häußge a5094d403a Merge branch 'maintenance' of github.com:foosel/OctoPrint into maintenance 2015-11-05 17:58:51 +01:00
Gina Häußge 6b0dee26e5 Interpret M25 as a pause when not printing from SD too 2015-11-05 17:33:27 +01:00
Gina Häußge a44eb43f0f Added @kevingelion to AUTHORS.md 2015-10-30 16:53:17 +01:00
Gina Häußge b6a5cb47a1 Merge branch 'km/hotfix-flot-yaxis-cutoff' of https://github.com/kevingelion/OctoPrint into pr/kevingelion/km/hotfix-flot-yaxis-cutoff 2015-10-30 16:49:35 +01:00
Kevin Murphy 65efcec008 Change instance of row to row-fluid to avoid conflict with responsive CSS 2015-10-30 11:18:44 -04:00
Andres 37730616c1 Fixed wrong urls
(cherry picked from commit 119f3ba)
2015-10-29 09:41:17 +01:00
Gina Häußge a53195d2a0 Added Unit Tests for BlueprintPlugin mixin
(cherry picked from commit 53a62ab)
2015-10-26 09:15:54 +01:00
Marcel Hellwig 084fd8d433 add errorhandler decorator to blueprintplugin
This will allow you to add an errorhandler for your blueprint easily.
(cherry picked from commit b6053c1)
2015-10-26 09:12:17 +01:00
Gina Häußge 33306b6787 Fixed an earlier merge error 2015-10-26 09:11:44 +01:00
Gina Häußge b4cb0dec87 Unit tests and some fixes for improved plugin settings processing
(cherry picked from commit bcd0f34)
2015-10-26 08:53:08 +01:00
Gina Häußge 063251fe03 Use get_all_data instead of get([], ...) construct
(cherry picked from commit ffcbdba)
2015-10-26 08:52:58 +01:00
Gina Häußge 9b3ef8b693 Fix: Persist all data different from default, not just current changes
We need to merge with our current data since we only might get partial data
from our caller.
(cherry picked from commit 7ea1578)
2015-10-26 08:52:46 +01:00
Gina Häußge a5ce071939 Make sure only difference to default config is persisted for plugins
This change should make sure that only those settings actually make it into config.yaml
per plugin that do differ from the default settings. Up until now the full dictionary as received
e.g. from the REST API was saved, regardless whether it contained (only) default values or not.
That led to a lot of "null" entries in the config.yaml file, which for one looked horrible and also
led to problems when a plugin actually wanted to change its default values.

With this commit, two things are done. One, upon saving a configuration the default
implementation of the save routine in the settings plugin now first diffs the new data against
the defaults and only saves what is different. Two, upon server startup a cleanup method is
now called on settings plugins whose default implementation fetches the current data stored
in config.yaml, diffs that against the defaults and only writes back the diff result. If that is empty
the entry is completely deleted from config.yaml.
(cherry picked from commit d70fe32)
2015-10-26 08:52:05 +01:00
Gina Häußge e8fa2e44e0 Travis: Let's see if we can't get the git depth upped a bit
(cherry picked from commit 5fc8e22)
2015-10-23 13:36:39 +02:00
Gina Häußge e223341ece Travis: Migrate from legacy infrastructure
http://docs.travis-ci.com/user/migrating-from-legacy/
(cherry picked from commit bec0013)
2015-10-23 13:36:33 +02:00
Gina Häußge 5c8d9007f6 Fixed some missing exception capturing
(cherry picked from commit 2f86a6a)
2015-10-23 13:36:27 +02:00
Gina Häußge 91163dc4f4 Fixed existing doctests, added some new ones, enabled doctests in nosetests
(cherry picked from commit 02c3bf8)
2015-10-23 13:36:18 +02:00
Gina Häußge 2a8e084b51 Added a missing comma that broke the build... 2015-10-23 13:27:24 +02:00
Gina Häußge ce00a069fa Added conversion for README.md to rst for PyPi 2015-10-23 12:08:36 +02:00
Gina Häußge bdadab6993 We want pep440-post by default 2015-10-23 10:07:15 +02:00
Gina Häußge 05d6cac67a Define where our README is located so that it gets rendered correctly on pypi 2015-10-23 10:02:05 +02:00
Gina Häußge 528192b3c0 Fixed a merge error while migrating versioneer update 2015-10-23 09:55:14 +02:00
Gina Häußge 729d23b2c0 Fixed versioneer lookup file again
Runaway regex ;)
(cherry picked from commit 78277ac)
2015-10-23 09:54:46 +02:00
Koen Kooi 2e566c5ee1 versioneer lookup: add support for detached checkouts
When doing 'git checkout <rev>' or 'git checkout <tag>' there will be no
branch info:

	$ git branch
	* (detached from 96fc70b)

After whitelisting '\(detached.*' we get:

	$ python setup.py version
	running version
	got version from git {'version': '1.2.5-1-gfd73e02', 'branch': 'HEAD',
	'full': 'fd73e02f4fa9f286407ad688feeeee3ebaffea60'}
	Version is currently: 1.2.5-1-gfd73e02

The '-1-gfd73e02' is this commit on top of the 1.2.5 tag.

While detached checkouts should be discouraged some buildsystems (e.g.
OpenEmbedded) have no real way to avoid it, which is what this patch
fixes. Actual people doing a checkout should use a branch.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
(cherry picked from commit 987e637)
2015-10-23 09:54:21 +02:00
Gina Häußge e875d042a7 Refreshed versioneer again
(cherry picked from commit 7cd0adb)
2015-10-23 09:53:25 +02:00
Gina Häußge f05f850175 Switched to new version of versioneer
Versions should now be PEP440 compatible.
(cherry picked from commit 711810d)
2015-10-23 09:53:13 +02:00
Gina Häußge 9ce9af28c3 Updating versioneer & switch to PEP440 versioning
(cherry picked from commit 137db0b)
2015-10-23 09:51:50 +02:00
Gina Häußge 57bf457d97 Fix: current filename in job data should never be prefixed with /
That was a tiny detail missing in 8bef18c2a8 that
caused issues with detecting which file was currently selected on the printer's
SD card (for "do not delete that" checks on the API).
2015-10-22 13:42:57 +02:00
Gina Häußge adf39cdf21 maintenance branch is now 1.2.8-dev 2015-10-20 14:54:16 +02:00
Gina Häußge 6c622f7c43 Fixed indentation of change log 2015-10-20 12:24:23 +02:00
Gina Häußge d34790e74e Unit tests for octoprint.util.RepeatedTimer
(cherry picked from commit 7362067)
2015-10-20 12:07:31 +02:00
Gina Häußge aa5099340e Two new callbacks for RepeatedTimer when cancelled or condition untrue
(cherry picked from commit 9b9ecfe)
2015-10-20 12:07:24 +02:00
Gina Häußge 693633bd1d RepeatedTimer now supports callback when timer stops
(cherry picked from commit 3c5a976)
2015-10-20 12:05:12 +02:00
Gina Häußge 758062133c Updated changelog for 1.2.7 2015-10-20 11:55:34 +02:00
Gina Häußge c55fea666d Updated required versions of psutil and netifaces
Also see #1090
2015-10-19 09:33:48 +02:00
Gina Häußge c932e496fa SWU: Show reload dialog after update
The notification and the (forced) dialog afterwards were way too
redundant.
2015-10-08 17:08:36 +02:00
Gina Häußge bbbdb3dde6 Note that z-based timelapses don't work when printing from SD 2015-10-08 10:22:09 +02:00
Gina Häußge b9460b4890 Merge branch 'fix/uiEscaping' into maintenance 2015-10-08 09:52:08 +02:00
Gina Häußge 947f4c89cc Fixed a win-only issue causing the gcode view not to reload on file modification 2015-10-07 18:52:18 +02:00
Gina Häußge 5f982ec6c8 Merge branch 'fix/atomicWrites' into maintenance 2015-10-07 17:53:43 +02:00
Gina Häußge dcf2e51b21 Moved filemanager method tests to test_filemanager.py 2015-10-07 17:50:08 +02:00
Gina Häußge 85e6ae8e82 Fixed a unit test that broke by switching to atomic_write 2015-10-07 17:45:07 +02:00
Gina Häußge 859ea0d0e4 Added mime type guessing for downloads to Tornado 2015-10-07 17:19:18 +02:00
Gina Häußge 9cf21aa036 Also set caching headers for downloads to discourage client-side caching
At least if necessary (added new boolean flag to the constructor of
LargeResponseHandler for that). While at it also rename UrlForwardHandler
to UrlProxyHandler (it does not forward, it proxies) and make it aware of
ETag and Expires headers.
2015-10-07 12:25:25 +02:00
Gina Häußge 637adc3095 Fix: LargeResponseHandler was wrongly caching ETag value
ETag values returned with download responses were cached internally within
the LargeResponseHandler class, with the file's path as key. That let to
problems once the content changed and hence the ETag value actually
becoming invalid. Since the path however stayed the same, the same ETag
value for the modified file was assumed and a 304 Not Modified response
was generated.

This patch changes the behaviour of LargeResponseHandler to use
the last modified date of the file as the ETag value and alternatively allowing
an etag generator function to be provided as constructor parameter as well
to use for calculating (or disabling) the ETag header dependant on the
situation.
2015-10-06 18:19:53 +02:00
Gina Häußge 548f976d35 Some more defensive escaping for various settings in the UI
Entering HTML fragments into the webcam stream URL could cause
issues, anything injected via Jinja should now be escaped properly.
2015-10-06 13:41:54 +02:00
Gina Häußge 45c92cb1f4 Fix: Open GCODE files als utf-8, replacing encoding errors
Also detect files that contain a BOM and strip it.
Internal handling of GCODE file contents switched to unicode.

 Should take care of #1077
2015-10-05 19:43:40 +02:00
Gina Häußge f83d5aa89f Fix: Use atomic writes for all save processes
That includes uploaded files, profiles, caching files, settings and user
directories.
2015-10-05 18:07:43 +02:00
Gina Häußge abf073340f Fixed reporting of duration needed for capturing timelapse postroll
Needs to be calculated differently for time based and z-triggered. Capture interval
was not taken properly into account.
(cherry picked from commit 9284ff4)
2015-10-02 18:22:44 +02:00
Gina Häußge 918ffa2557 Refactored timelapse core
Capturing is now queue based, rendering will not start until all images have been captured,
and timed postroll does not depend on system time anymore.

Also refactored some of the names to be python naming compliant while at it.
(cherry picked from commit 4f5dc70)
2015-10-02 18:18:31 +02:00
Gina Häußge 5cc8ec5cc3 Better wording for plugin system startup & sorted plugin list of ALL plugins 2015-09-30 16:00:32 +02:00
Gina Häußge fce7b40b51 pip: Use string representation of version for display in UI 2015-09-28 20:20:56 +02:00
Gina Häußge 1178fe9e95 Support sudo for installing plugins, but warn about it 2015-09-28 19:53:30 +02:00
Gina Häußge 2f24e73fcb Merge branch 'fix/logsDocsBug' into maintenance 2015-09-28 13:08:57 +02:00
Gina Häußge 9ff5c36370 Fixed a documentation bug 2015-09-28 13:08:35 +02:00
Gina Häußge 1b4ea75466 Fix: Don't have file upload widgets listen to drop events by default
That way they won't be triggered by gcode uploads when all they are interested in
are uploads via a single file input.
2015-09-28 12:55:32 +02:00
Gina Häußge b4b5689bc4 Fix: Correctly handle unset Content-Type header for command requests 2015-09-22 15:23:50 +02:00
Gina Häußge fd4271a962 PipCaller: Added back missing member variable 2015-09-22 11:39:45 +02:00
Gina Häußge 65bc28a03e PMGR: Added configuration dialog and info re used pip binary & version 2015-09-22 11:36:57 +02:00
Gina Häußge c26515c13d PipCaller: Allow update of used pip command 2015-09-22 11:35:47 +02:00
Gina Häußge 25a4d4b79b SWU: Track check origins, ignore if from unavailable plugin
There was a problem with software update checks configurations stored in
config.yaml for which the providing plugin was then removed, since those
check definitions then lacked their default values to be merged on whatever
was stored in config.yaml, causing incomplete check configurations as a
consequence over which the plugin tripped.

This patch fixes that in that it tracks which check config keys are provided
by plugins and only returns those as the active check configurations that
belong to plugins that are still in the system.

TODO: This is only half of the solution. Check configurations of plugins
that are being uninstalled should be removed from the config if the
user decides to remove any settings by the plugin too. We need some
adjustments in the lifecycle tracking in order to make this possible
however, so for now this must suffice to at least prevent any errors from
occuring when incomplete configs are encountered.
(cherry picked from commit 8af8b8f)
2015-09-21 16:46:44 +02:00
Gina Häußge 43ca4d8252 SWU: Do not overwrite check information again
Current version information of OctoPrint from a check definition
could be overwritten for checks under certain circumstances.
2015-09-21 16:42:11 +02:00
Gina Häußge b56ba6589c Ignore update definitions that are lacking the type
Caused a KeyError so far, update definitions that are broken like that
will now just be ignored instead.

Closes #1057
(cherry picked from commit 2efc5c4)
2015-09-11 08:36:02 +02:00
Gina Häußge 5c9b507cb7 User user id, not user name, for all user operations
(cherry picked from commit 7021b9f)
2015-09-11 08:35:08 +02:00
Gina Häußge cd7ac032f4 Fixed an issue that cause user sessions to not be properly associated
Sessions could get duplicated, wrongly saved etc. The reason was not
persisting the actual user object to the internal session map (but the
LocalProxy instead). That could lead to multiple sessions being
created for one login, or the session user being set to an
anonymous user, or various other odd effects depending on timing.
(cherry picked from commit 8aeac51)
2015-09-11 08:20:16 +02:00
Gina Häußge a2e5fc0c5c maintenance branch is now 1.2.7-dev 2015-09-02 20:18:18 +02:00
Gina Häußge 536bb31965 Forgot the commit link in the changelog 2015-09-02 19:59:49 +02:00
Gina Häußge ef46a49430 Also included #1041 in 1.2.6 2015-09-02 19:55:24 +02:00
Gina Häußge 8e28ddd6a4 Fixed versioneer lookup file again
Runaway regex ;)
(cherry picked from commit 78277ac)
2015-09-02 19:53:18 +02:00
Koen Kooi ab8b0230bd versioneer lookup: add support for detached checkouts
When doing 'git checkout <rev>' or 'git checkout <tag>' there will be no
branch info:

	$ git branch
	* (detached from 96fc70b)

After whitelisting '\(detached.*' we get:

	$ python setup.py version
	running version
	got version from git {'version': '1.2.5-1-gfd73e02', 'branch': 'HEAD',
	'full': 'fd73e02f4fa9f286407ad688feeeee3ebaffea60'}
	Version is currently: 1.2.5-1-gfd73e02

The '-1-gfd73e02' is this commit on top of the 1.2.5 tag.

While detached checkouts should be discouraged some buildsystems (e.g.
OpenEmbedded) have no real way to avoid it, which is what this patch
fixes. Actual people doing a checkout should use a branch.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
(cherry picked from commit 987e637)
2015-09-02 19:51:11 +02:00
Gina Häußge 754ef428a0 Preparing release of 1.2.6 2015-09-02 19:49:49 +02:00
Gina Häußge 455474841e Pinned psutil version to 3.1.1 (and all other dependencies)
Something in the recently released psutil 3.2.0 version causes installations via
python setup.py install to fail that list psutil as requirement.

Pinning to 3.1.1 solves that problem for now.
2015-09-02 19:38:18 +02:00
Gina Häußge ae4e4f22c4 maintenance branch is now 1.2.6-dev 2015-08-31 15:57:11 +02:00
Gina Häußge 96fc70bdb2 Preparing release of 1.2.5 2015-08-31 10:28:52 +02:00
Gina Häußge 8ed0befd62 Fixed bug that made browser crash when trying to log in
Trying to serialize view models or browser events as username/password probably was not the best of ideas ;)
(cherry picked from commit c7fd480)
2015-08-31 09:44:52 +02:00
Gina Häußge 766c0c21d4 Adjusted README
(cherry picked from commit 92c02df)
2015-08-31 09:26:28 +02:00
Salandora 7d50563666 Custom Control fix in less file
(cherry picked from commit 10ad8dd)
2015-08-31 09:26:20 +02:00
Salandora 4011f60ff9 Edge Fix
Thanks @foosel for the Informations

Conflicts:
	src/octoprint/server/views.py
2015-08-28 09:36:47 +02:00
Gina Häußge 37950cb466 Fixing some more merge errors 2015-08-28 08:58:12 +02:00
Gina Häußge 2824b967ff Fixed a merge error 2015-08-28 08:20:20 +02:00
Gina Häußge 7b8bf2cf5c M112 support or the virtual printer
(cherry picked from commit 22a6604)
2015-08-28 08:19:03 +02:00
Gina Häußge 9299cb54a4 Improved M112 handling
Use new synchronized sending method and also make sure that heaters
will get disabled in case M112 is NOT understood by the firmware
before disconnecting. That's about all we can do for now.
(cherry picked from commit 5406b2b)
2015-08-28 08:12:12 +02:00
Gina Häußge b965d4cbde comm: Synchronized write access to line number
New method wraps line sending and incrementing
(cherry picked from commit f8e72c9)
2015-08-28 08:11:56 +02:00
Mark Walker 7d922f3c77 Clean up the comment
(cherry picked from commit f519070)
2015-08-28 08:09:16 +02:00
Mark Walker 7e894d2ac2 ClearableQueue redundant with self.close
Closing the printer connection and then reopening (when the users clicks
connect) will create a new fresh MachineCom object so the queues will
start out empty.  Plus ClearableQueue was even more tied to the Queue
implementation that the current _get/_put overrides.
(cherry picked from commit e7584cd)
2015-08-28 08:09:02 +02:00
Mark Walker 948e20b269 Send M112 to printer immediately
Address #1031 with an immediate send of M112 followed by closing the
serial connection to reset the host state
(cherry picked from commit 3d1d745)
2015-08-28 08:08:26 +02:00
Gina Häußge 0e863ad776 Made diskspace running low a bit more obvious
* Added "total" space to "free" in file list
  * Added configurable space thresholds. If free space is below "warning"
    threshold, exclamation sign will be added to report. If free space is below
    "critical" threshold, report will be styled bold and red.
(cherry picked from commit 097800a)
2015-08-27 17:14:10 +02:00
Gina Häußge 13d7d5f2f6 SWU: Various improvements for better usability
* Allow configuration of checkout folder and version tracking type
    via Plugin Configuration
  * Display message to use if checkout folder is not configured or a
    non-release version is running and version tracking against releases
    is enabled
  * Clear version cache when a change in the check configuration is
    detected
  * Mark check configurations for which an update is not possible with
    a little exclamation mark
(cherry picked from commit 8666a28)
2015-08-26 16:03:11 +02:00
Gina Häußge ac8faf7910 Also provide branch info to UI/on socket
(cherry picked from commit cc8dcef)
2015-08-26 16:02:29 +02:00
Gina Häußge bf049ddee4 Fixed two swapped vars
(cherry picked from commit 14c1069)
2015-08-26 15:56:50 +02:00
Gina Häußge e435d55cb1 Added documentation for server commands
(cherry picked from commit 21350fa)
2015-08-26 15:56:35 +02:00
Gina Häußge 2c50237699 Reordered and tooltipped new server commands
(cherry picked from commit e2e6318)
2015-08-26 15:56:24 +02:00
Gina Häußge 93763a5563 Remove left over observables that are no longer needed
(cherry picked from commit 7986a2f)
2015-08-26 15:56:09 +02:00
Gina Häußge 7a74f5348d Only migrate server commands when not already set
Also migrate for any config version < 4 (incl. None) and make sure
the other migrations may happen on top of that if necessary. Added
some comments to explain necessary migrations.
(cherry picked from commit f1075f6)
2015-08-26 15:55:32 +02:00
Gina Häußge b25c2220d1 Allow deletion of a key from settings that is no longer in defaults
(cherry picked from commit b04da70)
2015-08-26 15:55:14 +02:00
Nicanor Romero Venier 57161dd9c3 Added migration step for new settings.
(cherry picked from commit 1cdd61f)
2015-08-26 15:54:17 +02:00
Nicanor Romero Venier 1343a4a253 Added settings to specify server commands.
Added commands for system shutdown and restart and
for server restart.
(cherry picked from commit dab3285)
2015-08-26 15:53:30 +02:00
Gina Häußge 6de7eabca2 Fixed another merge error 2015-08-24 15:59:49 +02:00
Gina Häußge 2247f30c87 Fixed indentation after a merge error 2015-08-24 15:30:26 +02:00
Gina Häußge ba6a6723a6 Settings dialog for new resend setting
(cherry picked from commit 4525a3a)
2015-08-24 14:59:51 +02:00
Gina Häußge f9a0cb94f7 Moved new resend setting into feature section
That's where all other protocol specific settings are currently located.
Will be migrated at a later date into the printer profile instead (that
makes way more sense).
(cherry picked from commit d0f61e5)
2015-08-24 14:59:44 +02:00
Gina Häußge e689a2c733 Handle Repetier resend repetitions
Repetier might resend the same resend request to make sure it arrives.
This commit makes OctoPrint not react to such a repeated request and
instead ignore up to a configurable amount of repeated requests for
the same (current) line.
(cherry picked from commit 6f83695)
2015-08-24 14:59:11 +02:00
Gina Häußge d07c81f312 Fixed regex groups for GCODE parameters
(cherry picked from commit 168d32e)
2015-08-24 14:56:40 +02:00
Gina Häußge 32f4f8d95b Added warning to UI regarding Z timelapses and spiralized objects
(cherry picked from commit d956773)
2015-08-24 14:56:18 +02:00
Gina Häußge 7f2e0161a8 atomic_write context to save configs first to temp file, then move
Should prevent corruption of files
(cherry picked from commit c6d0290)
2015-08-24 14:56:12 +02:00
Gina Häußge 59993bfca4 Fixed & refactored temperature parsing
T-only lines were not properly parsed. Should now be fixed to
be associated to currently selected extruder. Also added unit
tests for the temperature parsing.

While at it also extracted regexes and added unit tests for command
parsing (gcode & parameters)
(cherry picked from commit f6a259f)
2015-08-24 14:55:42 +02:00
Salandora 0782dda20f Add Repetier's Format Error to exception whitelist
(cherry picked from commit d037379)
2015-08-24 14:54:28 +02:00
Gina Häußge 8c1a79558b Always include timelapse view model in bundled js files
Even if the webcam URLs and the FFMPEG path is not yet configured. Otherwise
setting those URLs and the path will require a restart of OctoPrint to enable properly -
that's overkill.
(cherry picked from commit 1425b20)
2015-08-24 14:52:50 +02:00
Mark Walker 0705a7054c Hint about why timelapse configuration is disabled
while printing.

Fixes #1028
(cherry picked from commit 8496827)
2015-08-24 14:51:55 +02:00
Gina Häußge 54bd7766b9 SWU: Don't use display versions for "current" in github_commit configs
(cherry picked from commit 58c6abc)
2015-08-24 14:51:25 +02:00
Gina Häußge ed215fc5fa FileMgr: Only remove callback if it exists.
(cherry picked from commit 4a49948)
2015-08-24 14:45:14 +02:00
Gina Häußge 5f53b704dd Use connection closing flag only for exception handling
Otherwise we kill the beforePrinterDisconnected gcode script...

See #1021
(cherry picked from commit 2fe956e)
2015-08-24 14:44:56 +02:00
Gina Häußge e8ef0ba8a4 Properly handle serial close on Macs
Readline could still be stuck in a read loop, leading to an exception on Mac
when closing the connection from another thread. This should now be captured
correctly.

Fixes #1021
(cherry picked from commit c829b27)
2015-08-24 14:44:31 +02:00
Salandora 49f62bc655 Fix positioning of ContextMenu
(cherry picked from commit 2bf5624)
2015-08-24 14:40:52 +02:00
Salandora 0ff43def3a Fix sorting of templates
(cherry picked from commit 3866c1a)
2015-08-14 09:01:02 +02:00
Gina Häußge cc14b77487 Use connection closing flag only for exception handling
Otherwise we kill the beforePrinterDisconnected gcode script...

See #1021
(cherry picked from commit 2fe956e)
2015-08-14 09:00:40 +02:00
Gina Häußge 7f10c317f1 Properly handle serial close on Macs
Readline could still be stuck in a read loop, leading to an exception on Mac
when closing the connection from another thread. This should now be captured
correctly.

Fixes #1021
(cherry picked from commit c829b27)
2015-08-14 09:00:19 +02:00
Gina Häußge ba1f8c58b4 Log exception on error while reading from serial
(cherry picked from commit ac3409a)
2015-08-14 08:55:29 +02:00
Gina Häußge 273bb45741 Fixed broken GCODE viewer / concurrent settings requests
The GCODE viewer settings callback was not properly called, hence the
viewer was not initialized properly.

Changed prevention of concurrent settings requests to properly handle
the situation where the registered settings callbacks might be extended
through another callback.
(cherry picked from commit 7d6462b)
2015-08-12 12:31:23 +02:00
Gina Häußge e33f69917f Made webassets folder cleanup win32-proof
If re-creation of the folder fails due to an access error, perform three retries. It might
be caused by the folder being open in the file explorer. Waiting a bit before retrying
seems to do the trick.

See also #1019
(cherry picked from commit a43de42)
2015-08-11 18:14:39 +02:00
Gina Häußge 4b8bdd244e Improved settings dialog behaviour
* Show when settings are saving
  * Show when settings are being retrieved
  * Disable Send/Cancel buttons while settings are saving
  * Prevent concurrent retrieval
(cherry picked from commit 88eb124)
2015-08-11 15:30:38 +02:00
Gina Häußge 202f93426a Capture compilation errors on additional templates
Shouldn't cause the whole page not to render but log an error. Should
provide more resilience against bad plugins.
(cherry picked from commit d25202d)
2015-08-11 15:30:19 +02:00
Gina Häußge c538604cd5 Added tooltip for additional data in file list
Also fixed tooltips to those buttons instead of the icons within the buttons.

Fixes #986
(cherry picked from commit 8772162)
2015-08-11 14:08:10 +02:00
Gina Häußge 0c44762f6f Fix: Better error handling for webassets + cache
(cherry picked from commit 38be47c)
2015-08-11 14:08:04 +02:00
Gina Häußge 6df57bc1d1 Evaluate return code of pip while updating
Should not report a successful update anymore when the pip call failes for whatever reason.
(cherry picked from commit 54b981b)
2015-08-11 14:07:38 +02:00
Gina Häußge e328695100 Do not hiccup on unset Content-Type fields in multipart file uploads
Just don't set the content_type parameter in that case.

Fixes #985
(cherry picked from commit 4bb5be7)
2015-08-11 14:07:31 +02:00
Mark Walker 738c699a6e Fix for #1001 connection tab not unfolding
Defer collapsing the connection element until the whole wrapper part is
visible (it's hidden for non-admins).
(cherry picked from commit af67d8b)
2015-08-11 14:07:11 +02:00
Gina Häußge 8a28220e63 responsive => snappy
Finally found a replacement for the word "responsive", which these
days is almost inclusively understood as "viewport adjusting"
instead of its original meaning "reacting quickly".

Thanks to the javascript world, even "reactive" isn't an option
anymore, this term has now been hijacked as well.
(cherry picked from commit 2e27b94)
2015-08-11 14:06:43 +02:00
Gina Häußge 5808c1bd8a Added @masterhou to AUTHORS.md
(cherry picked from commit 7c90fe5)
2015-07-29 09:19:51 +02:00
Thomas Hou 8bbb642a56 fixed bug: when new job start, job progress is last 100%.
(cherry picked from commit 200ad3b)
2015-07-29 09:19:44 +02:00
Gina Häußge 1f0dbf8f7f maintenance branch is now 1.2.5-dev 2015-07-23 12:19:27 +02:00
Gina Häußge 9a6099ffc2 PMGR: Dependency links can make pip install take longer
Depending on the pip version pip might first fetch the full index of packages available
on PyPI instead of just directly processing the provided link.

Display corresponding message to user from backend to make sure they don't
think something broke.
2015-07-23 10:54:39 +02:00
Gina Häußge 25de95dc93 Preparing release of 1.2.4 2015-07-23 09:54:27 +02:00
Gina Häußge 57f6e1e1bc Some more hints where to find documentation and support 2015-07-23 08:48:11 +02:00
Gina Häußge edf9c40941 Re-added dependency_links option for create_plugin_setup_parameters
(cherry picked from commit a59642b)
2015-07-22 22:10:31 +02:00
Gina Häußge 4dd4a2cc9c Revert "Remove dependency_links support again"
This reverts commit be423e49fd.

Conflicts:
	src/octoprint/plugins/pluginmanager/__init__.py
	src/octoprint/plugins/softwareupdate/updaters/pip.py
(cherry picked from commit c24ba82)
2015-07-22 19:06:39 +02:00
Gina Häußge 81bc8c784a Don't reopen notification on mouse-over while closing
(cherry picked from commit 9839f4b)
2015-07-21 16:57:39 +02:00
Gina Häußge 294e7fc2db Patch for the js warnings referred to in #966 2015-07-21 11:54:06 +02:00
Marc 6e632d02a0 Fixes usersettings never reached the client's browser
(cherry picked from commit 8e235af)
2015-07-20 10:10:00 +02:00
Gina Häußge 50ff0d810f Fixed a missing self.buffer()
(cherry picked from commit 0fa22937e0)
2015-07-20 10:09:33 +02:00
Mark Walker d4be7f18e2 transpose=2 is counter clockwise, plus filter order should be rotation
last to match the css application order
(cherry picked from commit bdb55e0)
2015-07-20 09:37:56 +02:00
Nicanor Romero Venier 6d24a46e88 Fixed form field truncation in upload requests
(cherry picked from commit 1f6c852)
2015-07-15 10:35:59 +02:00
Gina Häußge db866d2310 Finally added a proper AUTHORS file
Also adjusted contribution guidelines to ask people to include themselves when filing
a PR.
(cherry picked from commit 1b594b2)
2015-07-15 10:35:38 +02:00
Gina Häußge bb7e15be84 Fixed a typo in the docs
logger => loggers in logging.yaml
(cherry picked from commit d0733d8)
2015-07-14 09:26:30 +02:00
Gina Häußge 7a007a6417 Stop RepeatedTimers on server shutdown by default
daemon flag was missing, leading to the timer staying active even when a shutdown
 was triggered. Added new daemon flag to timer constructor, defaulting to true, that
 fixes that behaviour.
(cherry picked from commit 48fe23b)
2015-07-14 09:26:25 +02:00
Gina Häußge 96aad9d34f Better resilience against errors within plugins
(cherry picked from commit 75992ef)
2015-07-14 09:26:20 +02:00
Gina Häußge 4d3334caf1 Updated README 2015-07-10 09:58:20 +02:00
Gina Häußge 2745f49d28 Fixed white panes in settings dialog on Safari 8
Absolute positioning caused panes to sometimes not render when being
selected. Switching to static positioning again makes the dialog look a bit
weird, but that's probably still preferable to no content showing. It seems
to be a browser bug that not's present with Safari 7, more tests to pinpoint
what exactly is causing this are probably necessary, but this at least is a
functional workaround for now.
(cherry picked from commit a18cbf7)
2015-07-09 21:52:59 +02:00
Gina Häußge 5470aaaa3a Set no-cache headers on page while firstRun is True
(cherry picked from commit f1afb70)
2015-07-09 09:45:35 +02:00
Gina Häußge f89cbc9133 Allow to not cache responses that set no-cache headers
(cherry picked from commit 163100b)
2015-07-09 09:45:29 +02:00
Gina Häußge 5dfffc36e3 maintenance branch is now 1.2.4-dev 2015-07-09 09:44:51 +02:00
Gina Häußge 3761995aff Removed unneeded parameter and added missing semicolon
(cherry picked from commit 29b3b62)
2015-07-08 17:42:47 +02:00
Gina Häußge e62cef590b Fixed preventDefault issues also for files search
(cherry picked from commit 4894c6e)
2015-07-08 17:42:41 +02:00
Mark Walker 677e583345 pluginmanager: case handling and submit binding
- Convert query term to lower case so that it is case insensitive both ways
    - Knockout submit binding takes the form element as parameter and return
    value determines whether the form submit occurs. See http://knockoutjs.com/documentation/submit-binding.html
(cherry picked from commit 4a2cc53)
2015-07-08 17:42:35 +02:00
Gina Häußge abbf937e7f Preparing release of 1.2.3 2015-07-08 17:22:18 +02:00
Gina Häußge 8d14ea6093 Rewrite urls in packed css and less files
See also #962
(cherry picked from commit 7ea2ee2)
2015-07-08 16:46:46 +02:00
Gina Häußge 97826b2f3b Fix: More resilience against missing plugin assets
Two changes:

  * Asset existence will now be checked before they get included
    in the assets to bundle by webassets, logging a warning if a
    file isn't present.
  * Monkey-patched webassets filter chain to not die when a file
    doesn't exist, but to log an error instead and just return
    an empty file instead.
(cherry picked from commit 2a5ec33)
2015-07-08 16:46:38 +02:00
Gina Häußge a1e0078ce5 Updated translation
(cherry picked from commit 7d43bca)
2015-07-07 19:00:11 +02:00
Gina Häußge a5bf3c3be1 Log serial write exceptions to octoprint.log
(cherry picked from commit 367ba06)
2015-07-07 18:39:54 +02:00
Gina Häußge 19a5613e59 Made "Software Update" and "CuraEngine" translateable
Also fixed a typo in a notification.
(cherry picked from commit 430e47d)
2015-07-07 18:39:47 +02:00
Gina Häußge ced286854c Fixed sorting by size of file list
(cherry picked from commit 6906584)
2015-07-07 18:39:06 +02:00
Gina Häußge 811ffc760f Added "pollWatched" setting to UI
(cherry picked from commit b8cf5ef)
2015-07-06 10:21:21 +02:00
Gina Häußge 549b60edb1 Allow polling for changes in watched folder
Some underlying file systems might not trigger change events (e.g.
mounted remote file systems). Added a feature flag to allow for
switching to a (less performant) polling method.
(cherry picked from commit f2df174)
2015-07-06 10:20:57 +02:00
Gina Häußge 8735b10653 Better resilience against senseless polling intervals
(cherry picked from commit 6600d24)
2015-07-05 16:50:33 +02:00
Gina Häußge 29d49179a9 SWU Fix: properly sanitize version strings for comparison 2015-07-05 10:04:06 +02:00
Gina Häußge 19b4a0f403 Fix: Always delete files from watched folder
Wasn't ensure previously when using file preprocessors.
2015-07-05 09:35:49 +02:00
Gina Häußge d854b41ffb Migrated access control docs from wiki 2015-07-05 00:09:13 +02:00
Gina Häußge 329a575031 Merge branch 'master' into maintenance 2015-07-04 23:51:58 +02:00
Gina Häußge 85ad85bdfa Also refer to wiki from docs until everything "official" is migrated 2015-07-04 23:51:29 +02:00
Gina Häußge 95c26a7850 Fix: Don't automatically persist or return _config_version
Should only ever be read or written by the plugin system itself, not
by on_settings_save or on_settings_load
(cherry picked from commit 77f7d59)
2015-07-02 15:27:35 +02:00
Gina Häußge 885e6f916c Fix: Don't persists checks when saving SWUpdate settings
(cherry picked from commit 8d10be6)
2015-07-02 15:27:27 +02:00
Gina Häußge d7a86a4d28 Use UTF-8 for _all_ output from sarge
Lines taking from the asynchronous processing of stdout/stderr where
left as str, leading to encoding problems when utf8 characters showed
up in the stream and were being interpreted as ascii encoding.
(cherry picked from commit 9373be3)
2015-07-02 15:27:17 +02:00
Gina Häußge 7b3e0563cc SWUpdate: Only use version cache from same version of OP
When using the version cache only use the version cache if the OctoPrint
version stored within it matches the one of the currently running
instance. Otherwise we might report false positives with regards to
available updates under some circumstances.
(cherry picked from commit bb7b0cb)
2015-07-02 15:26:02 +02:00
Gina Häußge 50a62bf00a maintenance branch is now 1.2.3-dev 2015-06-30 21:49:37 +02:00
Gina Häußge 1c6b0554c7 Preparing release of 1.2.2 2015-06-30 21:19:50 +02:00
Gina Häußge 537c205757 Use lowercase when matching extensions
(cherry picked from commit 29cee16)
2015-06-30 19:12:58 +02:00
Gina Häußge f07b2477f5 Fixed some comments that were outdated
(cherry picked from commit 18816b6)
2015-06-30 19:12:52 +02:00
Gina Häußge 5e5531f6d8 Verify extension of uploaded language packs & plugins
Should be valid zip archives/tarballs. Also use only the extension
of an uploaded plugin archive as suffix for the temporary file that's
used for installing it.
(cherry picked from commit a1ff698)
2015-06-30 19:12:45 +02:00
Gina Häußge eadc9ee795 Fix: We don't need the shell for pip
(cherry picked from commit 2db3228)
2015-06-30 19:12:37 +02:00
Gina Häußge 0b3f94b6bd maintenance branch is now 1.2.2-dev 2015-06-30 10:12:14 +02:00
Gina Häußge 9f8d30a66c Preparing release of 1.2.1 2015-06-30 08:42:16 +02:00
Gina Häußge 2a8eea086c Only print command of event handler to log when debug flag is present
(cherry picked from commit 49d28c5)
2015-06-30 08:28:16 +02:00
Gina Häußge bb0bfaee56 Fix: Increase max body size for plugin archives
Closes #957
(cherry picked from commit af89097)
2015-06-29 21:01:21 +02:00
Gina Häußge b8209e8e09 Switch to pkg_resources for compatibility check
Plugin Manager now internally uses pkg_resources.parse_version and
pkg_resources.parse_requirements to check for version compatibility
with plugins from the repository. That will allow to directly use
the OctoPrint version string once it's PEP440 compatible.
(cherry picked from commit 8eb61a9)
2015-06-29 18:24:23 +02:00
Gina Häußge a5b87a9067 Updated changelog 2015-06-29 17:49:19 +02:00
Gina Häußge b3e547c60f Fix: Don't reload page on search form submits
Both file search and plugin repository search reloaded the page when
hitting enter in the search field. This fixes that.
(cherry picked from commit 60043cc)
2015-06-29 17:40:15 +02:00
Gina Häußge 1ead6e2d20 Fix: Ensure correct "upload date" for all added files
Local file storage implementation will now "touch" added files to set
modification date to current date, ensuring that files that are just
moved through a custom implementation of file object (e.g. through the
watched folder mechanism) will show with "now" as the upload date.
(cherry picked from commit 5f0c89c)
2015-06-29 10:35:33 +02:00
Gina Häußge 016bdd542a Fix: More flexibility when parsing plugin compatibility
If compatibility information is provided only as a version number it's
prefixed with >= for the check (so stating a compatibility of only
1.2.0 will now make the plugin compatible to all versions that follow
too).

Alternatively the compatibility information may now contain stuff like
">=1.2,<1.3" in which case the plugin will only be shown as compatible
to OctoPrint versions 1.2 and up but not 1.3 or anything above that.
(cherry picked from commit d5692d7)
2015-06-29 10:22:10 +02:00
Gina Häußge 4dc9d0a536 Fix: SD card errors shouldn't not cause disconnect
If the SD card fails to initialize with a volume.init failure, that's
not a reason to break off all diplomatic relations with the printer.
(cherry picked from commit 9caf13d)
2015-06-29 10:19:50 +02:00
Gina Häußge 4b11032567 Fix: Slicing profiles now can always be set as default
Previously depended on the slicer being already configured, which is not
really necessary.

Closes #956
(cherry picked from commit 13ac06c)
2015-06-28 02:24:57 +02:00
Gina Häußge 0c54eaf176 Fix: Use Exception, not BaseException
Custom exception should be derived from Exception, not BaseException.

Not only is this specified in the python documentation, but also
tornado will be able to handle Exceptions in requests perfectly fine
and return an HTTP 500 for them, but crash hard (as in, server shut
down follows) for BaseExceptions.
(cherry picked from commit 29b047b)
2015-06-28 02:24:47 +02:00
Gina Häußge 401ebcf685 Fix: Cleanly exit on SIGTERM 2015-06-25 15:18:33 +02:00
Gina Häußge 69e5f137a6 Devel is now 1.3
(cherry picked from commit dd5bf2e)
2015-06-25 11:03:56 +02:00
Gina Häußge a0f2079fb5 maintenance branch is 1.2.1-dev for now
This branch is for preparing the next patch-releases of the current
stable release on the master branch.
2015-06-25 11:02:33 +02:00
Gina Häußge cfa4cb2a7c Preparing 1.2.0 release (forgot another changelog update) 2015-06-25 10:18:00 +02:00
Gina Häußge 12a1bebe7e Preparing 1.2.0 release 2015-06-25 10:13:17 +02:00
Gina Häußge d461acffc7 Big update of changelog
Resorted some things and added stuff from the various RC release notes.
2015-06-24 15:18:02 +02:00
Gina Häußge e60cdc9d0f Adjusted bundled plugins to new data folder method 2015-06-24 14:33:33 +02:00
Gina Häußge 67a0fd11dd PluginSettings.get_plugin_data_folder moved to OctoPrintPlugin.get_plugin_data_folder
That way plugins don't need to implement the SettingsPlugin mixin in order to access their data folder, which is now an injected property in OctoPrintPlugin. Plugin authors should still always use the getter since that will also make sure the folder actually does exist (lazy creation).

PluginSettings.get_plugin_data_folder has been marked as deprecated.
2015-06-24 13:59:45 +02:00
Gina Häußge fca8becb20 More informative errors when serial connection fails 2015-06-24 08:55:27 +02:00
Gina Häußge be423e49fd Remove dependency_links support again
Doesn't work reliably across pip versions, and adding a special rule for each and every version also isn't fun. Plugin authors will need to use a different approach for pulling in dependencies that are not on pypi during install, e.g. extra install urls or something like that. For now, I give up here ;)
2015-06-23 16:22:45 +02:00
Gina Häußge 5decb23f23 Plugin Manager: color coding call/stdout/stderr in install/uninstall logs 2015-06-23 11:37:07 +02:00
Gina Häußge ac151d9019 Software Update: Use new PipCaller class and only provide dependency-links parameter if supported by pip version 2015-06-23 11:36:41 +02:00
Gina Häußge 71ccc47717 Plugin Manager: Use new PipCaller class and only provide dependency-links parameter if supported by pip version 2015-06-23 11:36:27 +02:00
Gina Häußge b32f9bddd2 New util class for performing pip calls
Will lookup the correct pip command to use if not provided as constructor parameter and determine the version. Implements __lt__, __le__, __gt__ and __ge__ for "less/greater than" checks against the pip version, for dynamicalle changing call parameters provided to the execute method based on availability.

 Will allow adjusting software update and plugin manager plugins to only use --process-dependency-links for pip versions >= 1.5
2015-06-23 11:35:23 +02:00
Gina Häußge 1a7193e113 System commands with ignore set to true also ignore http errors 2015-06-22 16:55:32 +02:00
Gina Häußge a580482c29 Allow asynchronous system commands & commands w/ ignored result
That should get rid of error messages for things like shutdown commands.
2015-06-22 14:28:05 +02:00
Gina Häußge e230cfb3f3 Software Update fix: Use pip command line instead of module 2015-06-22 13:07:22 +02:00
Gina Häußge 030b6b4478 Software Update: version cache will be written to disk
Reduces number of requests done against (rate limited) github API, especially after consecutive server restarts. Forcing the update check still will query the API.
2015-06-22 13:05:03 +02:00
Gina Häußge 0f818a313d Software Update: Default to pkg_resources for version comparison
That's also able to cope with 0.3a and similar "non-semantic" version schemes. Semantic version comparison can still be forced by setting the compare_type in the check to "semantic". Strict equality check can be set similarly by using the value "unequal".
2015-06-22 13:03:23 +02:00
Gina Häußge 326fc943b7 Plugin Manager: Cache repository list locally
Reduces requests against github upon server restarts.
2015-06-22 13:00:29 +02:00
Gina Häußge 7e6ddaf0d6 Plugins can now have a folder for plugin related data
Path can be queried from settings.
2015-06-22 12:59:39 +02:00
Gina Häußge 22710ccfb3 Show overlay when a new server version is detected
That's more user friendly than just blindly reloading the page. Also include installed Template- and AssetPlugins in the check whether there's a new version or not.
2015-06-21 18:02:16 +02:00
Gina Häußge 33ea9c3459 Fix: Software Update config could contain circular reference
Caused by a wrong variable usage. Fixed the usage and added a migration
step that fixes the circular reference if it exists. Bumping configuration
version to 2.

Fixes #946
2015-06-21 12:27:33 +02:00
Gina Häußge e722c2f8ad Sanity check: verify that plugin settings data jsonifies without error
More resilience which apparently is necessary as witnessed in #946
2015-06-21 00:32:59 +02:00
Gina Häußge 1c99bccef9 Updated german translation 2015-06-20 01:05:18 +02:00
Gina Häußge 61bd803942 Fix: Properly report if a plugin simply could not be found after installation
Also more resilience towards odd version numbers that get mangled by python's package management (1.2.3a0 => 1.2.3a)
2015-06-20 00:56:26 +02:00
Gina Häußge 2f5c3570dd More verbose logging for analyzer 2015-06-20 00:01:59 +02:00
Gina Häußge 9e12a8353b Small update for API docs, more necessary 2015-06-19 23:46:17 +02:00
Gina Häußge c6cb430594 Throttle gcode analysis a bit for low prio entries
Give the Pi's CPU a bit air to breathe...
2015-06-19 22:33:26 +02:00
Gina Häußge 0e60b26048 Config migration must happen after all plugin implementations are initialized
Introduced new callback for settings plugin to hook into the point after the settings have been migrated since the initialize method is not suitable for that as it might be called before other plugin implementations reachable through hooks are initialized.
2015-06-19 22:31:05 +02:00
Gina Häußge 269f18a22f Software Update Fix: Only migrate config settings that are actually in the config 2015-06-19 22:26:22 +02:00
Gina Häußge 7c74aa4c4d Allow ignoring of settings defaults when retrieving values 2015-06-19 22:25:42 +02:00
Gina Häußge a6c1084b14 Fix: Only try to delete a key in the settings that's actually there 2015-06-19 21:52:03 +02:00
Gina Häußge 4abd97df09 File manager will now migrate analysis result from old metadata
That should make the initial startup after switching to 1.2.0 way faster.
2015-06-19 19:19:02 +02:00
Gina Häußge 904a3cdaff super(...).method(...) => BaseClass.method(self, ...) 2015-06-19 15:25:37 +02:00
Gina Häußge f58d63bb49 pluginmanager: Reset flag for repository_available when refreshing it 2015-06-19 15:20:25 +02:00
Gina Häußge dedf3f234f super(...).on_settings_save(data) => octoprint.plugin.SettingsPlugin.on_settings_save(self, data) 2015-06-19 13:19:54 +02:00
Gina Häußge 633d1ae594 Fix: capture TypeError caused by dynamic reloading on settings save and load
Usage of super(MyClass, self) is henceforth discouraged due to dynamic reloading within OctoPrint's plugin subsystem. Refer to https://thingspython.wordpress.com/2010/09/27/another-super-wrinkle-raising-typeerror/ for details on this problem.

Action by plugin authors is needed to remove the super(...) call and substitute it with octoprint.plugin.SettingsPlugin.on_settings_save(self, data) and octoprint.plugin.SettingsPlugin.on_settings_load(self). Without these modifications, calls to plugin methods utilizing super(...) will fail after a call to the plugin managers reload_plugins method.

Closes #942
2015-06-19 13:18:21 +02:00
Gina Häußge 0846a0fed0 Fix: Wrong parameter order 2015-06-19 11:24:37 +02:00
Gina Häußge f1be116190 SoftwareUpdate: Don't persist more check data than necessary in config
The SoftwareUpdate Plugin had a bug that caused way too much check data to be stored in the configuration, leading to plugins potentially being stuck in an "update available" loop although the update had already been applied. Now only the current version of github_commit update types is persisted, not the full check configuration.

Also introduced a configuration version and made the migration function migrate old configs to remove anything that was same as the default supplied for the "octoprint" and all plugin hook checks. That should clean things up in existing installations.
2015-06-19 11:12:24 +02:00
Gina Häußge d5af7b9b48 SettingsPlugins may now track configuration versions
OctoPrint will take care of calling a migration function on the plugin if the plugin demands a newer configuration version than currently stored in config.yaml.
2015-06-19 11:10:07 +02:00
Gina Häußge e55677da22 Plugin system now support pre/post implementation init methods 2015-06-19 11:09:08 +02:00
Gina Häußge 9f4a74cca0 Fix: setting defaults supplied to set/get from plugins are no longer overwritten 2015-06-19 11:08:11 +02:00
Gina Häußge b40cba659a Fix: defaults are now correctly applied when setting config for plugins 2015-06-19 11:06:51 +02:00
Gina Häußge a26b203205 Enforce update of updateable software after plugin changes
When any plugins are enabled/disabled, the client now gets a trigger to fetch a fresh list of update information from the server. This should take care of any old popups still hinting at now uninstalled plugins.
2015-06-18 17:08:56 +02:00
Gina Häußge 6e90c9d730 Reintroduced minification
Still opt-in though.
2015-06-18 13:49:40 +02:00
Gina Häußge 31d7eaad90 Add ";" delimiters between bundled JS files
This is to make sure that they all end on a ; and hence stuff doesn't break if a file included directly after starts with a (...) construct. Of course it would be better if all bundled files are valid in that matter, however since we can't enforce that, we'll add this slight overhead to reduce the risk of stuff breaking.

See for example: http://stackoverflow.com/questions/20307462/js-cant-combine-lib-files
2015-06-18 13:00:18 +02:00
Gina Häußge 0d886ab6f1 Revert cbd3b1424b
That was a bit too early and an accident caused by a too fast "OK" in IntelliJ (as quite visible from the completely unrelated commit message)
2015-06-18 12:11:54 +02:00
Gina Häußge cbd3b1424b Default to full platform compatibility 2015-06-18 12:05:11 +02:00
Gina Häußge 0ce1575e12 Don't allow plugin management while the printer is printing 2015-06-18 11:37:08 +02:00
Gina Häußge 268886576f More resilience against wonky plugin compatibility data
(cherry picked from commit 5ed37e0)
2015-06-18 09:31:11 +02:00
Gina Häußge cbc6f20fa6 Split assets up a bit to allow better debugging of issues with webassets 2015-06-17 18:43:38 +02:00
Gina Häußge 608be52b9a softwareupdate: plugins may now specify that they have dependency links
Update plugin will then also process those during pip install. Was missing previously and caused Pushbullet Plugin to not properly update.
2015-06-13 19:36:28 +02:00
Gina Häußge 4badf72e18 New section "Note for Upgraders" & corrected a typo 2015-06-12 20:15:22 +02:00
Gina Häußge 5da52b6c57 Preparing release of 1.2.0-rc2 2015-06-12 17:30:32 +02:00
Gina Häußge c527338cb8 Docs: Updated plugin tutorial to utilize new cookiecutter template 2015-06-11 15:04:27 +02:00
Gina Häußge 46711ce365 pluginmanager: Support installing plugins that need --process-dependency-links
This might be necessary when plugins depend on (patched) library versions that are not yet released on PyPI
2015-06-10 19:34:33 +02:00
Gina Häußge 8353c9bdf5 Better fix for #931, stays backwards compatible to older setuptools versions
python-setuptools on OctoPi is quite old and trying to update in a local virtualenv apparently CAN cause problems (we had this with python-serial too a while back), so a backwards compatible solution is better here.
2015-06-10 17:25:23 +02:00
Gina Häußge 6a7a858065 Fix: octoprint_setuptools depends on setuptools==7.0
Closes #931
2015-06-10 16:34:12 +02:00
Gina Häußge 2e72b91eaf Preparing release of 1.2.0-rc1 2015-06-10 10:12:30 +02:00
Gina Häußge d2cd459f26 Marked deprecated PluginSettings.getInt etc methods as to remove with 1.3.0 2015-06-10 09:43:10 +02:00
Gina Häußge 06fb249f2e Send frontend translations with javascript mime type
Thanks @markwal
2015-06-10 09:14:39 +02:00
Gina Häußge d9cbf786d5 Fix: Don't depend on presence of String.prototype.startsWith
Instead use direct comparison with "divider" (matches docs more closely anyhow)
2015-06-09 22:33:18 +02:00
Gina Häußge 5d5c3d74c1 softwareupdate: re-fetch check data on plugin lifecycle events
If plugins get enabled or disabled, the update check configuration needs to be refetched next time it's needed since there might have been changes to plugin implementing the check_info hook.
2015-06-09 19:03:38 +02:00
Gina Häußge 4b86d83465 docs: removed a missing reference 2015-06-09 18:51:14 +02:00
Gina Häußge 592cad5b99 Deprecated AppPlugin mixin and introduced octoprint.accesscontrol.appkey hook instead
Plugins implementing the mixin will automatically be migrated to providing the single mixin method as hook handler.
2015-06-09 18:50:55 +02:00
Gina Häußge 228fb21ceb softwareupdate: Also allow {target} in pip install urls, as a synonym for {target_version} 2015-06-09 17:33:41 +02:00
Gina Häußge f813e6317b Updated and bundled german core translation 2015-06-09 15:00:43 +02:00
Gina Häußge 5e1ce30ab2 Updated translations source file 2015-06-09 15:00:27 +02:00
Gina Häußge 51cc994610 softwareupdate: Slight rewording of "current versions" information 2015-06-09 14:59:52 +02:00
Gina Häußge 7ae83a4031 Moved software update plugin into "OctoPrint" settings section 2015-06-09 14:59:09 +02:00
Gina Häußge 8696ce9291 Fix: Bundled plugins always take precedence over external ones 2015-06-09 13:54:21 +02:00
Gina Häußge 2e6240a910 Bundled Software Update Plugin 2015-06-09 13:35:03 +02:00
Gina Häußge cd390a53af Updated links in footer 2015-06-09 13:04:29 +02:00
Gina Häußge ef1c9724c7 Fix: Include all packages for a plugin during setup, not only the topmost one
Thanks @Salandora
2015-06-09 12:47:37 +02:00
Gina Häußge a9d5e1643d Merge branch 'devel' of github.com:foosel/OctoPrint into devel 2015-06-09 11:00:55 +02:00
Gina Häußge f00c8bba33 Frontend: All number inputs are now right-aligned 2015-06-09 10:51:59 +02:00
Gina Häußge d43ead5b34 Frontend: Added option to allow partial settings save with callback
That's useful for plugins which only want to allow editing a selected segment of the whole settings set.
2015-06-09 10:51:20 +02:00
Gina Häußge 4b896fc327 Fixed webassets cache method to not hiccup on vanished files
Utilizing a monkey patch to catch ENOENT errors when calculating the hash of cached files.
2015-06-09 10:49:59 +02:00
Gina Häußge be5a5f3c69 Fix: Also take configuration changes into account for update-necessary-check on assets
This way, changes to the minify parameter actually change behaviour...
2015-06-08 18:06:45 +02:00
Gina Häußge fde543f19e [doc] octoprint.ui.web.templatetypes hook is now documented 2015-06-08 12:05:29 +02:00
Gina Häußge 804d832544 Made name entry for Plugin Manager settings dialog translateable 2015-06-08 08:22:40 +02:00
Gina Häußge bbba7f2817 Assets are no longer needed in index view renderer
They are now bundled via Flask-Assets instead
2015-06-08 08:22:11 +02:00
Gina Häußge 13cda74ebc Merge pull request #924 from Salandora/systemCommandsDivider
Addded possibility to add dividers to System Command Menu
2015-06-05 11:26:42 +02:00
Marc 9753a74db4 Addded possibility to add dividers to System Command Menu 2015-06-05 01:26:45 +02:00
Gina Häußge a1568c43d3 Bundled german language pack 2015-06-04 10:18:20 +02:00
Gina Häußge 0d7d4cb142 Custom webassets filter that rewrites LESS imports
Need to point to ../less folder
2015-06-04 09:06:04 +02:00
Gina Häußge 8d3f933562 Fixed webassets cache method to also allow overwriting files under windows
Utilizing a monkey patch to swap os.rename for shutil.move, which also works if the target file already exists.
2015-06-04 09:05:31 +02:00
Gina Häußge 3dc0452a45 Adjusted docs to describe new web asset handling 2015-06-03 20:21:12 +02:00
Gina Häußge 261f6709a3 Depend on Flask-Assets 0.10
Compatibility adjustments and version pinning
2015-06-03 19:36:38 +02:00
Gina Häußge b63f842210 Webassets are now written to ~/.octoprint/generated
Same holds true for cache files, so there should be no problem anymore with installs where the static folder is not writable.

Also introduced two new devel config vars to disable merging and minifying of the assets, solved the empty-less-bundle problem and made sure babel knows about the jinja extension.
2015-06-03 18:27:30 +02:00
Gina Häußge 55650cd416 AssetPlugins now necessitate a restart due to utilizing blueprints 2015-06-03 18:25:27 +02:00
Gina Häußge 157b78a052 WIP: Use Flask-Assets to merge js, css and less files
Should reduce number of requests and hence load times needed for loading web interface.

TODO: Handling of empty bundles needs to be fixed
2015-06-03 16:42:57 +02:00
Gina Häußge db980689c8 Fixed GCODE viewer in zoomed out browsers
Closes #612
2015-06-03 13:25:30 +02:00
Gina Häußge b714c59004 Allow specification of known long running commands through settings
This should allow users to adjust the behaviour of the communication stack more granularly in case the regular settings which only consider G4, G28, G29, G30, G32 to be real long runners without output are not sufficient.
2015-06-03 12:34:00 +02:00
Gina Häußge d2bca10ac9 Slight refactoring of API key evaluation in restricted_access decorator
Actual test whether key is provided or not happens in before_request handler of flask app, hence the more granular processing in the decorator was unecessary since around november '14. Adjusted to only do the actual processing necessary to replicate login_required behaviour/login users if necessary.

Closes #516 (actually, that was solved since introduction of the before_request handler which took that work off the hands of the decorator, but now it's properly documented too)
2015-06-03 11:55:32 +02:00
Gina Häußge 27dcef3e23 New approach to matching up installed packages with plugins
Match against entry_point origins using both package name and package name plus version. If one of those matches (depends on pip version if output will include version or not), it's the plugin we are looking for.

This way we don't need to try to strip a version number from the package name as output by pip without knowing if a version number is included or not.
2015-06-03 10:46:58 +02:00
Gina Häußge ba5e99c187 Use namedtuple for plugin.origin data structure and include package version 2015-06-03 10:44:27 +02:00
Mark Walker 35f2c6d788 Pip result parsing version numbers and extra lines
Some pip invocations return extra info after the Successfully installed
(like "Cleaning up...").  Also, not all packages include a version
number in their package names.
2015-06-02 23:31:03 -07:00
Gina Häußge b04be6d194 Updated transifex config file to point to new translation directory 2015-06-02 15:50:27 +02:00
Gina Häußge da58b14124 Display a message when no additional language packs are installed 2015-06-02 14:41:56 +02:00
Gina Häußge 02b7085543 Merge branch 'dev/translationsAsPackages' into devel
Conflicts:
	src/octoprint/server/__init__.py
2015-06-02 13:58:40 +02:00
Gina Häußge fb85b228f0 Merge branch 'dev/translationsAsPackages' of github.com:foosel/OctoPrint into dev/translationsAsPackages
Conflicts:
	src/octoprint/server/__init__.py
	src/octoprint/server/util/flask.py
	src/octoprint/server/views.py
2015-06-02 13:46:10 +02:00
Gina Häußge 52dd2ad7ac Management dialog for language packs
Allows managing language packs of core OctoPrint and plugins.
2015-06-02 13:39:10 +02:00
Gina Häußge 5904d01bff Unbundled translations, added new tools to bundle and pack translations
The only translation that is going to be bundled with OctoPrint for now will be .de, if at all. The reason simply being that this is the only translation I can update myself and hence guarantee a good user experience for.

setup.py now offers two new commands, babel_bundle and babel_pack, with which translations for plugins and core OctoPrint can be automatically bundled or packed as language packs once compiled. This should make sharing translations quite easy in the future.
2015-06-02 13:38:08 +02:00
Gina Häußge 7f8a3849c7 Adjusted messages.js compilation, debugged new i18n handling and added logging 2015-06-02 13:31:41 +02:00
Gina Häußge 106b21f288 New hook for specifying custom template types
TODO: documentation
2015-06-01 11:41:54 +02:00
Gina Häußge e8c37287fe Forgot a dependency for the bundled plugin manager
Thanks to @Salandora for the heads-up
2015-05-31 11:10:40 +02:00
Gina Häußge 449dd4301e Allow translations to be stored in ~/.octoprint
That is the first step towards downloadable (and separately managed) translation packages, decoupled from the software's release cycle and source control. Since it will be impossible to properly maintain all languages concurrently with OctoPrint's releases, decoupling that will hopefully increase the user experience through preventing broken translations (or stalling releases due to having to wait for the translations to be updated).
2015-05-29 19:44:11 +02:00
Gina Häußge baf2a77e18 Updated German translation 2015-05-29 18:49:20 +02:00
Gina Häußge ab1d28bb27 Removed some outdated code from the cura settings dialog 2015-05-29 18:48:58 +02:00
Gina Häußge 71319942d9 Fix: Don't have plugin i18n paths overwrite the core i18n path
Stopped translations bundled with OctoPrint to work
2015-05-29 18:23:16 +02:00
Gina Häußge ff9765f668 Fixed font size in plugin manager's repository options 2015-05-29 16:46:22 +02:00
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
Gina Häußge 9b010db0b8 Removed obsolete elif branch in file upload code 2015-05-07 12:51:23 +02:00
Gina Häußge aed9e905f2 Cura Plugin: added more logging
Trying to get to the ground of #878
2015-05-07 11:06:11 +02:00
Gina Häußge ad2bdb1242 Added a bunch of changelog entries 2015-05-07 09:59:05 +02:00
Gina Häußge d43bc2e17e Allow different timestamps (zones or dates) between client and server while keeping the temperature graph working
The server now sends the current server time with each temperature update as well as the initial temperature data, allowing the client to translate the timestamps contained in the temperature logs to its local timescale.

 Followup to commit f19d0f0360 which caused a problem with large deviations between server and client time.
2015-05-06 17:23:01 +02:00
Gina Häußge 9ecd59c6e1 Merge branch 'gcode-renderer-retina' of https://github.com/lucas-clemente/OctoPrint into pr/lucas-clemente/gcode-renderer-retina
Conflicts:
	CHANGELOG.md
2015-05-05 22:04:22 +02:00
Gina Häußge d34b73cd7c Merge pull request #884 from Salandora/vp_dropConnection2
Adds !!DEBUG:drop_connection to the virtual Printer
2015-05-05 21:59:00 +02:00
Gina Häußge 3e5298fcab Merge pull request #879 from markwal/onSettingsShown
onSettingsShown/Hidden call only on parent dialog shown/hidden
2015-05-05 21:57:34 +02:00
Marc e5de00095f Adds !!DEBUG:drop_connection to the virtual Printer 2015-05-05 21:01:00 +02:00
Gina Häußge 84cda5cfe2 Fix: Only show the "too big" dialog in the gcode viewer if no file loading is currently taking place
Possible fix for #825
2015-05-05 18:33:45 +02:00
Gina Häußge f19d0f0360 Base cut off point for temperature graph on timestamps instead of data points
Cut off of the temperature graph is now not based on the number of data points any more but on the actual time of the data points. Anything older than ``n`` minutes will be cut off, with ``n`` defaulting to 30min. This value can be changed under "Temperatures" in the Settings

Closes #343
2015-05-05 18:18:55 +02:00
Gina Häußge ede2e8c593 Virtual printer now allows sending of custom action commands
Sending "!!DEBUG:action_custom foo 1 2 3" will result in the virtual printer sending "// action:foo 1 2 3" back. Sending "!!DEBUG:action_custom bar" will result in the virtual printer sending "// action:bar" back.
2015-05-05 17:30:35 +02:00
Gina Häußge 2ef3930fc3 Better extruder/nozzle offset editing in the printer profiles
If only one tool is configured, the profile dialog now won't show the offset configuration. If more than one extruder is configured offset configuration for anything but the first tool (which acts as reference for the relative offsets of the others) will be shown.

Closes #677
2015-05-05 10:28:21 +02:00
Gina Häußge 2d14625fd0 Added a missing changelog entry 2015-05-04 18:15:47 +02:00
Gina Häußge 92445a8a3f Virtual printer now supports two resend variants 2015-05-04 18:15:46 +02:00
Gina Häußge 517a32f08f Less strict error parsing for detecting communication errors
Instead of matching to full strings send by firmware in case of checksum or line number issues, now matches only against lower case "checksum", "line number" and "line expected". Should make it more resilient to firmware side changes of the sent messages.
2015-05-04 18:15:46 +02:00
Gina Häußge 72cadba854 Merge pull request #870 from DanLipsitt/feature/flask-0.10
flask 0.10 fixes
2015-05-04 11:36:14 +02:00
Gina Häußge 0ef66c74b0 Fix: Corectly send origin center for circular volumes
Also added more logging in case of invalid profile detection.
2015-05-04 11:27:25 +02:00
Gina Häußge a1ae185272 Fans => Fan 2015-05-04 10:38:24 +02:00
Gina Häußge fcdb556f3b Made autodetection more robust and fixed it not running if a preset for a baudrate existed
Thanks @Salandora
2015-04-30 17:25:52 +02:00
Gina Häußge 6e1e869851 Renamed parameter for default display for output custom control: defaultValue => default 2015-04-30 14:03:52 +02:00
Gina Häußge ba1bab4ee7 Virtual printer now allows simulating more communication problems
Added new debug commands:
  * !!DEBUG:dont_answer will cause the next command to go unanswered
  * !!DEBUG:trigger_resend will trigger a resend request
2015-04-30 14:02:57 +02:00
Mark Walker dbc2fe9cdb onSettingsShown/Hidden call only on parent dialog shown/hidden
jQuery bubbles all children show/hide events up to the parent so the
event gets called whenever a settings pane is chosen by the user.
Intent of the viewmodel callback was just on first show and final
dismiss.
2015-04-30 02:22:25 -07:00
Gina Häußge a6a3a1365f Merge branch 'experiment/issueYellowGTO' into devel 2015-04-29 18:16:42 +02:00
Gina Häußge 34f1aa421f [doc] Added *args, **kwargs to all hooks and documented adjusted gcode hook signature
(cherry picked from commit 30d79f4)
2015-04-29 17:32:38 +02:00
Gina Häußge 30d79f48de [doc] Added *args, **kwargs to all hooks and documented adjusted gcode hook signature 2015-04-29 17:31:01 +02:00
Gina Häußge ad17e22201 Force M105 upon communication timeout, see if that changes behaviour 2015-04-28 22:21:01 +02:00
Gina Häußge 9f0128cf3f Merge pull request #876 from markwal/viewmodeldoc
Add a short explanation of additional available callbacks
2015-04-28 18:33:20 +02:00
Gina Häußge 3aa882ee21 Fix: Also process temperature responses that only contain bed temperatures 2015-04-28 16:31:10 +02:00
Mark Walker 894aa9bc5e Add a short explanation of additional available callbacks 2015-04-28 04:24:59 -07:00
Gina Häußge 4944c33228 Made something way to complicated when it can be achieved oh so much easier.
Thanks @Salandora
2015-04-28 12:21:14 +02:00
Gina Häußge 06518b5374 Some changes to increase readability and reuse and remove redundancy 2015-04-28 12:16:54 +02:00
Marc 2a5a0282cb Updated the Check routine and put it into a temp. fcuntion for better readability 2015-04-27 20:55:06 +02:00
Marc d4a96c53c3 Merge branch 'devel' of github.com:foosel/OctoPrint into fixControl 2015-04-27 19:39:37 +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 e96dcadc70 Fix: Receiving a "start" from the firmware triggers another handshake attempt
Fixes #869
2015-04-27 18:42:05 +02:00
Gina Häußge fb5aaffdc1 Added a "fake ack" button to terminal tab, as counter measure for lost "ok"s
In case an ok gets lost on the line, this allows to have the communication between
OctoPrint and the printer take up again.
2015-04-27 18:13:39 +02:00
Gina Häußge 4ea6bcd1de Smoothie compat fix: Only wait for ok's after GCODE commands
Any unknown commands should just be piped through and not use up an acknowledgement. This
new behaviour can be overridden via the new feature flag "unknownCommandsNeedAck", which will
restore the former behaviour causing even unknown commands to use up an "ok".

Also no line numbering or checksumming will happen. Shouldn't usually be of relevance for other
firmwares, but in case of any compatibility issues introduced by this also added a new feature
flag "sendChecksumWithNonGcode" that causes even unknown commands to be sent with a
checksum if necessary.
2015-04-27 17:24:34 +02:00
Gina Häußge 5765180462 Fix: moved line number incrementing to send loop
Should fix issues where too fast a temperature polling could cause skipped line numbers, triggering nasty resend loops in the process.
2015-04-27 17:15:57 +02:00
Gina Häußge 4c1ba0fd0b [doc] <pluginname> => <plugin identifier> 2015-04-27 16:10:23 +02:00
Marc 159eb4ce59 Fix 2015-04-24 15:39:31 +02:00
Marc 17889a2b46 Slider DefaultValue always an Int and in range(min, max) 2015-04-24 14:46:41 +02:00
Gina Häußge 3ebc6f0f1d Fix: Reselect current printer profile if it was updated and deny deleting the current printer profile 2015-04-24 12:05:38 +02:00
Gina Häußge 9ee9f7bffb Workaround for idle temperature polling not working with Repetier Firmware
Repetier always first sends the ok and then any command output. In case of M105, that makes the response look like from an externally triggered heatup (no ok on the same line), causing polling to stop until that falsely detected heatup is complete. Added a configuration option to disable heatup detection. The disadvantage of this is that when printing via Repetier Firmware from SD, the heatup times won't be substractable from the total print time, leading to a less accurate print time left estimation.

 Closes #835
2015-04-24 09:36:43 +02:00
Dan Lipsitt 013d221398 BadRequest is actually in werkzeug.exceptions. 2015-04-23 13:17:39 -07:00
Dan Lipsitt 5a1b618ce0 Allow flask 0.10 in setup.py. 2015-04-23 13:17:39 -07:00
Gina Häußge c6fdab554b [doc] documented viewmodels and their callbacks and dependency injection for usage in plugins 2015-04-23 17:27:25 +02:00
Gina Häußge c6a0ef2425 [doc] documented gcode scripts and snippets 2015-04-23 14:05:10 +02:00
Gina Häußge a146cb193b [docs] Updated and sorted sections in docs of control.yaml, added reference to plugin repository 2015-04-23 12:22:21 +02:00
Gina Häußge a55de71233 Merge branch 'pr/Salandora/patch3' into devel 2015-04-23 10:41:34 +02:00
Gina Häußge 2c50861c44 Removed unnecessary a tag in custom section headers, we can just use the h1 to toggle 2015-04-23 10:41:22 +02:00
Gina Häußge d0e7cd46ce Removed id attribute again since we don't need it anymore 2015-04-23 10:27:15 +02:00
Gina Häußge e0027c3cba Made baudrate detection a bit more solid 2015-04-23 10:07:05 +02:00
Gina Häußge 19918b7221 Suggestion for custom controls to allow for collapsable sections while keeping close to the same visual appearance 2015-04-22 19:27:44 +02:00
Marc 7c4c8485b4 Fixed Layout 2015-04-22 18:05:49 +02:00
Gina Häußge 88af79509f Delect selected files upon comm disconnect in the printer handler
Should solve #861
2015-04-22 11:42:41 +02:00
Gina Häußge a42c5edaa3 Merge pull request #865 from DanLipsitt/feature/flask-0.10
Use BadRequest instead of JSONBadRequest.
2015-04-22 11:16:27 +02:00
Marc ef9034e380 Fixed linendings and encoding 2015-04-22 10:20:15 +02:00
Marc f24ae37bd8 Missing ; added 2015-04-22 10:01:09 +02:00
Marc 3f1cbb20d3 renamed deflt and default to defaultValue
+ adds a div container around the each Input
2015-04-22 10:00:58 +02:00
Marc 483e19adb6 exc.stack -> (exc.stack || exc) so if exc is a message (e.g. knockout sends a message) you'll get the message instead of undefined 2015-04-22 10:00:45 +02:00
Marc 3304a7e341 Deleted unnecessary css style 2015-04-22 10:00:29 +02:00
Marc 2edb92112a Custom control containers are now Collapsable if user wants so. 2015-04-22 10:00:02 +02:00
Marc de8484b6f8 Added IDs to CustomControls and made Containers with names collapsable 2015-04-22 09:59:45 +02:00
Marc 88a81b186b Update CSS + LESS 2015-04-22 09:59:31 +02:00
Marc 15d4525b71 Added OnSettingsBeforeSave event + using onEventSettingsUpdated to sync the controls 2015-04-22 09:59:19 +02:00
Marc 032c76a944 Fixed horizontal and horizontal_grid to work properly 2015-04-22 09:58:57 +02:00
Marc 525709eb38 Added showConfirmationDialog function 2015-04-22 09:58:43 +02:00
Marc 232dbe5459 Patched Context Menu, to include also the object wich has the ContextMenu binding 2015-04-22 09:58:27 +02:00
Gina Häußge 3f14fdb51b Allow disabling the cache during development
Set "devel > cache > enabled" to false in config.yaml to disable the cache. Defaults to true.
2015-04-22 09:45:25 +02:00
Dan Lipsitt ca914bd419 Use BadRequest instead of JSONBadRequest.
JSONBadRequest is removed in Flask version 0.10. BadRequest is backwards
compatible with Flask 0.9.
2015-04-21 23:10:03 -07:00
Gina Häußge 2ce40c4847 Added new callback to viewmodels, allowing to react to login events
Removed old loginstate.subscribe method and migrated existing code to new mechanism.

This should allow plugins to only request their sensitive data if a user is a) logged in and has b) the necessary rights for a request. The server should still do additional auth checks, but this way no unnecessary request have to be made.
2015-04-21 19:39:48 +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 edd6acc012 Merge pull request #864 from imrahil/fix_log_files_sort
Fixed sorting log files on settings dialog
2015-04-21 15:29:27 +02:00
Jarek Szczepanski 26f43de07d Fixed sorting log files on settings dialog 2015-04-21 15:09:45 +02:00
Gina Häußge de954c6bf8 Merge branch 'master' into devel
Conflicts:
	CHANGELOG.md
2015-04-20 13:09:58 +02:00
Gina Häußge babbbf696e Fix: Another versioneer branch issue 2015-04-20 12:45:38 +02:00
Lucas Clemente 579fd3bbfb Add support for high-DPI screens to gcode renderer
window.devicePixelRatio is used to scale the canvas, extrusion line
width, retract spot size and mouse event position.
2015-04-18 12:14:47 +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 023b6f9d81 Small fixes prior to merge of #849
* Renamed userjson to userdata, removed original userdata (developers will live if they need to ensure their supplied userdata is valid JSON)
   * Input validation for userdata parameter - a HTTP 400 response will be generated if userdata can't be parsed as JSON
   * Adjusted documentation accordingly
2015-04-16 16:05:23 +02:00
Gina Häußge 694a8febb5 Merge branch 'jm/feature-metadata-endpoint' of https://github.com/Voxel8/OctoPrint into pr/jminardi/feature-metadata-endpoint 2015-04-16 15:39:35 +02:00
Gina Häußge a824d00f85 Fix: Teeny tiny typo ("out" => "our") 2015-04-16 15:28:17 +02:00
Gina Häußge cd244f341d Small fixes prior to merge of #852
* Proper origin visualization in gcode viewer for centered rectangular
   * Validation of origin profile entry
   * Auto-migration of existing profiles upon load
   * Added changelog entry
2015-04-16 15:20:18 +02:00
Gina Häußge 12310c5e3a Merge branch 'centeredorigin' of https://github.com/markwal/OctoPrint into pr/markwal/centeredorigin 2015-04-16 13:33:26 +02:00
Gina Häußge ea1fe29a5e Fixed unit tests again 2015-04-16 13:31:41 +02:00
Gina Häußge 1d98135f58 New hook "octoprint.filemanager.extension_tree"
Allows extending the list of supported file extensions for the file manager.

See also discussion on #850
2015-04-16 13:09:05 +02:00
Gina Häußge 8ac375fc9b Some minor changes before merging the PR
* moved virtual printer into plugin
  * made default serial factory use supplied parameters instead of directly utilizing self._port and similar
  * documented new hook
2015-04-16 11:43:30 +02:00
Gina Häußge 5588deb925 Merge branch 'serialhooknew' of https://github.com/markwal/OctoPrint into pr/markwal/serialhooknew 2015-04-16 09:40:14 +02:00
Gina Häußge 8d6d7a1bf5 Added two missing ; 2015-04-16 09:19:10 +02:00
Gina Häußge db739c05b8 Merge branch 'patch1' of https://github.com/Salandora/OctoPrint into pr/Salandora/patch-1 2015-04-16 09:17:10 +02:00
Mark Walker e8f61e2dda Fix server error 500 when user is logged out
f98ebaaf moved the passive_logon code to a new function from
api/__init__.py to util/flask.py.  Before that move any fallthrough
would hit return NO_CONTENT, but now it returns nothing which makes
flask complain.
2015-04-15 17:17:19 -07:00
Mark Walker 7b1d1d2592 Also include the hook discovery line 2015-04-15 15:05:58 -07:00
Mark Walker e4d8d67f65 Add a plugin hook for opening the serial port
This hook allows the plugin to create the serial port object (or pass to
the next hook or the builtin serial port handler) which allows for
serial communication filtering or a different communication transport.

Use @foosel's code to use the same loop for hooks as well as the
builtin.
2015-04-15 14:51:03 -07:00
Marc c71b29b77e Added missing observableArray for dynamical Control loading 2015-04-15 23:20:03 +02:00
Marc f24475b996 Added ContextMenu 2015-04-15 23:18:17 +02:00
Gina Häußge c5484fe139 [Docs] Forgot to check in an image 2015-04-15 18:57:30 +02:00
Gina Häußge d5e7149f99 Merge branch 'devel' into dev/pluginLifecycleMgmt 2015-04-15 15:30:26 +02:00
Gina Häußge 29e2bbd2a7 Undo: Changes to make behaviour on mobile safari better caused issues with everything else 2015-04-15 15:30:11 +02:00
Gina Häußge c7146cf432 Merge branch 'devel' into dev/pluginLifecycleMgmt 2015-04-15 14:20:15 +02:00
Gina Häußge d58a2fd4c6 Renamed temperature and SD status timeout to interval 2015-04-15 14:19:41 +02:00
Mark Walker 5a27ab6e54 Move the centered option into printer volume
Also, modify the cura slicer to recognize the setting and avoid
adjusting the model position, just leave it in the center where it would
be on a circular platform
2015-04-15 04:05:48 -07:00
Mark Walker a4df56dcb7 Undo so we can go another way 2015-04-15 04:04:34 -07:00
Mark Walker fbe50e33d3 Add a printer profile option to allow centered origin on rectangular
beds

Some printers have (0, 0) at the center of the bed.  Circular beds
commonly, but also some rectangular beds.
2015-04-15 02:33:31 -07:00
Gina Häußge 5804825dc3 Fix: Made initial connection to printer a bit more responsive
Having to wait for the first serial timeout before sending the first M105 even when not waiting for seeing a "start" caused unnecessary wait times for reaching the "Operational" state.
2015-04-15 09:14:36 +02:00
Gina Häußge 24495d046f Renamed temperature and SD status timeout to interval 2015-04-15 09:04:54 +02:00
Gina Häußge b61996c761 __plugin_init__ => __plugin_load__ 2015-04-14 18:01:17 +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 fc00ef032e Merge branch 'devel' into dev/pluginLifecycleMgmt 2015-04-13 18:24:20 +02:00
Gina Häußge e8c085b89c Removed dependency on monotime (accidental leftover) 2015-04-13 18:22:26 +02:00
Gina Häußge 41c10a759a Better behaviour of the settings dialog on low-width devices
Navigation and content also now scroll independently from each other.

Compare #823.
2015-04-13 17:33:06 +02:00
Gina Häußge dd3455d598 Merge branch 'devel' of https://github.com/webmonger/OctoPrint into webmonger-devel 2015-04-13 13:21:23 +02:00
Mark Walker 88bc0b7a92 Show .gcode .gco and .g files in the SD file list
(cherry picked from commit e91b103)
2015-04-13 13:13:36 +02:00
Gina Häußge f480e29342 Fixed implementation/docs mismatch: header_addon -> template_header
Closes #848, thanks to @markwal for spotting and reporting
2015-04-13 12:53:19 +02:00
Mark Walker b25443d142 foosel/Octoprint #841: Can't login using IE
Add computed property "name" to function objects if not provided by the
browser, to avoid dropping out of main.js before it is finished.
(cherry picked from commit 68215c6)
2015-04-13 12:36:12 +02:00
Gina Häußge 354e064969 Only resend next line after first resend is through
Tracking the "ok" attached to a resend is necessary in order to make sure that it does not trigger the resend of the next line after the requested one right after, causing resend loops in some cases, e.g. "> 100", "> 101" , "< rs 100", "ok", "> 100", "< expected 100, got 101, rs 100" -- here the last error from the firmware could not be processed as "false negative" correctly (101 was already sent to the printer when it detected the error for 100, so this error just needs to be ignored) since the resend flag was already cleared due to line 100 and 101 having been enqueued, 100 in the resend handler, 101 due to the following ok. This patch fixes the latter, thus solving the problem.
2015-04-13 12:24:43 +02:00
Gina Häußge 594636e0e3 Make sure to operate on unicode when sanitzing sd filenames
Should fix #834
2015-04-13 12:24:42 +02:00
Jack Minardi fb99c56985 document new optional form parameters 2015-04-06 16:45:29 -04:00
Jack Minardi 426fef6e4a accept arbitrary metadata at the file upload endpoint 2015-04-06 16:45:10 -04: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 a34cbc58dc Merge pull request #828 from Voxel8/update-selected-event
update FileSelected event to be more consistent with other events
2015-04-02 22:14:12 +02:00
Jack Minardi 5eface585d update docs to reflect new payload data 2015-04-02 14:53:00 -04: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 8a3993ca59 To determine order of template components, first use user order, then default order, then type ordering
Also moved suffix calculation for template keys into _process_template_config
2015-03-31 18:22:38 +02:00
Gina Häußge c9f5476588 Settings now allow providing a custom "config" dict to work on
Can be used to always retrieve the defaults (by providing an empty config dict) or to utilize the get method with other settings than the system settings.
2015-03-31 18:20:44 +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 86cd162784 Fix: get_implementations now returns a list instead of a dict 2015-03-30 22:03:36 +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 79336ca108 Fix: Improved handling of data coming in from the printer
Hopefully closes #829
2015-03-30 13:15:52 +02:00
Jack Minardi 2478b73ee5 update FileSelected event to be more consistent with other events 2015-03-29 23:44:19 -04:00
Gina Häußge 2fa0673e0b Fix: javascript custom controls should now work again 2015-03-27 17:10:48 +01: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 9b3daeea01 Exception.message => str(Exception) 2015-03-26 12:04:05 +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 94b207257e [Doc] ok, that was not it, reverting and trying something else 2015-03-26 10:24:33 +01:00
Gina Häußge 1b6b0181c5 [Doc] quick test if the whitespace enabled code-block causes the PDF build errors on RTD or something else 2015-03-26 10:19:33 +01:00
Gina Häußge 45bf398494 [Docs] Added an example for octoprint.comm.protocol.action handler
Used same example to illustrate hook handlers within mixin implementations.
2015-03-25 19:30:49 +01:00
Gina Häußge 974e19fa3a Removed version numbers from bundled plugins
Missing version numbers will not be displayed as "(unknown)" anymore, and bundled plugins don't necessarily need their own version.
2015-03-25 18:56:59 +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 7bba22c5d2 [Doc] Include example for octoprint.comm.protocol.scripts hook 2015-03-25 18:45:32 +01:00
Gina Häußge c6e4057add [Docs] Documented octoprint.comm.protocol.gcode hook
Experimenting with including examples stored on github, let's see if RTD likes that.
2015-03-25 18:24:51 +01:00
Gina Häußge af7d2bb8c7 Utilize adaptive interval for temperature and sd status polling
This way user adjustments to those timeouts via the settings
will take immediate effect even while the connection to the
printer is already established.
2015-03-25 17:27:59 +01:00
Gina Häußge 50862668b1 RepeatedTimer now allows adaptive interval and dynamic loop condition 2015-03-25 17:24:12 +01:00
Gina Häußge 18dd1659da Fixed a typo in the RepeatedTimer docs 2015-03-25 16:52:09 +01:00
Gina Häußge 1c1e6b45b6 Added RepeatedTime class to use for repeated tasks
Utilizing it for temperature and sd status polling in comm.py
2015-03-25 16:48:30 +01:00
Gina Häußge b3739c10cc [Docs] Started documenting plugin hooks and core concepts. 2015-03-25 09:39:25 +01:00
Gina Häußge 97c8c7826c [Docs] Documented AppPlugins 2015-03-23 18:15:18 +01:00
Gina Häußge 7bf1627625 Merge branch 'master' into devel
Conflicts:
	CHANGELOG.md
	docs/api/datamodel.rst
	docs/api/index.rst
	docs/conf.py
	src/octoprint/static/js/app/viewmodels/files.js
	src/octoprint/static/js/app/viewmodels/printerstate.js
	src/octoprint/util/gcodeInterpreter.py
2015-03-23 10:58:51 +01:00
Gina Häußge 7affce2f64 Forgot to fix the Commit link 2015-03-23 10:49:35 +01:00
Gina Häußge 809c452285 Preparing release of 1.1.2 2015-03-23 10:43:42 +01:00
Gina Häußge 157408b53a Back ported some documentation from devel 2015-03-23 10:08:16 +01:00
Gina Häußge d8694107b7 Made metadata reading in client a bit more resilient against errors 2015-03-23 10:08:01 +01:00
Gina Häußge 30e43f9c41 Fixed a bug causing gcodeInterpreter to hiccup on GCODES containing invalid coordinates such as Xnan or Yinf, causing in turn the file API to fail until the offending file was deleted and its metadata removed
(cherry picked from commit ce363ce)
2015-03-23 09:51:54 +01:00
Gina Häußge 3899626870 If a tool did not extrude anything, skip it in the filament usage summary
Also targets #539
(cherry picked from commit dffa00d)
2015-03-23 09:18:52 +01:00
Gina Häußge d504157c6f Added sanity check for extruder selection in gcode files
Any T command targeting a number higher than the value specified in the settings for gcodeAnalysis.maxExtruders (defaults to 10) will be ignored and trigger a warning in the log file.

Fix for #539
(cherry picked from commit 7d5c55f)
2015-03-23 09:15:27 +01:00
Jon Carlos 917a2a528b Fix: Settings modal did not display properly on iPad and other browsers under 1200px wide 2015-03-21 22:25:26 +00:00
Gina Häußge 3ebd54d888 [Docs] sphinxcontrib.napoleon => sphinx.ext.napoleon 2015-03-20 11:39:09 +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 d198cccf75 [Docs] RTD needs a little extra help to get the code tag colors fixed... 2015-03-19 21:05:27 +01:00
Gina Häußge 05f6425a53 Fixed some documentation and implementation details on the slicing API 2015-03-19 21:03:28 +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 b17730137a [Doc] Fixed colors for code elements, no more red, also different color for links 2015-03-19 20:56:46 +01:00
Gina Häußge c12b0f5fee Removed auto slicing of STLs from watchdog
Easier to trigger via the UI
2015-03-19 20:56:03 +01:00
Gina Häußge 71fedd3be4 Fix: Don't duplicate for submission in cura profile importer 2015-03-19 20:55:32 +01:00
Gina Häußge 3299dbdc28 Merge pull request #817 from CapnBry/devel
Fix inability to set printer profile extruder feedrate from settings UI
2015-03-19 15:24:22 +01:00
Bryan Mayland 8a3fb2ac00 Fix inability to set printer profile extruder feedrate from settings UI 2015-03-19 09:28:23 -04:00
Gina Häußge 87acd4c555 Fix: don't die during locale selection if access control is disabled 2015-03-19 09:31:13 +01:00
Gina Häußge b35ee6d3db Well... apparently it does work after all, re-enabling 2015-03-18 16:50:40 +01:00
Gina Häußge 67fcb0c1a0 Disabled not working qr code in user settings again 2015-03-18 16:48:29 +01:00
Gina Häußge c51c45b46d Better handling of callbacks for /api/users/... calls 2015-03-18 16:44:22 +01:00
Gina Häußge 728951cb55 Merge branch 'devel' into dev/userlanguage 2015-03-18 16:27:21 +01:00
Gina Häußge aa0e7a6dd3 Fixed `/api/printer` which wasn't adapter yet to new internal offset data model 2015-03-18 15:54:06 +01:00
Gina Häußge ddb588e751 Language settings now work, both global and per user
Still need to test if reload of current user settings works upon change of those.
2015-03-18 15:49:29 +01:00
Gina Häußge 7b9e3efea1 Removed /dev/ttyAMA* from serial ports added by default to connection list
Added additional ports configuration to settings to make it easier for people who actually need that port in the selection to add it back.
2015-03-18 12:08:21 +01:00
Gina Häußge 590bff696b Also allow plugins to extend gcode scripts which are empty 2015-03-18 11:32:55 +01:00
Gina Häußge f98ebaafee WIP on introducing user settings (incl. interface language) 2015-03-18 11:30:08 +01:00
Gina Häußge 7bd83e7ef3 Merge branch 'devel' into dev/userlanguage
Conflicts:
	src/octoprint/users.py
2015-03-16 12:48:48 +01:00
Gina Häußge 6c8a39607b A couple more change log entries 2015-03-16 12:44:20 +01:00
Gina Häußge f79e361823 Merge branch 'dev/tornadoTimeFunc' into devel 2015-03-16 12:40:10 +01:00
Gina Häußge 89fba67eb0 Added X-Clacks-Overhead header to commemorate Sir Terry
For as long as his name is still passed along the Clacks,
    Death can't have him.
    -- "Going Postal", Chapter 4 Prologue

RIP Terry Pratchett

See also http://gnuterrypratchett.com/
2015-03-16 10:41:04 +01:00
Gina Häußge 57de36a9d3 Monkey patching tornado to backport tornadoweb/tornado#1290
Should hopefully help with freezing/blocking issues upon first connect with the net on the Pi, more tests needed.
2015-03-16 10:19:03 +01:00
Gina Häußge 91b9fb3e3f Added proper form validation to printer profile editor to the UI
Closes #809
2015-03-13 15:49:35 +01:00
Jarek Szczepanski 5cadfb5a09 Simple alert when try to overwrite existing printer profile 2015-03-13 10:08:58 +01:00
Gina Häußge 1f559049c6 Merge branch 'devel' into dev/tornadoTimeFunc 2015-03-12 19:20:17 +01:00
Gina Häußge b9102841b7 Removed accidentally committed line in requirements.txt 2015-03-12 19:19:42 +01:00
Gina Häußge 6797432f9b [doc] Move whitespace visualization up a bit
As suggested by @Mikk36
2015-03-12 18:09:24 +01:00
Gina Häußge 6c09210380 [doc] Forgot a file 2015-03-12 17:32:00 +01:00
Gina Häußge 7995858124 Merge remote-tracking branch 'origin/devel' into devel 2015-03-12 17:27:57 +01:00
Gina Häußge 699f7b5278 More work on custom controls
Added a lot of documentation, more stream lining, should now work completely without having to define types but offer the same/more functionality than before. Backwards compatible too.
2015-03-12 17:23:55 +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 46b48cb7c4 Merge pull request #807 from mrbeam/vanilla_devel
made dwelling (G4 P...) commands more tolerant, because GRBL needs floats as P value.
2015-03-10 19:32:38 +01:00
Teja 16e63824f1 made dwelling (G4 P...) commands more tolerant.
Conflicts:
	src/octoprint/util/comm.py
2015-03-10 19:20:35 +01:00
Gina Häußge 7ed9cc0f87 Merge branch 'devel' into dev/customControlsDocs
Conflicts:
	src/octoprint/static/js/app/viewmodels/control.js
2015-03-10 11:20:36 +01:00
Gina Häußge 9d761c4ee9 Make sure already processed custom controls don't get processed twice
Fixes an issue causing feedback controls to stop working if additional plugin controls are added
2015-03-10 11:19:58 +01:00
Gina Häußge a956abd65a Only display sidebar/tab if there are components within
If sidebar is present but tabs not or vice versa, it will be blown up to 100% width.
2015-03-09 13:29:51 +01:00
Gina Häußge 1a96480aa7 Allow to define additional bindings for existing view models
Adding a line such as

    OCTOPRINT_ADDITIONAL_BINDINGS.push(["gcodeFilesViewModel", "#tab_plugin_my_other_file_plugin"]);

to a plugin JS now allows the plugin to configure existing view models to bind to additional elements, not just the ones configured by the view model itself. This allows binding view models of standard components to other component types and thus "moving" components, e.g. the files dialog from the sidebar to the tab section.
2015-03-09 13:11:43 +01:00
Gina Häußge a87c3f6d4d Allow defining order of UI components through config.yaml
config.yaml now has a new section "components" located under "appearance" which allows configuring the order and list of disabled components. Example:

    appearance:
      components:
        order:
          tab:
          - control
          - temperature
          - gcodeviewer
          - terminal
          - timelapse
        disabled:
          sidebar:
          - files

 This would make the "Control" tab the first tab, followed by the usual order (plugins afterwards), and disable the Files sidebar component.
2015-03-09 12:37:07 +01:00
Gina Häußge 8cba11930f WIP: Streamlining controls to not overly depend on types anymore 2015-03-09 11:40:47 +01:00
Gina Häußge 2b51501a57 Fixed key generation for template rendering
Key was only generated correctly if a suffix was set, causing templates from plugins of the same type to override each other.
2015-03-09 10:27:10 +01:00
Gina Häußge cf05b571ac Merge branch 'master' into devel
Conflicts:
	docs/api/printer.rst
	src/octoprint/server/api/printer.py
2015-03-09 09:31:39 +01:00
Gina Häußge ad68b05f7d Fix: docs for printer resource now match implementation 2015-03-09 09:29:17 +01:00
Gina Häußge 7eb7acf3af Fixed bed temperature offsets
See #801 and guysoft/OctoPi#76
2015-03-09 09:08:07 +01:00
Gina Häußge 8f6784d5d2 WIP: streamlining and documenting custom controls 2015-03-09 08:51:49 +01:00
Gina Häußge dee205fc2f Fixed octoprint.printer.standard.select_tool
Was expecting integers although it does get a tool identifier. Also fixed docs accordingly.
2015-03-06 16:54:41 +01:00
Gina Häußge aecc7a4734 Added triggering GCODE scripts to the REST API and custom controls 2015-03-06 16:04:43 +01:00
Gina Häußge e79fd99a41 Fixed comment handling in GCODE lines, escapes are no longer stripped
A good example while late night commits can sometimes be a bad idea.
2015-03-06 11:37:06 +01:00
Gina Häußge fbca845bbd G32 also qualifies as a blocking command 2015-03-06 11:36:03 +01:00
Gina Häußge d447308ef0 Even more documentation of the internal modules 2015-03-06 01:42:49 +01:00
Gina Häußge 975cc5ccfc GCODE scripts are now Jinja templates
Refactored some things in octoprint.util.comm and octoprint.settings, added migration function to get users of the devel version up to date with their gcode scripts. Migration function will be removed again one week from now.
2015-03-06 01:42:09 +01:00
Gina Häußge d665cc9538 Fixed refreshing of timelapse file list upon finished rendering of a new one 2015-03-05 11:37:56 +01:00
Gina Häußge 8a70b5cd7f Merge remote-tracking branch 'origin/devel' into devel 2015-03-04 23:05:44 +01:00
Gina Häußge ee73e51d03 Also set heating flag when sending heatup GCODE through comm layer 2015-03-04 23:04:45 +01:00
Gina Häußge 923fe98a99 Merge branch 'dev/commExperiments' into dev/printerRefactoring
Conflicts:
	src/octoprint/util/comm.py
2015-03-04 20:43:02 +01:00
Gina Häußge 88ac1974d1 Time estimation for SD printing needs less strict thresholds 2015-03-04 20:41:10 +01:00
Gina Häußge f0b2f6d509 Fix: Display full name currently selected SD file
Wrong truncation caused first character to be missing
2015-03-04 20:39:36 +01:00
Gina Häußge edd560f5a4 Fixed a bug causing feed rate adjustment to not work while printing 2015-03-04 20:38:49 +01:00
Gina Häußge c7cccb2ce5 Prevent multiple copies of poll commands in send queue
Utilizes a "TypedQueue" which tracks command types - if provided - and doesn't
add entries of the same type as another entry in the queue.

Somewhat backported from dev/commRefactoring branch
2015-03-04 20:38:15 +01:00
Gina Häußge 8092ff7e62 Workaround a bug in old versions of Marlin
For some versions, the ok for a file delete message is not prepended
by a newline: "File Deleted:<filename>ok"

This work around will make it still detectable.
2015-03-04 20:35:10 +01:00
Gina Häußge b1129332c9 Detect external heatup
If a line "T: <temperature>" comes in, the printer is heating up although
we don't know why. Nevertheless count the time.
2015-03-04 20:33:44 +01:00
Gina Häußge cc4d13e1ce Fix issue with rewinding SD files
Sometimes M26 S0 does not cause a selected SD file to be
properly rewound, leading to issues when restarting the
print job. Reselecting the file (and ignoring the
resulting select event) solves this.
2015-03-04 20:31:51 +01:00
Gina Häußge bcc724df2c Merge pull request #793 from imrahil/fix_in_apidocs
Fixed docs for BlueprintPlugin
2015-03-04 16:59:33 +01:00
Gina Häußge 116a540abd More experimenting with comm queueing, seems to work fine now
Next up: actual print
2015-03-04 14:15:01 +01:00
Gina Häußge 4383a89091 _heatupWaitStartTime should be reset to None instead of 0 2015-03-04 10:29:29 +01:00
Gina Häußge 801f9adfd7 Further experiments with send_queue and polling timers 2015-03-04 10:20:13 +01:00
Gina Häußge 383f36fc48 Backported clear_to_send mechanism from commRefactoring
Also added temperature and sd status polling timers
2015-03-04 09:45:51 +01:00
Gina Häußge 9ec49d6273 Merge branch 'devel' into dev/printerRefactoring 2015-03-03 17:05:29 +01:00
Gina Häußge 7e4cc68492 Fixed SD handling of virtual printer 2015-03-03 17:03:32 +01:00
Gina Häußge 333c9ba205 Refactoring of "printer" modules
- renamed methods from camelCase to snake_case
- renamed callback mathods from comm module from camelCase to snake_case
- extracted and documented public interface to be used by plugins
- extracted callback interface to be implemented by subscribed callbacks to printer
 - moved standard implementation to custom package
 - moved time estimation classes to custom package
2015-03-03 17:01:33 +01:00
Gina Häußge af0cad90a8 Made drag-n-drop better usable on high resolutions
Now stop complaining.

Closes #187
2015-03-03 16:39:27 +01:00
Gina Häußge 6cf84a0bc4 Added a lot of changelog entries 2015-03-03 10:52:41 +01:00
Gina Häußge b8e5019e24 Corrected a merge error that broke the system menu display
Closes #797
2015-03-02 22:41:37 +01:00
Gina Häußge 60882d9a5c Don't consider it a disconnect until after some failed direct tries to reconnect
Should solve issues where the "Disconnected" dialog briefly appears when the connection gets interrupted only briefly, e.g. when starting a timelapse download in Firefox.
2015-03-02 22:20:27 +01:00
Gina Häußge 18b2b7dfe8 Fixed warnings in documentation build 2015-03-02 16:03:37 +01:00
Gina Häußge 8da9f55b05 Merge branch 'devel' into dev/gcodeScripts 2015-03-02 15:40:20 +01:00
Gina Häußge 3820f7b275 Added download link for STLs to the file list 2015-03-02 15:34:48 +01:00
Gina Häußge befe2e7bee Allow adding slicing profiles for unconfigured slicers and properly reload slicing view model upon configuration
This should fix the problem where on a fresh setup it was impossible to upload slicing profiles for Cura before
the path to the binary was configured.

Also made the slicing dialog auto update available slicers when the settings are updated. The slicing button
in the file list is now only active if a slicer is available. The slicing dialog will only show upon upload of
an STL file if a slicer is available.

Closes #795
2015-03-02 15:34:29 +01:00
Gina Häußge 36a837cd77 Always allow uploading STL files, even if no slicer is configured yet 2015-03-02 15:30:03 +01:00
Gina Häußge db382e39a7 setup.py: Always include develop dependencies on RTD 2015-03-02 15:17:53 +01:00
Gina Häußge cef4683082 Travis should use the develop flavor for install so that tests can run 2015-03-02 13:15:46 +01:00
Gina Häußge 778a38a668 Added [develop] extra to setup.py to install development dependencies
Use

    pip install -e .[develop]

 to prime your environment for development, this will install all requirements both for running as well as for development tasks (such as running unit tests or compiling the documentation) and register OctoPrint as an editable python package as well.
2015-03-02 13:15:00 +01:00
Gina Häußge 19114d1073 Use fully qualified import for plugin manager in file manager to simplify unit testing 2015-03-02 13:01:13 +01:00
Gina Häußge e702736455 Updated/fixed unit tests and travis configuration 2015-03-02 12:58:24 +01:00
Jarek Szczepanski 49fbe75387 Fixed docs for BlueprintPlugin 2015-03-01 21:46:21 +01:00
Gina Häußge 06f14045ad CSS recompiled 2015-03-01 14:31:38 +01:00
Gina Häußge a88a781d38 Merge branch 'devel' into dev/gcodeScripts 2015-03-01 14:28:09 +01:00
Gina Häußge c3834c16fa Merge branch 'devel' into dev/gcodeScripts
Conflicts:
	CHANGELOG.md
	src/octoprint/static/css/octoprint.css
	src/octoprint/static/js/app/viewmodels/timelapse.js
	src/octoprint/util/comm.py
2015-03-01 14:11:43 +01:00
Gina Häußge dec9f47aa6 New transparent toggle in appearance settings
Allows color matching your OctoPrint instance to your printer even if it uses semi-transparent colored acrylic ;)
2015-02-28 23:43:30 +01:00
Gina Häußge 4dc570779d Merge branch 'devel' of https://github.com/nophead/OctoPrint into nophead-appearance 2015-02-28 13:33:36 +01:00
Chris Palmer a9f1c3711a Bigger trans-background image 2015-02-28 09:46:03 +00:00
Chris Palmer 7ff03d2e75 Fixed trans-background image 2015-02-28 09:34:28 +00:00
Chris Palmer 97f4fabd48 Added missing trans-background image 2015-02-28 09:10:50 +00:00
Chris df49bf4cf3 Merge pull request #1 from thinkl33t/devel
Bobs transparent mods
2015-02-28 00:43:52 +00:00
Gina Häußge cd3ead3f30 More documentation 2015-02-27 20:28:24 +01:00
Bob Clough 06850dd775 Added gradient to transparent header background, compiled + minified CSS 2015-02-27 17:39:40 +00:00
Bob Clough 47a58a73e4 Added transparent header background, compiled + minified CSS 2015-02-27 17:19:38 +00:00
Bob Clough 6665332359 Added compiled octoprint.css that includes white as an option 2015-02-27 17:05:16 +00:00
Bob Clough b0b594c5f8 Added class for white 2015-02-27 16:49:42 +00:00
Chris Palmer a74ce57d24 Added white to avialable appearance colours 2015-02-27 11:10:22 +00: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 0a92b340ac Refactoring in octoprint.util
* Renamed a couple of camelCased methods to snake_case
  * Moved to better location what didn't make sense in the common util module
2015-02-27 10:28:16 +01:00
Gina Häußge c76b84e1be Fixed file not found error when selecting a local file for printing
Introduced by 8bef18c2a8

Reported in #788
2015-02-27 01:37:37 +01:00
Gina Häußge 619548d8e3 Trying to fix the stylesheet on RTD again 2015-02-26 18:33:03 +01:00
Gina Häußge 8bef18c2a8 Fix handling of SD card files in folders
OctoPrint got confused by prepended / in files on printer's SD cards
located within folders.

New handling makes comm always use absolute path names for SD card
file names (even those in the root), printer converts between
this representation and the storage interface compatible version
of file and folder names being stated relative to the root (so
no leading /)
2015-02-26 18:24:10 +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 54b7959f89 Merge branch 'devel' of github.com:foosel/OctoPrint into devel 2015-02-26 11:48:48 +01:00
Gina Häußge ed11da4903 Merge branch 'Mikk36-dev/ffmpegThreads' into devel 2015-02-26 11:48:37 +01:00
Gina Häußge 942c916df5 Added tool tips for webcam options
Also fixed label element references
2015-02-26 11:47:55 +01:00
Gina Häußge 3ea3d8c19f Merge pull request #784 from DanLipsitt/feature/manifest-setup-reqs
Include files required by setup.py in sdist.
2015-02-26 11:39:58 +01:00
Mikk Kiilaspää a4d83c33ec Add an option to specify the amount of encoding threads for FFMPEG 2015-02-25 23:50:00 +02:00
Dan Lipsitt 0ac6f0fa93 Include files required by setup.py in sdist. 2015-02-25 12:28:44 -08:00
Gina Häußge 141725d002 Merge branch 'Mikk36-devel' into devel 2015-02-24 19:47:11 +01:00
Gina Häußge 07987dad46 Proper default values for interval in server on API 2015-02-24 19:46:55 +01:00
Gina Häußge 90dda10ca0 Proper default values for timelapse settings when no settings available from server 2015-02-24 19:46:24 +01:00
Gina Häußge 2250fea68a Changed location of fps configuration setting in timelapse config 2015-02-24 19:28:50 +01:00
Gina Häußge 0bf9be8be9 Added change log entry 2015-02-24 19:27:20 +01:00
Gina Häußge fcc6a8c4c3 Changed wording for timelapse fps configuration a bit 2015-02-24 19:24:50 +01:00
Gina Häußge ebbcd28536 Fixed a client side range check for timelapse fps 2015-02-24 19:24:32 +01:00
Gina Häußge b273e06e88 Server side range checking for timelapse config 2015-02-24 19:24:11 +01:00
Mikk Kiilaspää 197859b675 Fix v2 for response parsing 2015-02-24 20:00:58 +02:00
Mikk Kiilaspää f5ece9b5b4 Add the option to change timelapse fps 2015-02-24 19:39:29 +02:00
Mikk Kiilaspää f0a71acf98 Fix response parsing 2015-02-24 17:48:15 +02:00
Gina Häußge 478b4f9550 Muted style of "Hint:" message in Files sidebar and Control tab 2015-02-24 14:15:33 +01:00
Gina Häußge e9623fdc36 Improved behaviour of terminal window
* Disabling autoscrolling now also stops cutting of the log while it's enabled, effectively preventing log lines from being modified at all
  * Applying filters displays "[...]" where lines where removed
  * Added a link to scroll to the end of the terminal log (useful for when autoscroll is disabled)
  * Added a link to select all current contents of the terminal log for easy copy-pasting
  * Added a display of how many lines are displayed, how many are filtered and how many are available in total

Closes #735
2015-02-24 14:14:52 +01:00
Gina Häußge a6e5ea268b Fixed timelapse postroll settings
* Changing Timelapse post roll activates save button
* Timelapse post roll is loaded properly from config
(cherry picked from commit e1d7573)
2015-02-24 11:09:17 +01:00
Gina Häußge e1d75736e7 Fixed timelapse postroll settings
* Changing Timelapse post roll activates save button
* Timelapse post roll is loaded properly from config
2015-02-24 11:08:23 +01:00
Gina Häußge 3dc7f8cd7c Fixed a merge error 2015-02-24 09:35:35 +01:00
Gina Häußge e19b0d2a49 Merge branch 'devel' into dev/gcodeScripts
Conflicts:
	src/octoprint/static/css/octoprint.css
	src/octoprint/static/js/app/main.js
	src/octoprint/static/js/app/viewmodels/settings.js
2015-02-24 09:32:46 +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 2fac5c76d9 Fixed styling of tables in docs 2015-02-23 22:15:04 +01:00
Gina Häußge bb0a607891 Fixed gcode and terminal view models not properly handling missing elements 2015-02-23 21:41:19 +01:00
Gina Häußge b401d957e5 Tabs now overflow into a tabdrop instead of wrapping 2015-02-23 21:40:55 +01:00
Gina Häußge 1c931a65e7 Asset injection for core components now uses same mechanism as plugins 2015-02-23 21:40:17 +01:00
Gina Häußge b9fd3dda7d Added onAfterTabChange callback, fixed tab switching this way
Both temperature graph and terminal need to be updated AFTER the tab has been switched (onAfterTabChange) not before (onTabChange).
2015-02-23 14:55:43 +01:00
Gina Häußge 8b4b5fb058 Documented slightly changed view model registration
Still backwards compatible though!
2015-02-23 14:00:14 +01:00
Gina Häußge 3a41ec2e20 Refactored view models, switched from underscore to lodash
Also added loglevel.js to allow for level based logging and added sprintf.js separately
2015-02-23 13:54:40 +01:00
Gina Häußge cc975f77aa Removed broken source map links in jquery.min.js and underscore-min.js
Should get rid of *.min.map 404s
2015-02-23 10:43:44 +01:00
Gina Häußge 81ef3d1e02 Fixed new slider controls
Needed proper observables to work
2015-02-22 22:26:05 +01:00
Gina Häußge 09ecd68fde Parametric commands for custom controls can now define sliders instead of input fields 2015-02-22 22:19:43 +01:00
Gina Häußge 60a747620c Bit more error resilience for the gcode viewer ui elements 2015-02-22 21:49:33 +01:00
Gina Häußge 4abcf1054b Added controls for changing feed and flow rate factors to Controls tab
Closes #362
2015-02-22 21:20:56 +01:00
Gina Häußge e476e4154e Added custom control type for rows of controls
This allows horizontal placement of buttons. Custom controls in rows can have specified two new attributes: width which is the width of their container in the bootstrap 12-slot grid, and offset to specify offsets to the former control on the row.
2015-02-22 16:42:26 +01:00
Gina Häußge 4829c21db7 Merge branch 'master' into devel 2015-02-22 16:03:08 +01:00
Gina Häußge d974ab0979 Forgot a changelog entry (again)
(cherry picked from commit 2111a06)
2015-02-22 15:38:44 +01:00
Gina Häußge 2111a06ce3 Forgot a changelog entry (again) 2015-02-22 15:37:37 +01:00
Gina Häußge 32ebec3d3c Fixed problem that broke SD printing 2015-02-22 15:34:14 +01:00
Gina Häußge 89d972ff40 Always make sure to (re)set file position to the beginning when starting SD card prints
Closes #780
(cherry picked from commit 5c35a28)
2015-02-22 15:24:48 +01:00
Gina Häußge 5c35a288a3 Always make sure to (re)set file position to the beginning when starting SD card prints
Closes #780
2015-02-22 15:15:45 +01:00
Gina Häußge ad23c88347 Merge remote-tracking branch 'origin/devel' into devel 2015-02-20 19:02:00 +01:00
Gina Häußge f60435aca4 Also allow downloading of STL files from server 2015-02-20 19:01:14 +01:00
Gina Häußge 9d3dee7bf3 Ping pong sending to fix acknowledgement errors
Might be a good solution for people affected by #166, #470, #490 until commRefactoring branch is ready for prime time. No solution for #553 since that needs proper queueing and blocking command detection.
2015-02-20 18:48:15 +01:00
Gina Häußge 5af6f0e7cb Possible fix for the resend issue backported from commRefactoring branch 2015-02-20 14:34:05 +01:00
Gina Häußge 8711702cf5 Temperature polling fixed, virtual printer having issues with resends
TODO:
- solve virtual printer resend issues
- document hook
2015-02-19 23:04:47 +01:00
Gina Häußge 1e6679c40c Corrected some merge errors, got gcode scripts to work, broke temperature polling in the process
TODO:
- Fix temperature polling
- Document new hook octoprint.comm.protocol.scripts
2015-02-19 22:32:20 +01:00
Gina Häußge 578f77a411 Merge pull request #775 from matobago/patch-1
Error messages show the proper name of the objects
2015-02-18 22:03:14 +01:00
Marcel 61c4a8b635 Error messages show the proper name of the objects
Just try to figure out why some binding wasn't working on my version and came out with this small change
2015-02-18 12:07:36 -08:00
Gina Häußge 654e255b68 Merge branch 'devel' into dev/gcodeScripts
Conflicts:
	src/octoprint/server/__init__.py
	src/octoprint/server/api/settings.py
	src/octoprint/static/css/octoprint.css
	src/octoprint/static/js/app/viewmodels/settings.js
2015-02-18 17:18:22 +01:00
Gina Häußge 28738a5179 More documentation and unit tests 2015-02-18 17:16:37 +01:00
Gina Häußge 258b824ff8 self._printer in plugins now allows direct access to the transport object (serial instance in most cases) 2015-02-17 21:53:45 +01:00
Gina Häußge 7438ba1eea Merge remote-tracking branch 'origin/devel' into devel 2015-02-17 14:26:52 +01:00
Gina Häußge 3c33401b48 GCODE viewer: Only try to instantiate sliders if their elements are available 2015-02-17 13:51:34 +01:00
Gina Häußge 9aa45041f6 View models can now implement getAdditionalControls to add controls to the control tab
Controls may now contain a new property "javascript" which may be either a javascript function to be called when the control is executed, or a string to be eval'd when the control is executed. If it is a function, it will be called with the config of the custom control as single parameter "data". If it is a string it will be eval'd within a function context providing the custom control configuration as variable data.

Additionally controls may contain a new property "enabled", which may also be either a javascript function or a string to be eval'd. The custom control config will be available to the enabled code as described above. The code is expected to return true if the component should be enabled or false if not.
2015-02-17 13:51:05 +01:00
Gina Häußge 56bce984fa Merge pull request #673 from fjriosp/reconnect_fix
BugFix to Reconnect on Debian
2015-02-17 09:42:42 +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 7de90e16f6 And of course I forgot a file again and overlooked a typo... 2015-02-12 13:34:57 +01:00
Gina Häußge cad4e2f6dc Update some line numbers 2015-02-12 13:31:12 +01:00
Gina Häußge 4d5443ed6b Finalized plugin tutorial (for now) 2015-02-12 13:29:00 +01:00
Gina Häußge 00760ef1b3 If plugins only provide LESS or CSS files, they should still be properly included in the page regardless of stylesheet mode
Up until now OctoPrint would not include anything for plugins which didn't provide LESS files but CSS files when in LESS mode (and vice versa). This is not rectified to make development a bit easier and less restrictive - if a plugin author doesn't want to use LESS but just plain CSS, that's now fine too.
2015-02-12 13:28:37 +01:00
Gina Häußge 65557f670a Fixed copy paste error from way back 2015-02-11 12:26:18 +01:00
Gina Häußge 9cdb273cbc Tooltips for the serial connection settings 2015-02-11 12:22:41 +01:00
Gina Häußge 4fede5a9c6 Merge remote-tracking branch 'origin/master' 2015-02-10 18:41:24 +01:00
Gina Häußge 7971bc91b2 Always send commands with checksum when printing
(cherry picked from commit 3ee745d)
2015-02-10 18:40:41 +01:00
Gina Häußge eb4156c02e Directly update color coding for success/failure in file list after finishing a print job 2015-02-10 10:55:47 +01:00
Gina Häußge faccba1c86 Fix the system menu again (stupid comma...) 2015-02-09 21:43:15 +01:00
Gina Häußge d3a00fc887 Properly disable UI elements again after change in templating 2015-02-09 16:12:07 +01:00
Gina Häußge 5c756768c8 Merge pull request #759 from mrbeam/vanilla_devel
bugfix. initialize counter for plugins of type generic.
2015-02-07 21:15:47 +01:00
Teja 7b92fb27c0 bugfix. initialize counter for plugins of type generic. 2015-02-07 19:23:07 +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 ec7feb1a3c Possible workaround for OctoPrint stalling when a clock change happens while it is running 2015-02-05 11:12:03 +01:00
Gina Häußge e899050517 Rudimentary multi pass dependency resolution for view models
Largely based on a patch by @mrbeam - big thanks for that!
2015-02-03 22:23:32 +01:00
Gina Häußge d8dffc9dd3 Fall back to unmodified default profile if the overridden version is invalid 2015-02-03 11:46:30 +01:00
Gina Häußge 5a68d26d59 We now depend on sarge >= 0.1.4 2015-02-03 11:45:26 +01:00
Gina Häußge d5abf3f0f5 Merge remote-tracking branch 'origin/devel' into devel 2015-02-03 10:18:31 +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 2da952e7ff Merge remote-tracking branch 'origin/devel' into devel 2015-02-01 17:27:53 +01:00
Gina Häußge ce363ce409 Fixed a bug causing gcodeInterpreter to hiccup on GCODES containing invalid coordinates such as Xnan or Yinf, causing in turn the file API to fail until the offending file was deleted and its metadata removed 2015-02-01 17:27:12 +01:00
Gina Häußge 2523cf81ba Merge pull request #752 from Diaoul/patch-1
Fix logger call for gcode multi commands events
2015-02-01 12:59:56 +01:00
Antoine Bertin 8a61e4517f Fix logger call for gcode multi commands events 2015-02-01 11:05:37 +01:00
Gina Häußge cc9e495042 Extracted common CSS styles for action button columns in various tables into LESS mixin
.actioncol now sets text align to center, color of contained links to black and disables wrapping on whitespace (thanks to @Renha for that one)
2015-01-31 17:10:32 +01:00
Gina Häußge 8f8b66fbff Merge pull request #742 from Renha/devel
Fixed wrapping of Icons at Action column in Access Controll settings page
2015-01-31 16:36:58 +01:00
Gina Häußge 8bfa3ef250 Adjusted discovery plugin to new blueprint and settings functionality for plugins 2015-01-30 22:22: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 2f5e955367 Fixed an issue causing slicing not to work due to a change in how the used sarge library works
Starting commands asynchronously now necessitates a call to Pipeline.wait_events in order to be able to access the started Command instances. Not waiting causes the list of commands to be not fully populated and hence issues with code depending on that stuff being present.
2015-01-30 21:47:48 +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 e6a0019cc7 Forgot to commit an image for the documentation 2015-01-30 13:56:41 +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 998420312e Adjusted CuraPlugin to use new blueprint and settings mechanisms for plugins 2015-01-30 13:24:34 +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 e1e47abfbe Fixed selecting the first dialog in the settings dialog upon first opening it 2015-01-30 09:28:41 +01:00
Gina Häußge 8c2214fc09 Ordering of injected templates decoupled from template content
Internal templates get handled the same way as those from plugins. Plugins may also in theory now replace existing internal templates, however for that to not cause any errors on the client side due to missing expected elements that will for now stay an undocumented feature.
2015-01-29 16:39:09 +01:00
Gina Häußge 250d71b580 Added server side caching of main page
Index page will now be cached for up to five minutes, unless the
request contains "_refresh" in the query or the Cache-Control header
contains no-cache
2015-01-29 16:37:20 +01:00
Gina Häußge 151864f1d4 Always send responses to POST requests with Cache-Control: no-cache 2015-01-29 16:36:08 +01:00
Gina Häußge f4df354cd0 Removed left overs from former cura integration 2015-01-28 15:36:44 +01:00
Gina Häußge b4068f36e1 Highlighted changed lines 2015-01-27 16:08:10 +01:00
Gina Häußge 4223d48edd Docs: Started on a basic plugin tutorial 2015-01-27 14:21:41 +01:00
Gina Häußge f32c977381 Update CONTRIBUTING.md 2015-01-27 09:53:09 +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 c3bb575b48 Added plugin metadata to bundled plugins 2015-01-26 22:22:19 +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
Артем Груничев 344a505903 Icons at Action column in Access Controll settings page are now wrapped correctly with any translation language; regenerated .css file according to .less one. 2015-01-26 17:24:37 +03: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 4b60475a02 Also properly inject printer into plugin implementations (as self._printer) 2015-01-26 12:48:07 +01:00
Gina Häußge 2de863c5db Update CONTRIBUTING.md 2015-01-23 12:50:34 +01:00
Gina Häußge 09e5676009 Update CONTRIBUTING.md 2015-01-23 12:30:02 +01:00
Gina Häußge 657629183b Custom 400 response if requests that need json don't contain proper json 2015-01-22 17:59:31 +01:00
Gina Häußge 9cefd06655 Added missing pagination for printer profiles 2015-01-22 17:57:25 +01:00
Gina Häußge ac549770ee Move onStartup call to before any bindings getting applied 2015-01-22 16:56:42 +01:00
Gina Häußge 22623fb0b6 Allow setting the default printer profile when creating a new one 2015-01-20 15:17:49 +01:00
Gina Häußge 98ac877033 Merge branch 'master' into devel
Conflicts:
	CHANGELOG.md
2015-01-19 16:48:51 +01:00
Gina Häußge 5f835edf2e Changelog entries for #706 and #719 2015-01-19 16:48:03 +01:00
Gina Häußge 83790fcd64 Do not truncate error reported from printer in UI
Closes #706
2015-01-19 16:42:09 +01:00
Gina Häußge 6dd2dcee16 GCODE viewer: Even better version of initial bed centering, backported from c858c8f75b
See #719
2015-01-19 16:34:40 +01:00
Gina Häußge a91a354fa9 Fixed a bug causing the GCODE viewer to be zoomed in outside of the print bed due to missing initial move
Possible fix for #719
2015-01-19 16:26:52 +01:00
Gina Häußge 4bf3d698e3 Fixed some changelog entries and added commit history to unreleased 1.1.2 2015-01-19 15:52:20 +01:00
Gina Häußge e3cba0d4c2 Adjusted to new template structure. WIP!
Problems:
- timeout upon print start due to first line not being properly sent apparently
- extruder count not taken from printer profiles yet (which are not available on comm layer), hence wrong end code
2015-01-19 15:40:23 +01:00
Gina Häußge 83204eda3b Merge branch 'devel' into gcodeScripts
Conflicts:
	src/octoprint/printer/__init__.py
	src/octoprint/static/css/octoprint.css
	src/octoprint/static/less/octoprint.less
	src/octoprint/templates/settings.jinja2
2015-01-19 15:25:11 +01:00
Gina Häußge 67a884fc9d Added a lot of changelog entries 2015-01-19 13:18:43 +01:00
Gina Häußge 6e315cff76 Changelog entry for #724 2015-01-19 12:37:31 +01:00
Gina Häußge 146128730c Fixed timelapse deletion
Was broken after switching to new file name sanitizing with the new file management layer, still stripped everything but ascii from the filename although timelapse file names may actually contain more than that character set since the gcode file names they are based off may too.

Closes #724
2015-01-19 12:34:25 +01:00
Gina Häußge 1daa6df346 Added exception logging for event bus worker loop 2015-01-19 12:13:04 +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 039285ffae Fixed babel_refresh command as suggested in #726
Thanks to @derpicknicker1 for report and suggested fix.

 Closes #726
2015-01-18 13:57:17 +01:00
Gina Häußge b28f511b92 Small addendum and changelog entry for #717 2015-01-16 21:49:01 +01:00
Gina Häußge 19df1aed17 Merge pull request #717 from Renha/devel
Bugfix for Invalid cross-device link on Linux when /tmp is on another fs
2015-01-16 21:24:31 +01:00
Gina Häußge 9452ba4c24 Fixed heated bed temperature setting during slicing with Cura 2015-01-16 19:58:46 +01:00
Gina Häußge 98a28cc4e9 Merge branch 'dev/templateRefactoring' into devel 2015-01-16 17:15:36 +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
Gina Häußge 5180fc70d2 Changed how TemplatePlugin works
get_template_vars get split into get_template_vars (for injection additional template variables only) and get_template_configs (for configuring injection of additional template). It's now possible to inject more than one of a given template type from within plugins, and template injection is more intelligent in that if a plugin's templates don't need special configuration and stick to default naming and behaviour, just declaring them inside the templates directory of the plugin will be enough to fire up everything including links to switch to tabs, sidebars etc (the plugin's name being used in such cases for link text).
2015-01-16 11:54:34 +01:00
Gina Häußge 19fe770606 Forgot to inject plugin manager... 2015-01-15 16:51:55 +01:00
Gina Häußge f52afb8660 Fixed translation feels not being properly copied over during installation
Should solve initial problem reported in #720
2015-01-15 16:28:22 +01:00
Gina Häußge f2e98265e7 Fix generic plugin includes again (was still depending on a removed variable) 2015-01-15 15:13:55 +01:00
Gina Häußge bb7aa6544f Adjusted bundled Cura plugin to not define already defined folder paths again, now included automatically 2015-01-15 14:53:23 +01:00
Gina Häußge 2324a1bf0e Correctly set custom element styles on navbar and tab items 2015-01-15 14:42:58 +01:00
Gina Häußge ca278985b0 Correctly set selected element on first load in settings 2015-01-15 14:42:27 +01:00
Gina Häußge 4a9be80c98 Fixed login dialog again 2015-01-15 14:21:32 +01:00
Gina Häußge 23387d6e48 More work on the template refactoring and new template plugin types 2015-01-15 11:06:59 +01:00
Renha 6cf0550312 Bugfix for Invalid cross-device link on Linux when /tmp is on another fs 2015-01-13 22:24:35 +00:00
Gina Häußge 73466bb513 Merge branch 'devel' into dev/templateRefactoring 2015-01-13 18:27:10 +01:00
Gina Häußge b0805a9bae Forgot to commit some files (argh) 2015-01-13 18:20:45 +01:00
Gina Häußge f9fd4f9009 WIP: refactoring of templates 2015-01-13 18:20:13 +01:00
Gina Häußge 5b6b8b6ad1 And some more moving around of templates 2015-01-13 11:49:28 +01:00
Gina Häußge 8aede1dfe4 Moved settings components into individual template files as well 2015-01-13 11:31:45 +01:00
Gina Häußge 77cdb7bf43 Moved navbar, sidebar and tab contents from index.jinja2 into individual files 2015-01-13 11:20:37 +01:00
Gina Häußge 6880184cbb Increased default communication and connection timeouts 2015-01-13 11:09:42 +01:00
Gina Häußge 84122f9f54 Fixed changelog entry for last commit, was added to wrong section 2015-01-13 11:09:41 +01:00
Gina Häußge c52d201808 Fix error where API state is requested and printer is offline
(cherry picked from commit 619fe9a)
2015-01-13 11:09:41 +01:00
Gina Häußge 466866c323 Merge remote-tracking branch 'origin/devel' into devel 2015-01-13 10:32:59 +01:00
Gina Häußge be8ffeb724 WIP: Some documentation of plugins 2015-01-13 10:31:56 +01:00
Gina Häußge 868dc6d7a9 Increased default communication and connection timeouts 2015-01-12 17:34:08 +01:00
Gina Häußge 1ddb187518 Fixed changelog entry for last commit, was added to wrong section 2015-01-12 17:25:02 +01:00
Gina Häußge b7badcbf02 Fix error where API state is requested and printer is offline
(cherry picked from commit 619fe9a)
2015-01-12 16:55:38 +01:00
C-o-r-E 684d12e60e Fix error where API state is requested and printer is offline
(cherry picked from commit 619fe9a)
2015-01-12 16:53:17 +01:00
Gina Häußge 4e4ad0be8b Fixed file sending to SD card
Closes #709
2015-01-12 16:00:37 +01:00
Gina Häußge f238ef40ec Better error validation for printer profiles
Data types loaded from disk were not properly ensured to match expected types and input validation also had deficits.

Should fix #714
2015-01-12 15:07:14 +01:00
Gina Häußge f5eef06e88 Fixed wrong variable name
Closes #715
2015-01-12 10:45:39 +01:00
Gina Häußge 76f7a40b7f Added changelog entry for PR #610 2015-01-12 09:59:51 +01:00
Gina Häußge 778d3f2853 Merge remote-tracking branch 'origin/devel' into devel 2015-01-12 09:46:15 +01:00
Gina Häußge 2ba681573f Key controls are now enabled when you mouse over the webcam picture, indicated by an overlay
Also moved key control help in that overlay
2015-01-12 09:40:45 +01:00
Gina Häußge edafee7b22 Added setting to enable/disable the keycontrol feature 2015-01-12 09:37:52 +01:00
Gina Häußge 52056b0eeb Merge branch 'devel_keycontrol' of https://github.com/nEuDy/OctoPrint into nEuDy-devel_keycontrol
Conflicts:
	src/octoprint/static/css/octoprint.css
2015-01-10 13:56:51 +01:00
Gina Häußge 5a3df191a5 Merge pull request #712 from rspeed/sigterm-fix
Daemon cleans up pidfile when receiving a SIGTERM
2015-01-10 12:32:30 +01:00
Rob Speed 062131a10e Renamed delpid to term to better match its modified behavior. Moved the registration of the SIGTERM handler to avoid an extremely unlikely race condition. 2015-01-10 01:34:47 -08:00
Rob Speed 6c78049886 Fixes issue where a daemonized OctoPrint doesn't clean up after itself after receiving SIGTERM. 2015-01-10 00:24:25 -08:00
Gina Häußge 3d5fdf2a91 Fixed bug that caused SSDP discovery not to work anymore
Blueprint was protected by API key which lead to the discovery.xml
file not being retrievable.
2015-01-01 01:52:41 +01:00
Gina Häußge c9c4066331 Fixed a bunch of doc issues, updated /api/printer/command to have more meaningful error messages 2014-12-31 15:47:12 +01:00
Gina Häußge 835b973bdc Merge branch 'patch-1' of https://github.com/bortek/OctoPrint into devel
Conflicts:
	docs/api/printer.rst
2014-12-31 15:19:18 +01:00
Gina Häußge bf6a32907c Ported possibility to set external host via headers from reverse proxy to the devel branch 2014-12-31 15:09:31 +01:00
bortek 2b7885c3f8 Update printer.rst 2014-12-30 12:18:39 +01:00
Gina Häußge 749af60796 Merge branch 'master' into devel
Conflicts:
	src/octoprint/server/util.py
	src/octoprint/settings.py
	src/octoprint/templates/index.jinja2
2014-12-30 10:49:03 +01:00
Gina Häußge 87ddcac2fc Don't user server.host but server.forwardedHost as fallback for generated external URLs
Closes #698
2014-12-30 10:20:50 +01:00
Gina Häußge e3383fe4c1 Generated URLs now take X-Forwarded-Host header sent by proxies into account for included host and port 2014-12-29 20:48:33 +01:00
Gina Häußge 292856e1bd Fixed relative URL to sockjs endpoint, wasn't yet using the proper base url 2014-12-29 20:45:54 +01:00
Gina Häußge 3dacaaf03a Merge branch 'master' into devel 2014-12-28 00:20:11 +01:00
Gina Häußge 6307b765e3 Only decrement the image counter if it is set and larger than 0
Backported from devel
2014-12-28 00:19:55 +01:00
Gina Häußge eb2561175d Merge branch 'master' into devel
Conflicts:
	setup.py
	src/octoprint/timelapse.py
2014-12-28 00:18:49 +01:00
Gina Häußge a30e41f0b4 Timelapses: Do not try to use image counter if still set to None and synchronize decrementing of image counter via mutex as well
Possible fixes for #693, the latter maybe also for #690
2014-12-28 00:12:19 +01:00
Gina Häußge 51341f6722 Added removal of pyc files (and their parent folders if they are empty after that) to the python setup.py clean command
(cherry picked from commit 9e014eb)
2014-12-28 00:00:57 +01:00
Gina Häußge fb15751703 Decrease image counter if an image could not be captured from webcam
Should keep rendering of timelapse from breaking if only a couple of images couldn't be captured due to whatever reason. Suggested by @midopple in #344
(cherry picked from commit bf9d5ef)
2014-12-27 23:55:23 +01:00
Gina Häußge a0105bcb2f Better error handling for capture issues during timelapsing
Should help debugging issue #425 and any future problems in that area.
(cherry picked from commit 1a7a468)
2014-12-27 23:52:38 +01:00
Gina Häußge 103e0796b7 Request available slicers and slicing profiles from backend asynchronously when opening the slicing dialog
Should make sure that slicers and new profiles are detected correctly even without reload.

Could maybe help with #689
2014-12-21 15:57:23 +01:00
Gina Häußge 363b23d6e3 Better handling of errors while sending to (disconnected) clients on the websocket 2014-12-21 15:47:24 +01:00
Gina Häußge 52ad02a08a Updated the changelog with a lot of stuff that gone done the past weeks 2014-12-21 15:32:30 +01:00
Gina Häußge 977cf3c383 Added handler for uncaught exceptions to make sure those get logged 2014-12-21 15:32:07 +01:00
Gina Häußge 827ea36d72 Merge remote-tracking branch 'origin/devel' into devel 2014-12-21 15:16:34 +01:00
Gina Häußge 46b0367335 Log a message to octoprint.log if Cura is not fully configured and hence not available for slicing yet.
As suggested in #689
2014-12-21 15:15:59 +01:00
Gina Häußge 596afddfb6 Merge pull request #685 from Bevaz/bug_video_output_filename
Enframed output video filename with quotes.
2014-12-20 18:05:50 +01:00
Gina Häußge 256c2dfdbe More error resilient handling of .metadata.yaml writes in local storage
Writes updated metadata to a backup file first and then copies it atomically (at least under anything that is not windows where the operation is a bit more complicated and hence not atomic)
2014-12-20 01:06:40 +01:00
Gina Häußge 0737ee65bd Support action: commands sent from printer, for now only pause, resume and disconnect are supported, plus a new hook "octoprint.comm.protocol.action" to add handlers of custom actions via plugins.
Added "!!DEBUG:" command to virtual printer to be able to trigger such commands to be sent by it.
2014-12-20 00:31:46 +01:00
Gina Häußge 8998be66eb Don't accidentally include a newline from the mime headers in the parsed multipart data
Fixes #680
2014-12-19 12:28:02 +01:00
Gina Häußge 1180cac147 Fixed heated bed option not being properly displayed in printer profiles
Fixes #683
2014-12-19 10:01:00 +01:00
Gina Häußge 270231a004 Fixed extruder offsets not being properly editable in printer profiles
Closes #677
2014-12-19 09:54:11 +01:00
Gina Häußge c2f0f6c7c4 [i18n] Translation update 2014-12-18 15:15:23 +01:00
Gina Häußge c7afae38a8 Rolled back appearance settings
Associating them with the current printer profile is misleading as long as a printer profile represents both a physical printer and a type machine. In the future this association will have to be split, to allow for configuration of printers with respective machine profiles (name subject to be changed).
2014-12-18 13:48:19 +01:00
Gina Häußge 873a825e57 Commented out loggers used for debugging/evaluating print time estimation 2014-12-18 12:02:14 +01:00
Gina Häußge dc2318f404 Use the rolling average of the last n estimations instead of the current estimation for reporting print time left 2014-12-18 12:01:01 +01:00
Bevaz 699ed1da4d Enframed output filename with quotes. 2014-12-17 22:08:47 +03:00
Gina Häußge d8b95f845c If the G4 isn't returned, it won't be sent to the printer 2014-12-17 18:33:26 +01:00
Gina Häußge 014d39c11d Fetch estimated print time from cura slicing result, create print time statistics per printer profile, interpolate between stats and live estimation during printing for print time left 2014-12-17 17:31:30 +01:00
Gina Häußge a544a852f2 Some minor cleanup 2014-12-17 12:52:02 +01:00
Gina Häußge 3311a48e3a Merge branch 'issue_658' of https://github.com/vishnubob/OctoPrint into vishnubob-issue_658
Conflicts:
	src/octoprint/util/comm.py
2014-12-17 12:50:37 +01:00
Gina Häußge 5ac908afd4 Pauses in the print job are now cleaned from the basis for print time estimation, also switched to a rolling window approach for determining when estimation becomes stable 2014-12-16 13:27:31 +01:00
Gina Häußge 12a3e659b1 Added new plugin type ProgressPlugin
Plugins can implement that to get notified of progress in both print and slicing jobs in 1% increments.
2014-12-15 21:29:18 +01:00
Gina Häußge b0780af7fa Removed a possible race condition when slicing to the same gcode file in direct succession 2014-12-15 18:35:15 +01:00
Gina Häußge 2ec31c7521 Removed a left-over from print time estimation experiments that got overlooked 2014-12-15 11:38:17 +01:00
Gina Häußge f2562500a3 Print time estimation is now not displayed until it becomes somewhat stable 2014-12-12 23:38:57 +01:00
Gina Häußge 85a567bdab More error resilience when logging success/failure of prints 2014-12-11 18:32:17 +01:00
Gina Häußge 11c415fd17 Actually use caching when reading metadata (was a write-only cache previously, way to go...) 2014-12-11 18:31:48 +01:00
Gina Häußge d67ea41032 Fixed jog controls
Closes #664
2014-12-11 16:10:50 +01:00
Gina Häußge 66357ebe7e "autoconnect" parameter to "connect" command is not mandatory
Closes #675
2014-12-11 15:37:48 +01:00
Javier Rios 708fa989aa BugFix to Reconnect on Debian 2014-12-10 17:09:13 +01:00
Gina Häußge 8dbde90a93 Merge branch 'master' into devel 2014-12-09 22:25:19 +01:00
Gina Häußge d2910de121 Added entry to change log 2014-12-09 22:24:53 +01:00
Gina Häußge c5be9908c5 Don't hiccup on slic3r filament_diameter comments generated for multi extruder setups 2014-12-09 22:20:55 +01:00
Giles Hall e844d42275 added G4 hook to increase the timeout for serial communication 2014-11-28 19:28:03 +00:00
Gina Häußge 4a364d730b Merge branch 'devel' into gcodeScripts 2014-10-30 12:24:00 +01:00
Gina Häußge b7a9be31eb Allow definition of gcode scripts to be sent to the printer at various stages of the print process 2014-10-30 12:20:48 +01:00
nEuDy 38ea4ff98f New feature: Added feature for printer movement control by keyboard
-added a new field in the control-section, for controlling the movement of
the printer by keypresses.
To control you printer by keypress, you have to connect to printer first.
Then click into the textfield to activate it. Now you can press the arrow
keys, to move the printhead in the X- and Y-directions, press the W or S
key for Z-direction or the number keys 1, 2, 3 or 4 for choose the
distance (0.1mm, 1mm....)
2014-10-10 00:50:12 +02:00
Gina Häußge c105ffec18 User specific settings to be used for custom language configuration 2014-09-15 10:51:54 +02:00
324 changed files with 55430 additions and 19964 deletions

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
root = true
[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
[**.py]
indent_style = tab
[src/octoprint/static/js/app/**.js]
indent_style = space
indent_size = 4
[.travis.yml]
indent_style = space
indent_size = 2
+9
View File
@@ -1 +1,10 @@
src/octoprint/_version.py export-subst
src/octoprint/static/js/lib/* linguist-vendored
src/octoprint/static/less/bootstrap/* linguist-vendored
src/octoprint/static/less/font-awesome.less linguist-vendored
src/octoprint/static/less/mixins.less linguist-vendored
src/octoprint/static/less/variables.less linguist-vendored
versioneer.py linguist-vendored
docs/* linguist-documentation
+79
View File
@@ -0,0 +1,79 @@
READ THE FOLLOWING FIRST:
If not already done, please read the "guidelines for contributing"
that are linked ^-- just up there in the big yellow box. Also read
the FAQ: https://github.com/foosel/OctoPrint/wiki/FAQ.
This is a bug and feature tracker, please only use it to report bugs
or request features within OctoPrint (not OctoPi, not any OctoPrint
plugins and not unofficial OctoPrint versions).
Do not seek support here ("I need help with ..."), that belongs on
the mailing list or the G+ community (both linked in the "guidelines
for contributing" linked above, read it!), NOT here.
Mark requests with a "[Request]" prefix in the title please. Fully fill
out the bug reporting template for bug reports (if you don't know where
to find some information - it's all described in the contribution
guidelines linked up there in the big yellow box). Do not delete any
lines from the template but those enclosed in [ and ] - and those please
DO delete, they are only provided for your information and removing them
makes your ticket more readable :)
Thank you!
(Before submitting your ticket, please delete this text up to and
including the line too - it's only here for you, we already know it
by heart ;))
----
#### What were you doing?
[Please be as specific as possible here. The maintainers will need to
reproduce your issue in order to fix it and that is not possible if they
don't know what you did to get it to happen in the first place.
If you encountered a problem with specific files of any sorts, make sure
to also include a link to a file with which to reproduce the problem.]
#### What did you expect to happen?
#### What happened instead?
#### Branch & Commit or Version of OctoPrint
[Can be found in the lower left corner of the web interface. ALWAYS INCLUDE.]
#### Printer model & used firmware incl. version
[If applicable, always include if unsure.]
#### Browser and Version of Browser, Operating System running Browser
[If applicable, always include if unsure.]
#### Link to octoprint.log
[On gist.github.com or pastebin.com. ALWAYS INCLUDE and never truncate.]
#### Link to contents of terminal tab or serial.log
[On gist.github.com or pastebin.com. If applicable, always include if unsure or
reporting communication issues. Never truncate.
serial.log is usually not written due to performance reasons and must be
enabled explicitly. Provide at the very least the FULL contents of your
terminal tab at the time of the bug occurrence, even if you do not have
a serial.log.]
#### Link to contents of Javascript console in the browser
[On gist.github.com or pastebin.com or alternatively a screenshot. If applicable -
always include if unsure or reporting UI issues.]
#### Screenshot(s) showing the problem:
[If applicable. Always include if unsure or reporting UI issues.]
I have read the FAQ.
+50
View File
@@ -0,0 +1,50 @@
Thank you for your interest into contributing to OctoPrint, it's
highly appreciated!
Please make sure you have read the "guidelines for contributing" as
linked just above this form, there's a section on Pull Requests in there
as well that contains important information.
As a summary, please make sure you have ticked all points on this
checklist:
* [ ] Your changes are not possible to do through a plugin and relevant
to a large audience (ideally all users of OctoPrint)
* [ ] If your changes are large or otherwise disruptive: You have
made sure your changes don't interfere with current development by
talking it through with the maintainers, e.g. through a
Brainstorming ticket
* [ ] Your PR targets OctoPrint's devel branch (not master,
maintenance or anything else)
* [ ] Your PR was opened from a custom branch on your repository
(no PRs from your version of master, maintenance or devel please),
e.g. dev/my_new_feature
* [ ] Your PR only contains relevant changes: no unrelated files,
no dead code, ideally only one commit - rebase your PR if necessary!
* [ ] Your changes follow the coding style
* [ ] If your changes include style sheets: You have modified the
.less source files, not the .css files (those are generated with
lessc)
* [ ] You have tested your changes (please state how!) - ideally you
have added unit tests
* [ ] You have run the existing unit tests against your changes and
nothing broke
* [ ] You have added yourself to the AUTHORS.md file :)
Feel free to delete all this help text, then describe
your PR further. You may use the template provided below to do that.
The more details the better!
----
#### What does this PR do and why is it necessary?
#### How was it tested? How can it be tested by the reviewer?
#### Any background context you want to provide?
#### What are the relevant tickets if any?
#### Screenshots (if appropriate)
#### Further notes
+7
View File
@@ -1,3 +1,10 @@
src/octoprint/templates/_data/AUTHORS.md
src/octoprint/templates/_data/CHANGELOG.md
src/octoprint/templates/_data/SUPPORTERS.md
src/octoprint/templates/_data/THIRDPARTYLICENSES.md
devtools
*.tar.bz2
*.tar.gz
*.7z
+6 -3
View File
@@ -2,8 +2,11 @@
language: python
python:
- "2.7"
- "2.7"
install:
- pip install -r requirements.txt
- pip install -e .[develop]
script:
- nosetests
- nosetests --with-doctest
sudo: false
git:
depth: 250
+2 -2
View File
@@ -2,7 +2,7 @@
host = https://www.transifex.com
[octoprint.messages]
file_filter = src/octoprint/translations/<lang>/LC_MESSAGES/messages.po
source_file = src/octoprint/translations/messages.pot
file_filter = translations/<lang>/LC_MESSAGES/messages.po
source_file = translations/messages.pot
source_lang = en
+14 -6
View File
@@ -7,12 +7,20 @@
# The file is processed from top to bottom, the first matching line wins. If <tag> or <reference commit> are left out,
# the lookup table does not apply to the matched branches
# master and staging shall not use the lookup table
# master and rc shall not use the lookup table, only tags
master
staging
rc/.*
prerelease
# fix/ branches are fixes for master, so we don't handle those either
fix/.*
# neither should disconnected checkouts, e.g. 'git checkout <tag>'
HEAD
\(detached.*
# every other branch is a development branch and thus gets resolved to 1.2.0-dev for now
.* 1.2.0-dev 50cf776e70b9
# maintenance is currently the branch for preparation of maintenance release 1.2.17
# so are any fix/... and improve/... branches
maintenance 1.2.17 354042b84d488db38ac1917bb69bd164f4e7f750 pep440-dev
fix/.* 1.2.17 354042b84d488db38ac1917bb69bd164f4e7f750 pep440-dev
improve/.* 1.2.17 354042b84d488db38ac1917bb69bd164f4e7f750 pep440-dev
# every other branch is a development branch and thus gets resolved to 1.3.0-dev for now
.* 1.3.0 198d3450d94be1a2 pep440-dev
+69
View File
@@ -0,0 +1,69 @@
# Authors
The following people have contributed to OctoPrint's code base (ordered by
date of first contribution):
* [Gina Häußge](https://github.com/foosel)
* [Thomas Sanladerer](https://github.com/imitation)
* [Alex Ustyantsev](https://github.com/hudbrog)
* [Andrew Dalgleish](https://github.com/ajd4096)
* [Dale Price](https://github.com/daprice)
* [Václav "ax" Hůla](https://github.com/AxTheB)
* [Tom Perry](https://github.com/daftscience)
* [Andreas Gohr](https://github.com/splitbrain)
* [Lars Norpchen](https://github.com/norpchen)
* [Marlon Wünnemann](https://github.com/marwue)
* ["algspd"](https://github.com/algspd)
* [Peter Uithoven](https://github.com/peteruithoven)
* [Bryan Mayland](https://github.com/CapnBry)
* [Ross Hendrickson](https://github.com/savorywatt)
* [Dan Lipsitt](https://github.com/DanLipsitt)
* [James Gao](https://github.com/jamesgao)
* [Tonnerre Lombard](https://github.com/tonnerre)
* [Marc Hannappel](https://github.com/Salandora)
* [Brad Pitcher](https://github.com/brad)
* [Gabe Rosenhouse](https://github.com/rosenhouse)
* [chriskoz](https://github.com/chriskoz)
* [Ilya Novoselov](https://github.com/nullie)
* [Corey C](https://github.com/C-o-r-E)
* [Jarek Szczepanski](https://github.com/imrahil)
* [Jon Nordby](https://github.com/jonnor)
* [Aaron Bieber](https://github.com/qbit)
* [Guy Sheffer](https://github.com/guysoft)
* [Dattas Moonchaser](https://github.com/dattas)
* [Pim Rutgers](https://github.com/Booli)
* [Koen Kooi](https://github.com/koenkooi)
* [Colin Wallace](https://github.com/Wallacoloo)
* [Michael Ang](https://github.com/mangtronix)
* [Philipp Engel](https://github.com/nosyjoe)
* [Giles Hall](https://github.com/vishnubob)
* [Bevaz](https://github.com/Bevaz)
* [Bortek](https://github.com/bortek)
* [Rob Speed](https://github.com/rspeed)
* [Renha](https://github.com/Renha)
* [Antoine Bertin](https://github.com/Diaoul)
* [Teja Philipp](https://github.com/hungerpirat)
* ["matobago"](https://github.com/matobago)
* ["nophead"](https://github.com/nophead)
* [Bob Clough](https://github.com/thinkl33t)
* [Mikk Kiilaspää](https://github.com/Mikk36)
* [Jack Minardi](https://github.com/jminardi)
* [Mark Walker](https://github.com/markwal)
* [Lucas Clemente](https://github.com/lucas-clemente)
* [Andrew Erickson](https://github.com/aerickson)
* [Nicanor Romero Venier](https://github.com/nicanor-romero)
* [Thomas Hou](https://github.com/masterhou)
* [Mark Bastiaans](https://github.com/markbastiaans)
* [Kevin Murphy](https://github.com/kevingelion)
* [Richard Joyce](https://github.com/richjoyce)
* ["bwgan"](https://github.com/bwgan)
* [Siim Raud](https://github.com/2ndalpha)
* ["geoporalis"](https://github.com/geoporalis)
* [Andrew Malota](https://github.com/2bitoperations)
* [Kyle Evans](https://github.com/kevans91)
* [Ovidiu Hossu](https://github.com/MoonshineSG)
OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by
[Daid Braam](https://github.com/daid). Parts of its communication layer and
the server side GCODE interpreter are still based on Cura's code base from
December 2012 and hence on the work of its authors up until then.
+884 -31
View File
@@ -1,24 +1,700 @@
# OctoPrint Changelog
## 1.2.0 (Unreleased)
## 1.2.18 (2016-11-30)
### Improvements
* Allow arbitrary frame rates for creating timelapses. Before, the entered fps value was also directly used as frame rate for the actual video, which could cause problems with any frame rates not specified in the MPEG2 standard. Now OctoPrint will use a standard frame rate for the rendered video and render the timelapse stills into the finished movie with the configured frame rate.
* Limited Cura profile importer to `.ini` files and clarified the supported versions
* Add support for the `R` parameter for `M109` and `M190`
### Bug fixes
* [#1541](https://github.com/foosel/OctoPrint/issues/1541) - Fix selecting the printer profile to use by default
* [#1543](https://github.com/foosel/OctoPrint/issues/1543) - Fix target temperature propagation from communication layer
* [#1567](https://github.com/foosel/OctoPrint/issues/1567) - Fix issue with restricted settings getting parsed to the wrong data structure in the frontend if loaded anonymously first.
* [#1571](https://github.com/foosel/OctoPrint/issues/1571) - Fix parsing of port number from HTTP Host header for IPv6 addresses
* Fix issue with settings restriction causing internal settings defaults to be changed.
### More information
* [Commits](https://github.com/foosel/OctoPrint/compare/1.2.17...1.2.18)
* Release Candidates:
* [1.2.18rc1](https://github.com/foosel/OctoPrint/releases/tag/1.2.18rc1)
## 1.2.17 (2016-11-08)
### Improvements
* Files like `config.yaml` etc will now persist their permissions, with a lower and upper permission bounds for sanitization (e.g. removing executable flags on configuration files but keeping group read/write permissions if found).
* Log full stack trace on socket connection errors when debug logging for `octoprint.server.util.sockjs` is enabled
* ``SettingsPlugin``s may now mark configuration paths as restricted so that they are not returned on the REST API
* Updated LESS.js version
* Improved the `serial.log` logging handler to roll over serial log on new connections to the printer instead of continuously appending to the same file. Please note that `serial.log` is a debugging tool only and should *not* be left enabled unless you are trying to troubleshoot something in your printer communication.
* Split JS/CSS/LESS asset bundles according into asset bundles for core + bundled plugins ("packed_core.{js|css|less}") and third party plugins ("packed_plugins.{js|css|less}"). That will allow the core UI to still function properly even if an installed third party plugin produces invalid JS and therefore causes a parser error for the whole plugin JS file. See [#1544](https://github.com/foosel/OctoPrint/issues/1544) for an example of such a situation.
### Bug fixes
* [#1531](https://github.com/foosel/OctoPrint/issues/1531) - Fixed encoding bug in HTTP request processing triggered by content type headers on form data fields
* Fixed forced `config.yaml` save on startup caused by mistakenly assuming that printer parameters were always migrated.
* Fixed issue causing ``remember_me`` cookie not to be deleted properly on logout
* Fixed broken filter toggling on ``ItemListHelper`` class used for various lists throughout the web interface
* Fixed an issue with the preliminary page never reporting that the server is now up if the page generated during preliminary caching had no cache headers set (e.g. because it contained the first run setup wizard)
* Fixed a bug causing the update of OctoPrint to not work under certain circumstances: If 1.2.16 was installed and the settings were *never* saved via the "Settings" dialog's "Save", the update of OctoPrint would fail due to a `KeyError` in the updater. Reason is a renamed property, properly switched to when saving the settings.
* Fixed the logging subsystem to properly clean up after itself.
* Fixed a wrong order in loading JS files on the client introduced in 1.2.17rc2 to make the UI more resilient against broken plugin JS.
* Properly handle empty JS file list from plugins. Solves a 500 on OctoPrint instances without any third party plugins installed generated during web asset bundling introduced in 1.2.17rc2.
### More information
* [Commits](https://github.com/foosel/OctoPrint/compare/1.2.16...1.2.17)
* Release Candidates:
* [1.2.17rc1](https://github.com/foosel/OctoPrint/releases/tag/1.2.17rc1)
* [1.2.17rc2](https://github.com/foosel/OctoPrint/releases/tag/1.2.17rc2)
* [1.2.17rc3](https://github.com/foosel/OctoPrint/releases/tag/1.2.17rc3)
* [1.2.17rc4](https://github.com/foosel/OctoPrint/releases/tag/1.2.17rc4)
## 1.2.16 (2016-09-23)
### Improvements
* [#1434](https://github.com/foosel/OctoPrint/issues/1434): Make sure to sanitize any file names in the upload folder that do not match OctoPrint's file name "sanitization standard" automatically when creating a file listing. This should solve issues with UI functionality like selecting a file for printing or deleting a file to not work with files that were uploaded manually to the ``uploads`` folder. As a side note: Please don't do this, use the ``watched`` folder if you want to SCP/FTP/copy files directly to OctoPrint.
* [#1434](https://github.com/foosel/OctoPrint/issues/1434): Allow `[` and `]` in uploaded file names.
* [#1481](https://github.com/foosel/OctoPrint/issues/1481): Bring back non-fuzzy layer time estimates in the GCODE viewer.
* Improved fuzzy print time displays in the frontend. Rounding now takes overall duration into account - durations over a day will be rounded up/down to half days, durations over an hour will be rounded up/down to half hours, durations over 30min will be rounded to 10min segments, durations below 30min will be rounded up or down to the next minute depending on the seconds and finally if we are talking about less than a minute, durations over 30s will return "less than a minute", durations under 30s will return "a couple of seconds".
* Improved intermediary loading page: Don't report server as ready and reload until preliminary caching has been done, IF preliminary caching will be done.
* Added release channels to OctoPrint's bundled Software Update plugin. You will now be able to subscribe to OctoPrint's `maintenance` or `devel` release candidates in addition to stable versions. [Read more about Release Channels on the wiki](https://github.com/foosel/OctoPrint/wiki/Using-Release-Channels).
* Return a "400 Bad Request" instead of a "500 Internal Server Error" if a `multipart/form-data` request (e.g. a file upload) is sent which lacks the `boundary` field.
### Bug Fixes
* [#1448](https://github.com/foosel/OctoPrint/issues/1448): Don't "eat" first line of the pause script after a pause triggering `M0` but send it to the printer instead
* [#1477](https://github.com/foosel/OctoPrint/issues/1477): Only report files enqueued for analysis which actually are (as in, don't claim to have queued STL files for GCODE analysis)
* [#1478](https://github.com/foosel/OctoPrint/issues/1478): Don't display inaccurate linear estimate ("6 days remaining") until 30 *minutes* have passed, even if nothing else is available. Potentially related to [#1428](https://github.com/foosel/OctoPrint/issues/1428).
* [#1479](https://github.com/foosel/OctoPrint/issues/1479): Make sure set cookies are post fixed with a port specific suffix and that the path they are set on takes the script root from the request into account.
* [#1483](https://github.com/foosel/OctoPrint/issues/1483): Filenames in file uploads may also now be encoded in ISO-8859-1, as defined in [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4). Solves an issue when sending files with non-ASCII-characters in the file name from Slic3r.
* [#1491](https://github.com/foosel/OctoPrint/issues/1491): Fixed generate/delete API key in the user settings
* [#1492](https://github.com/foosel/OctoPrint/issues/1492): Fixed a bug in the software update plugin depending on the presence of the ``prerelease`` flag which is only present when added manually or using a non stable release channel.
### More information
* [Commits](https://github.com/foosel/OctoPrint/compare/1.2.15...1.2.16)
* Release Candidates:
* [1.2.16rc1](https://github.com/foosel/OctoPrint/releases/tag/1.2.16rc1)
* [1.2.16rc2](https://github.com/foosel/OctoPrint/releases/tag/1.2.16rc2)
## 1.2.15 (2016-07-30)
### Improvements
* [#1425](https://github.com/foosel/OctoPrint/issues/1425) - Added a compatibility work around for plugins implementing the [`octoprint.comm.transport.serial_factory` hook](http://docs.octoprint.org/en/master/plugins/hooks.html#octoprint-comm-transport-serial-factory) but whose handler's `write` method did not return the number of written bytes (e.g. [GPX plugin including v2.5.2](http://plugins.octoprint.org/plugins/gpx/), [M33 Fio plugin including v1.2](http://plugins.octoprint.org/plugins/m33fio/)).
### Bug Fixes
* [#1423](https://github.com/foosel/OctoPrint/issues/1423) - Fixed an issue with certain printers dropping or garbling communication when setting the read timeout of the serial line. Removed the dynamic timeout setting introduced by [#1409](https://github.com/foosel/OctoPrint/issues/1409) to solve this.
* [#1425](https://github.com/foosel/OctoPrint/issues/1425) - Fixed an error when trying to close a printer connection that had not yet been opened and was `None`
* Fixed "Last Modified" header calculation for views where only one source file was present
([Commits](https://github.com/foosel/OctoPrint/compare/1.2.14...1.2.15))
## 1.2.14 (2016-07-28)
### Improvements
* [#935](https://github.com/foosel/OctoPrint/issues/935) - Support alternative source file types and target extensions in [SlicerPlugins](http://docs.octoprint.org/en/master/plugins/mixins.html#slicerplugin).
* [#1393](https://github.com/foosel/OctoPrint/issues/1393) - Added dedicated sub commands on the job API to pause and resume a print job (instead of only offering a toggle option).
* Better "upload error" message with a list of supported extensions (instead of hardcoded ones)
* Use fuzzy times for print time estimation from GCODE analysis
* Allow M23 "File opened" response with no filename (RepRapPro)
* Allow intermediary startup page to forward query parameters and fragments from initial call to actual web frontend
* More error resilience when rendering templates (e.g. from plugins)
* Make sure that all bytes of a line to send to the printer have actually been sent
* "Tickle" printer when encountering a communication timeout while idle
* Report `CLOSED`/`CLOSED_WITH_ERROR` states as "Offline" in frontend for more consistency with startup `NONE` state which already was reported as "Offline"
* Another attempt at a saner print time estimation: Force linear (way less accurate) estimate if calculation of more accurate version takes too long, sanity check calculated estimate and use linear estimate if it looks wrong, improved threshold values for calculation. Read [the second half of this post on the mailing list](https://groups.google.com/forum/#!msg/octoprint/WWpm1FCUkAs/X3HomTM5DgAJ) on why accurate print time estimation is so difficult to achieve.
* Display print job progress percentage on progress bar.
* Added an indicator for print time left prediction accuracy and explanation of its origin as tooltip.
* Improved visual distinction of "State" sidebar panel info clusters.
### Bug Fixes
* [#1385](https://github.com/foosel/OctoPrint/issues/1385) - Send all non-protocol messages from printer to clients.
* [#1388](https://github.com/foosel/OctoPrint/issues/1388) - Track consecutive timeouts even when idle and disconnect from printer when it's not responding any longer.
* [#1391](https://github.com/foosel/OctoPrint/issues/1391) - Only use the first value from the X-Scheme header for the reverse proxy setup. Otherwise there could be problems when multiple reverse proxies were configured chained together, each adding their own header to the mix.
* [#1407](https://github.com/foosel/OctoPrint/issues/1407) - If a file is uploaded with the "print" flag set to true, make sure to clear that flag after the print job has been triggered so that now all following uploaded or selected files will start printing on their own.
* [#1409](https://github.com/foosel/OctoPrint/issues/1409) - Don't report a communication timeout after a heatup triggered by a print from SD.
* Fixed scrolling to freshly uploaded files, also now highlighting the file entry for better visibility.
* Fixed overeager preemptive caching of invalid protocols.
* Fix modal background of update confirmation not vanishing
* Ensure log entries and messages from printer are sent to frontend already converted to utf-8. Otherwise even one line in the log that can't be converted automatically without error can cause updates from the backend to not arrive.
* Report correct printer state including error strings even after disconnecting
* While printing, be sure to read the next line from file and send that if the current line was filtered
* Small fixes in the GCODE analysis
* Small fixes in the documentation
([Commits](https://github.com/foosel/OctoPrint/compare/1.2.13...1.2.14))
## 1.2.13 (2016-06-16)
### Bug Fixes
* [#1373](https://github.com/foosel/OctoPrint/issues/1373): Don't parse `B:` as bed temperature when it shows up as part of a position report from `M114`.
* [#1374](https://github.com/foosel/OctoPrint/issues/1374): Don't try to perform a passive login when the components we'd need to inform about a change in login state aren't yet available. Solves a bug that lead - among other things - to the Plugin Manager and the Software Update Plugin not showing anything but misleading errors until the user logged out and back in.
* Fixed the temperature graph staying uninitialized until a connection to a printer was established.
* Fixed an error causing issues during frontend startup if the browser doesn't support tracking browser visibility.
* Fixed an error causing issues during frontend startup if the browser doesn't support the capabilities needed for the GCODE viewer.
([Commits](https://github.com/foosel/OctoPrint/compare/1.2.12...1.2.13))
## 1.2.12 (2016-06-09)
### Improvements
* [#1338](https://github.com/foosel/OctoPrint/issues/1338): Threshold configuration fields now include information about how to specify the thresholds.
* Mark unrendered timelapses currently being processed (recording or rendering) in the list and remove action buttons so no accidental double-processing can take place.
* Removed file extension from "rendering" and "rendered" notifications, was misleading when using the [mp4 wrapper script](https://github.com/guysoft/OctoPi/issues/184).
* Added some new events for manipulation of slicing profiles.
* Small fix of the german translation.
### Bug Fixes
* [#1314](https://github.com/foosel/OctoPrint/issues/1314): Do not change the extension of `.g` files being uploaded to SD (e.g. `auto0.g`)
* [#1320](https://github.com/foosel/OctoPrint/issues/1320): Allow deletion of *.mp4 timelapse files (see [this wrapper script](https://github.com/guysoft/OctoPi/issues/184)).
* [#1324](https://github.com/foosel/OctoPrint/issues/1324): Make daemonized OctoPrint properly clean up its pid file again (see also [#1330](https://github.com/foosel/OctoPrint/pull/1330)).
* [#1326](https://github.com/foosel/OctoPrint/issues/1326): Do not try to clean up an unrendered timelapse while it is already being deleted (and produce way too much logging output in the process).
* [#1343](https://github.com/foosel/OctoPrint/issues/1343): Events are now processed in the order they are fired in, making e.g. the "timelapse rendering" message always appear before "timelapse failed" and hence not stay on forever in case of a failed timelapse.
* [#1344](https://github.com/foosel/OctoPrint/issues/1344): `ProgressPlugin`s now get also notified about a progress of 0%.
* [#1357](https://github.com/foosel/OctoPrint/issues/1357): Fixed wrongly named method call on editing access control options for a user, causing that to not work properly.
* [#1361](https://github.com/foosel/OctoPrint/issues/1361): Properly reload profile list for currently selected slicer in the slicing dialog on change of profiles.
* [#1364](https://github.com/foosel/OctoPrint/issues/1364): Fixed a race condition that could cause the UI to not initialize correctly due to 401 errors, leaving it in an unusable state until a reload.
* Fixed concurrent message pushing to the frontend being able to break push messages for the session by forcing synchronization of SockJS message sending.
* Do not require admin rights for connecting/disconnecting, like it was in 1.1.x (note that this is supposed to become configurable behaviour once [#1110](https://github.com/foosel/OctoPrint/issues/1110) gets implemented)
([Commits](https://github.com/foosel/OctoPrint/compare/1.2.11...1.2.12))
## 1.2.11 (2016-05-04)
### Important Announcement
Due to a recent change in the financial situation of the project, the funding of OctoPrint is at stake. If you love OctoPrint and want to see its development continue at the pace of the past two years, please read on about its current funding situation and how you can help: ["I need your support"](http://octoprint.org/blog/2016/04/13/i-need-your-support/).
### Improvements
* Added option to treat resend requests as `ok` for such firmwares that do not send an `ok` after requesting a resend. If you printer communication gets stalled after a resend request from the firmware, try checking this option.
* Added an "About" dialog to properly inform about OctoPrint's license, contributors and supporters.
* Added a announcement plugin that utilizes the RSS feeds of the [OctoPrint Blog](http://octoprint.org/blog/) and the [plugin repository](http://plugins.octoprint.org) to display news to the user. By default only the "important announcement" category is enabled. This category will only be used for very rare situations such as making you aware of critical updates or important news. You can enable further categories (with more announcements to be expected) in the plugin's settings dialog.
### Bug Fixes
* [#1300](https://github.com/foosel/OctoPrint/issues/1300) - Removed possibility to accidentally disabling local file list by first limiting view to files from SD and then disabling SD support.
* [#1315](https://github.com/foosel/OctoPrint/issues/1315) - Fixed broken post roll on z-based timelapses.
* Fixed CSS data binding syntax on the download link in the files list
* Changed control distance from jQuery data into a knockout observerable and observerableArray
* Allow an unauthorized user to logout from a logedin interface state
([Commits](https://github.com/foosel/OctoPrint/compare/1.2.10...1.2.11))
## 1.2.10 (2016-03-16)
### Improvements
* Improved performance of console output during plugin installation/deinstallation
* Slight performance improvements in the communication layer
* Log small log excerpt to `octoprint.log` upon encountering a communication error.
* Changed wording in "firmware error" notifications to better reflect that there was an error while communicating with the printer, since the error condition can also be triggered by serial errors while trying to establish a connection to the printer or when already connected.
* Support downloading ".mp4" timelapse files. You'll need a [custom wrapper script for timelapse rendering](https://github.com/guysoft/OctoPi/issues/184) for this to be relevant to you. See also [#1255](https://github.com/foosel/OctoPrint/pull/1255)
* The communication layer will now wait up to 10s after clicking disconnect in order to send any left-over lines from its buffers.
* Moved less commonly used configuration options in Serial settings into "Advanced options" roll-out.
### Bug Fixes
* [#1224](https://github.com/foosel/OctoPrint/issues/1224) - Fixed an issue introduced by the fix for [#1196](https://github.com/foosel/OctoPrint/issues/1196) that had the "Upload to SD" button stop working correctly.
* [#1226](https://github.com/foosel/OctoPrint/issues/1226) - Fixed an issue causing an error on disconnect after or cancelling of an SD print, caused by the unsuccessful attempt to record print recovery data for the file on the printer's SD card.
* [#1268](https://github.com/foosel/OctoPrint/issues/1268) - Only add bed temperature line to temperature management specific start gcode in CuraEngine invocation if a bed temperature is actually set in the slicing profile.
* [#1271](https://github.com/foosel/OctoPrint/issues/1271) - If a communication timeout occurs during an active resend request, OctoPrint will now not send an `M105` with an increased line number anymore but repeat the last resent command instead.
* [#1272](https://github.com/foosel/OctoPrint/issues/1272) - Don't add an extra `ok` for `M28` response.
* [#1273](https://github.com/foosel/OctoPrint/issues/1273) - Add an extra `ok` for `M29` response, but only if configured such in "Settings" > "Serial" > "Advanced options" > "Generate additional ok for M29"
* [#1274](https://github.com/foosel/OctoPrint/issues/1274) - Trigger `M20` only once after finishing uploading to SD
* [#1275](https://github.com/foosel/OctoPrint/issues/1275) - Prevent `M105` "cascade" due to communication timeouts
* Fixed wrong tracking of extruder heating up for `M109 Tn` commands in multi-extruder setups.
* Fixed start of SD file uploads not sending an `M110`.
* Fixed job data not being reset when disconnecting while printing.
([Commits](https://github.com/foosel/OctoPrint/compare/1.2.9...1.2.10))
## 1.2.9 (2016-02-10)
### Improvements
* [#318](https://github.com/foosel/OctoPrint/issues/318) - Snapshots for timelapses are now named in a non-colliding, job-based way, allowing a new timelapse to start while the other is still being rendered (although printing with an active timelapse rendering job is not recommended and will be solved with a proper render job queue in a later version). Timelapses that were not successfully rendered are kept for 7 days (configurable, although not via the UI so far) and can be manually rendered or deleted through a new UI component within the timelapse tab that shows up if unrendered timelapses are detected.
* [#485](https://github.com/foosel/OctoPrint/issues/485) - "Timelapse rendering" notification is now persistent, even across reloads/client switches. That should make it easier to see that a rendering job is currently in progress.
* [#939](https://github.com/foosel/OctoPrint/issues/939) - Updated to Knockout 3.4.0
* [#1204](https://github.com/foosel/OctoPrint/issues/1204) - Display total print time as estimated by GCODE viewer on GCODE viewer tab. That will allow access to an estimate even if the server hadn't yet calculated that when a print started. Note that due to slightly different implementation server and client side the resulting estimate might differ.
* OctoPrint now serves an intermediary page upon start that informs the user about the server still starting up. Once the server is detected as running, the page automatically switches to the standard interface.
* OctoPrint now displays a link to the release notes of an updated component in the update notification, the update confirmation and the version overview in the settings dialog. Please always make sure to at least skim over the release notes for new OctoPrint releases, they might contain important information that you need to know before updating.
* Improved initial page loading speeds by introducing a preemptive cache. OctoPrint will now record how you access it and on server start pre-render the page so it's ideally available in the server-side cache when you try to access it.
* Initialize login user name and password with an empty string and clear both on successful login (see [#1175](https://github.com/foosel/OctoPrint/pull/1175)).
* Added a "Refresh" button to the file list for people who modify the stored files externally (doing this is not encouraged however due to reasons of book keeping, e.g. metadata tracking etc).
* "Save" button on settings dialog is now disabled while background tasks (getting or receiving config data from the backend) are in progress.
* Improved performance of terminal tab on lower powered clients. Adaptive rate limiting now ensures the server backs off with log updates if the client can't process them fast enough. If the client is really slow, log updates get disabled automatically during printing. This behaviour can be disabled with override buttons in the terminal tab's advanced options if necessary.
* Added option to ignore any unhandled errors reported by the firmware and another option to only cancel ongoing prints on unhandled errors from the firmware (instead of instant disconnect that so far was the default).
* Made version compatibility check PEP440 compliant (important for plugin authors).
* Do not hiccup on manually sent `M28` commands.
* Persist print recovery data on print failures (origin and name of printed file, position in file when print was aborted, time and date of print failure). Currently this data isn't used anywhere, but it [can be accessed from plugins in order to add recovery functionality](https://github.com/foosel/OctoPrint-PrintRecoveryPoc) to OctoPrint.
* Small performance improvements in update checks.
* The file upload dialog will now only display files having an extension that's supported for upload (if the browser supports it, also see [#1196](https://github.com/foosel/OctoPrint/issues/1196)).
### Bug Fixes
* [#1007](https://github.com/foosel/OctoPrint/issues/1007) - Don't enable the "Print" button if no print job is selected.
* [#1181](https://github.com/foosel/OctoPrint/issues/1181) - Properly slugify UTF-8 only file names.
* [#1196](https://github.com/foosel/OctoPrint/issues/1196) - Do not show drag-n-drop overlay if server is offline.
* [#1208](https://github.com/foosel/OctoPrint/issues/1208) - Fixed `retraction_combing` profile setting being incorrectly used by bundled Cura plugin (see [#1209](https://github.com/foosel/OctoPrint/pull/1209))
* Fixed OctoPrint compatibility check in the plugin manager, could report `False` for development versions against certain versions of Python's `setuptools` (thanks to @ignaworm who stumbled over this).
* Fixed a missing parameter in `PluginSettings.remove` call (see [#1177](https://github.com/foosel/OctoPrint/pull/1177)).
* Docs: Fixed the example for a custom `M114` control to also match negative coordinates.
* Reset scroll position in settings dialog properly when re-opening it or switching tabs.
* Fixed an issue that prevented system menu entries that were added to a so far empty system menu make the menu show up.
* Fixed an issue that made requests to restricted resources fail even though the first run wizard had been completed successfully.
* Fixed an issue where an unknown command or the suppression of a command could cause the communication to stall until a communication timeout was triggered.
* Strip [unwanted ANSI characters](https://github.com/pypa/pip/issues/3418) from output produced by pip versions 8.0.0, 8.0.1 and 8.0.3 that prevents our plugin installation detection from working correctly.
([Commits](https://github.com/foosel/OctoPrint/compare/1.2.8...1.2.9))
## 1.2.8 (2015-12-07)
### Notes for Upgraders
#### A bug in 1.2.7 prevents directly updating to 1.2.8, here's what to do
A bug in OctoPrint 1.2.7 (fixed in 1.2.8) prevents updating OctoPrint to version
1.2.8. If you try to perform the update, you will simply be told that "the update
was successful", but the update won't actually have taken place. To solve this
hen-egg-problem, a plugin has been made available that fixes said bug (through
monkey patching).
The plugin is called "Updatefix 1.2.7" and can be found
[in the plugin repository](http://plugins.octoprint.org/plugins/updatefix127/)
and [on Github](https://github.com/OctoPrint/OctoPrint-Updatefix-1.2.7/).
Before attempting to update your installation from version 1.2.7 to version 1.2.8,
please install the plugin via your plugin manager and restart your server. Note that
you will only see it in the Plugin Manager if you need it, since it's only compatible with
OctoPrint version 1.2.7. After you installed the plugin and restarted your server
you can update as usual. The plugin will self-uninstall once it detects that it's
running under OctoPrint 1.2.8. After the self-uninstall another restart of your server
will be triggered (if you have setup your server's restart command, defaults to
`sudo service octoprint restart` on OctoPi) in order to really get rid of any
left-overs, so don't be alarmed when that happens, it is intentional.
**If you cannot or don't want to use the plugin**, alternatively you can switch
OctoPrint to "Commit" based tracking via the settings of the Software Update plugin,
update, then switch back to "Release" based tracking (see [this screenshot](https://i.imgur.com/wvkgiGJ.png)).
#### Bed temperatures are now only displayed if printer profile has a heated bed configured
This release fixes a [bug](https://github.com/foosel/OctoPrint/issues/1125)
that caused bed temperature display and controls to be available even if the
selected printer profile didn't have a heated bed configured.
If your printer does have a heated bed but you are not seeing its temperature
in the "Temperature" tab after updating to 1.2.8, please make sure to check
the "Heated Bed" option in your printer profile (under Settings > Printer Profiles)
as shown [in this short GIF](http://i.imgur.com/wp1j9bs.gif).
### Improvements
* Version numbering now follows [PEP440](https://www.python.org/dev/peps/pep-0440/).
* Prepared some things for publishing OctoPrint on [PyPi](https://pypi.python.org/pypi)
in the future.
* [BlueprintPlugin mixin](http://docs.octoprint.org/en/master/plugins/mixins.html#blueprintplugin)
now has an `errorhandler` decorator that serves the same purpose as
[Flask's](http://flask.pocoo.org/docs/0.10/patterns/errorpages/#error-handlers)
([#1059](https://github.com/foosel/OctoPrint/pull/1059))
* Interpret `M25` in a GCODE file that is being streamed from OctoPrint as
indication to pause, like `M0` and `M1`.
* Cache rendered page and translation files indefinitely. That should
significantly improve performance on reloads of the web interface.
* Added the string "unknown command" to the list of ignored printer errors.
This should help with general firmware compatibility in case a firmware
lacks features.
* Added the strings "cannot open" and "cannot enter" to the list of ignored
printer errors. Those are errors that Marlin may report if there is an issue
with the printer's SD card.
* The "CuraEngine" plugin now makes it more obvious that it only targets
CuraEngine versions up to and including 15.04 and also links to the plugin's
homepage with more information right within the settings dialog.
* Browser tab visibility is now tracked by the web interface, disabling the
webcam and the GCODE viewer if the tab containing OctoPrint is not active.
That should reduce the amount of resource utilized by the web interface on
the client when it is not actively monitored. Might also help to mitigate
[#1065](https://github.com/foosel/OctoPrint/issues/1065), the final verdict
on that one is still out though.
* The printer log in the terminal tab will now be cut off after 3000 lines
even if autoscroll is disabled. If the limit is reached, no more log lines
will be added to the client's buffer. That ensures that the log will not
scroll and the current log excerpt will stay put while also not causing
the browser to run into memory errors due to trying to buffer an endless
amount of log lines.
* Increased timeout of "waiting for restart" after an update from 20 to 60sec
(20sec turned out to be too little for OctoPi for whatever reason).
* Added a couple of unit tests
### Bug Fixes
* [#1120](https://github.com/foosel/OctoPrint/issues/1120) - Made the watchdog
that monitors and handles the `watched` folder more resilient towards errors.
* [#1125](https://github.com/foosel/OctoPrint/issues/1125) - Fixed OctoPrint
displaying bed temperature and controls and allowing the sending of GCODE
commands targeting the bed (`M140`, `M190`) if the printer profile doesn't
have a heated bed configured.
* Fixed an issue that stopped the software updater working for OctoPrint. The
updater reports success updating, but no update has actually taken place. A
fix can be applied for this issue to OctoPrint version 1.2.7 via
[the Updatefix 1.2.7 plugin](https://github.com/OctoPrint/OctoPrint-Updatefix-1.2.7).
For more information please refer to the [Important information for people updating from version 1.2.7](#important-information-for-people-updating-from-version-127)
above.
* Fix: Current filename in job data should never be prefixed with `/`
* Only persist plugin settings that differ from the defaults. This way the
`config.yaml` won't be filled with lots of redundant data. It's the
responsibility of the plugin authors to responsibly handle changes in default
settings of their plugins and add data migration where necessary.
* Fixed a documentation bug ([#1067](https://github.com/foosel/OctoPrint/pull/1067))
* Fixed a conflict with bootstrap-responsive, e.g. when using the
[ScreenSquish Plugin](http://plugins.octoprint.org/plugins/screensquish/)
([#1103](https://github.com/foosel/OctoPrint/pull/1067))
* Fixed OctoPrint still sending SD card related commands to the printer even
if SD card support is disabled (e.g. `M21`).
* Hidden files are no longer visible to the template engine, neither as (GCODE)
scripts nor as interface templates.
* The hostname and URL prefix via which the OctoPrint web interface is accessed
is now part of the cache key. Without that being the case the cache could
be created referring to something like `/octoprint/prefix/api/` for its API
endpoint (if accessed via `http://somehost:someport/octoprint/prefix/` first
time), which would then cause the interface to not work if accessed later
via another route (e.g. `http://someotherhost/`).
* Fixed a JavaScript error on finishing streaming of a file to SD.
* Fixed version reporting on detached HEADs (when the branch detection
reported "HEAD" instead of "(detached"
* Fixed some path checks for systems with symlinked paths
([#1051](https://github.com/foosel/OctoPrint/pull/1051))
* Fixed a bug causing the "Server Offline" overlay to pop _under_ the
"Please reload" overlay, which could lead to "Connection refused" browser
messages when clicking "Reload now" in the wrong moment.
([Commits](https://github.com/foosel/OctoPrint/compare/1.2.7...1.2.8))
## 1.2.7 (2015-10-20)
### Improvements
* [#1062](https://github.com/foosel/OctoPrint/issues/1062) - Plugin Manager
now has a configuration dialog that among other things allows defining the
used `pip` command if auto detection proves to be insufficient here.
* Allow defining additional `pip` parameters in Plugin Manager. That might
make `sudo`-less installation of plugins possible in situations where it's
tricky otherwise.
* Improved timelapse processing (backported from `devel` branch):
* Individually captured frames cannot "overtake" each other anymore through
usage of a capture queue.
* Notifications will now be shown when the capturing of the timelapse's
post roll happens, including an approximation of how long that will take.
* Usage of `requests` instead of `urllib` for fetching the snapshot,
appears to also have [positive effects on webcam compatibility](https://github.com/foosel/OctoPrint/issues/1078).
* Some more defensive escaping for various settings in the UI (e.g. webcam URL)
* Switch to more error resilient saving of configuration files and other files
modified during runtime (save to temporary file & move). Should reduce risk
of file corruption.
* Downloading GCODE and STL files should now set more fitting `Content-Type`
headers (`text/plain` and `application/sla`) for better client side support
for "Open with" like usage scenarios.
* Selecting z-triggered timelapse mode will now inform about that not working
when printing from SD card.
* Software Update Plugin: Removed "The web interface will now be reloaded"
notification after successful update since that became obsolete with
introduction of the "Reload Now" overlay.
* Updated required version of `psutil` and `netifaces` dependencies.
### Bug Fixes
* [#1057](https://github.com/foosel/OctoPrint/issues/1057) - Better error
resilience of the Software Update plugin against broken/incomplete update
configurations.
* [#1075](https://github.com/foosel/OctoPrint/issues/1075) - Fixed support
of `sudo` for installing plugins, but added big visible warning about it
as it's **not** recommended.
* [#1077](https://github.com/foosel/OctoPrint/issues/1077) - Do not hiccup
on [UTF-8 BOMs](https://en.wikipedia.org/wiki/Byte_order_mark) (or other
BOMs for that matter) at the beginning of GCODE files.
* Fixed an issue that caused user sessions to not be properly associated,
leading to Sessions getting duplicated, wrongly saved etc.
* Fixed internal server error (HTTP 500) response on REST API calls with
unset `Content-Type` header.
* Fixed an issue leading to drag-and-drop file uploads to trigger frontend
processing in various other file upload widgets.
* Fixed a documentation error.
* Fixed caching behaviour on GCODE/STL downloads, was setting the `ETag`
header improperly.
* Fixed GCODE viewer not properly detecting change of currently visualized
file on Windows systems.
([Commits](https://github.com/foosel/OctoPrint/compare/1.2.6...1.2.7))
## 1.2.6 (2015-09-02)
### Improvements
* Added support for version reporting on detached checkouts
(see [#1041](https://github.com/foosel/OctoPrint/pull/1041))
### Bug Fixes
* Pinned requirement for [psutil](https://pypi.python.org/pypi/psutil)
dependency to version 3.1.1 of that library due to an issue when
installing version 3.2.0 of that library released on 2015-09-02 through
a `python setup.py install` on OctoPrint. Also pinned all other requirements
to definitive versions that definitely work while at it to keep that from
happening again.
([Commits](https://github.com/foosel/OctoPrint/compare/1.2.5...1.2.6))
## 1.2.5 (2015-08-31)
### Improvements
* [#986](https://github.com/foosel/OctoPrint/issues/986) - Added tooltip for
"additional data" button in file list.
* [#1028](https://github.com/foosel/OctoPrint/issues/1028) - Hint about why
timelapse configuration is disabled.
* New central configuration option for commands to restart OctoPrint and to
restart and shut down the system OctoPrint is running on. This allows plugins
(like the Software Update Plugin or the Plugin Manager) and core functionality
to perform these common administrative tasks without the user needing to define
everything redundantly.
* Settings dialog now visualizes when settings are saving and when they being
retrieved. Also the Send/Cancel buttons are disabled while settings are saving
to prevent duplicated requests and concurrent retrieval of the settings by
multiple viewmodels is disabled as well.
* Better protection against rendering errors from templates provided by third
party plugins.
* Better protection against corrupting the configuration by using a temporary
file as intermediate buffer.
* Added warning to UI regarding Z timelapses and spiralized objects.
* Better compatibility with Repetier firmware:
* Added "Format Error" to whitelisted recoverable communication errors
(see also [#1032](https://github.com/foosel/OctoPrint/pull/1032)).
* Added option to ignore repeated resend requests for the same line (see
also discussion in [#1015](https://github.com/foosel/OctoPrint/pull/1015)).
* Software Update Plugin:
* Adjusted to utilize new centralized restart commands (see above).
* Allow configuration of checkout folder and version tracking type via
Plugin Configuration.
* Display message to user if OctoPrint's checkout folder is not configured
or a non-release version is running and version tracking against releases
is enabled.
* Clear version cache when a change in the check configuration is detected.
* Mark check configurations for which an update is not possible.
* Made disk space running low a bit more obvious through visual warning on
configurable thresholds.
### Bug Fixes
* [#985](https://github.com/foosel/OctoPrint/issues/985) - Do not hiccup on
unset `Content-Type` part headers for multipart file uploads.
* [#1001](https://github.com/foosel/OctoPrint/issues/1001) - Fixed connection
tab not unfolding properly (see also [#1002](https://github.com/foosel/OctoPrint/pull/1002)).
* [#1012](https://github.com/foosel/OctoPrint/issues/1012) - All API
responses now set no-cache headers, making the Edge browser behave a bit better
* [#1019](https://github.com/foosel/OctoPrint/issues/1019) - Better error
handling of problems when trying to write the webassets cache.
* [#1021](https://github.com/foosel/OctoPrint/issues/1021) - Properly handle
serial close on Macs.
* [#1031](https://github.com/foosel/OctoPrint/issues/1031) - Special
handling of `M112` (emergency stop) command:
* Jump send queue
* In case the printer's firmware doesn't understand it yet, at least
shutdown all of the heaters
* Disconnect
* Properly reset job progress to 0% when restarting a previously completed
printjob (see [#998](https://github.com/foosel/OctoPrint/pull/998)).
* Report an update as failed if the `pip` command returns a return code that
indicates failure.
* Fixed sorting of templates: could only be sorted by name, individual
configurations were ignored (see [#1022](https://github.com/foosel/OctoPrint/pull/1022)).
* Fixed positioning of custom context menus: were offset due to changes in
overall positioning settings (see [#1023](https://github.com/foosel/OctoPrint/pull/1023)).
* Software Update: Don't use display version for comparison of git commit
hashs.
* Fixed temperature parsing for multi extruder setups.
* Fixed nested vertical and horizontal custom control layouts.
([Commits](https://github.com/foosel/OctoPrint/compare/1.2.4...1.2.5))
## 1.2.4 (2015-07-23)
### Improvements
* `RepeatedTimer` now defaults to `daemon` set to `True`. This makes sure
plugins using it don't have to remember to set that flag themselves in
order for the server to properly shut down when timers are still active.
* Fixed a typo in the docs about `logging.yaml` (top level element is
`loggers`, not `logger`).
* Support for plugins with external dependencies (`dependency_links` in
setuptools), interesting for plugin authors who need to depend on Python
libraries that are (not yet) available on PyPI.
* Better resilience against errors within plugins.
### Bug Fixes
* Do not cache web page when running for the first time, to avoid caching
the first run dialog popup along side with it. This should solve issues
people were having when configuring OctoPrint for the first time, then
reloading the page without clearing the cache, being again prompted with
the dialog with no chance to clear it.
* Fix/workaround for occasional white panes in settings dialog on Safari 8,
which appears to have an issue with fixed positioning.
* Fixed form field truncation in upload requests that could lead to problems
when trying to import Cura profiles with names longer than 28 characters.
* Fixed webcam rotation for timelapse rendering.
* Fixed user settings not reaching the editor in the frontend.
* Notifications that are in process of being closed don't open again on
mouse over (that was actually more of an unwanted feature).
([Commits](https://github.com/foosel/OctoPrint/compare/1.2.3...1.2.4))
## 1.2.3 (2015-07-09)
### Improvements
* New option to actively poll the watched folder. This should make it work also
if it is mounted on a filesystem that doesn't allow getting notifications
about added files through notification by the operating system (e.g.
network shares).
* Better resilience against senseless temperature/SD-status-polling intervals
(such as 0).
* Log exceptions during writing to the serial port to `octoprint.log`.
### Bug Fixes
* [#961](https://github.com/foosel/OctoPrint/pull/961) - Fixed a JavaScript error that caused an error to be logged when "enter" was pressed in file or plugin search.
* [#962](https://github.com/foosel/OctoPrint/pull/962) - ``url(...)``s in packed CSS and LESS files should now be rewritten properly too to refer to correct paths
* Update notifications were not vanishing properly after updating:
* Only use version cache for update notifications if the OctoPrint version still is the same to make sure the cache gets invalidated after an external update of OctoPrint.
* Do not persist version information when saving settings of the Software Update plugin
* Always delete files from the ``watched`` folder after importing then. Using file preprocessor plugins could lead to the files staying there.
* Fixed an encoding problem causing OctoPrint's Plugin Manager and Software Update plugins to choke on UTF-8 characters in the update output.
* Fixed sorting by file size in file list
* More resilience against missing plugin assets:
* Asset existence will now be checked before they get included
in the assets to bundle by webassets, logging a warning if a
file isn't present.
* Monkey-patched webassets filter chain to not die when a file
doesn't exist, but to log an error instead and just return
an empty file instead.
([Commits](https://github.com/foosel/OctoPrint/compare/1.2.2...1.2.3))
## 1.2.2 (2015-06-30)
### Bug Fixes
* Fixed an admin-only security issue introduced in 1.2.0, updating is strongly advised.
([Commits](https://github.com/foosel/OctoPrint/compare/1.2.1...1.2.2))
## 1.2.1 (2015-06-30)
### Improvements
* More flexibility when interpreting compatibility data from plugin repository. If compatibility information is provided
only as a version number it's prefixed with `>=` for the check (so stating a compatibility of only
`1.2.0` will now make the plugin compatible to OctoPrint 1.2.0+, not only 1.2.0). Alternatively the compatibility
information may now contain stuff like `>=1.2,<1.3` in which case the plugin will only be shown as compatible
to OctoPrint versions 1.2.0 and up but not 1.3.0 or anything above that. See also
[the requirement specification format of the `pkg_resources` package](https://pythonhosted.org/setuptools/pkg_resources.html#requirements-parsing).
* Only print the commands of configured event handlers to the log when a new `debug` flag is present in the config
(see [the docs](http://docs.octoprint.org/en/master/configuration/config_yaml.html#events)). Reduces risk of disclosing sensitive data when sharing log files.
### Bug Fixes
* [#956](https://github.com/foosel/OctoPrint/issues/956) - Fixed server crash when trying to configure a default
slicing profile for a still unconfigured slicer.
* [#957](https://github.com/foosel/OctoPrint/issues/957) - Increased maximum allowed body size for plugin archive uploads.
* Bugs without tickets:
* Clean exit on `SIGTERM`, calling the shutdown functions provided by plugins.
* Don't disconnect on `volume.init` errors from the firmware.
* `touch` uploaded files on local file storage to ensure proper "uploaded date" even for files that are just moved
from other locations of the file system (e.g. when being added from the `watched` folder).
([Commits](https://github.com/foosel/OctoPrint/compare/1.2.0...1.2.1))
## 1.2.0 (2015-06-25)
### Note for Upgraders
* The [Cura integration](https://github.com/daid/Cura) has changed in such a way that OctoPrint now calls the
[CuraEngine](https://github.com/Ultimaker/CuraEngine) directly instead of depending on the full Cura installation. See
[the wiki](https://github.com/foosel/OctoPrint/wiki/Plugin:-Cura) for instructions on how to change your setup to
accommodate the new integration.
### New Features
* OctoPrint now has a [plugin system](http://docs.octoprint.org/en/master/plugins/index.html) which allows extending its
core functionality.
* Plugins may be installed through the new and bundled [Plugin Manager Plugin](https://github.com/foosel/OctoPrint/wiki/Plugin:-Plugin-Manager)
available in OctoPrint's settings. This Plugin Manager also allows browsing and easy installation of plugins
registered on the official [OctoPrint Plugin Repository](http://plugins.octoprint.org).
* For interested developers there is a [tutorial available in the documentation](http://docs.octoprint.org/en/master/plugins/gettingstarted.html)
and also a [cookiecutter template](https://github.com/OctoPrint/cookiecutter-octoprint-plugin) to quickly bootstrap
new plugins.
* Added internationalization of UI. Translations of OctoPrint are being crowd sourced via [Transifex](https://www.transifex.com/projects/p/octoprint/).
The following translations are already available with more in the works:
- Dutch (nl)
- German (de)
- French (fr)
- Hebrew (he)
- Norwegian (no)
- Romanian (ro)
Language Packs for both the core application as well as installed plugins can be uploaded through a new management
dialog in Settings > Appearance > Language Packs. A translation into German is included, further language packs
will soon be made available.
* Printer Profiles: Printer properties like print volume, extruder offsets etc are now managed via Printer Profiles. A
connection to a printer will always have a printer profile associated.
* File management now supports STL files as first class citizens (including UI adjustments to allow management of
uploaded STL files including removal and reslicing) and also allows folders (not yet supported by UI). STL files
can be downloaded like GCODE files.
* Slicing has been greatly improved:
* It now allows for a definition of slicing profiles to use for slicing plus overrides which can be defined per slicing
job (defining overrides is not yet part of the UI but it's on the roadmap).
* A new slicing dialog has been added which allows (re-)slicing uploaded STL files (which are now displayed in the file list
as well). The slicing profile and printer profile to use can be specified here as well as the file name to which to
slice to and the action to take after slicing has been completed (none, selecting the sliced GCODE for printing or
starting to print it directly)
* The slicing API allows positioning the model to slice on the print bed (Note: this is not yet available in the UI).
* Slicers themselves are integrated into the system via ``SlicingPlugins``.
* Bundled [Cura Plugin](https://github.com/foosel/OctoPrint/wiki/Plugin:-Cura) allows slicing through CuraEngine up
to and including 15.04. Existing Cura slicing profiles can be imported through the web interface.
* New file list: Pagination is gone, no more (mobile incompatible) pop overs, instead scrollable and with instant
search
* You can now define a folder (default: `~/.octoprint/watched`) to be watched for newly added GCODE (or -- if slicing
support is enabled -- STL) files to automatically add.
* OctoPrint now has a [plugin system](http://docs.octoprint.org/en/devel/plugins/index.html) which allows extending its
core functionality.
* New type of API key: [App Session Keys](http://docs.octoprint.org/en/devel/api/apps.html) for trusted applications
* New type of API key: [App Session Keys](http://docs.octoprint.org/en/master/api/apps.html) for trusted applications
* OctoPrint now supports `action:...` commands received via debug messages (`// action:...`) from the printer. Currently supported are
- `action:pause`: Pauses the current job in OctoPrint
- `action:resume`: Resumes the current job in OctoPrint
- `action:disconnect`: Disconnects OctoPrint from the printer
Plugins can add supported commands by [hooking](http://docs.octoprint.org/en/master/plugins/hooks.html) into the
``octoprint.comm.protocol.action`` hook
* Mousing over the webcam image in the control tab enables key control mode, allowing you to quickly move the axis of your
printer with your computer's keyboard ([#610](https://github.com/foosel/OctoPrint/pull/610)):
- arrow keys: X and Y axes
- W, S / PageUp, PageDown: Z axes
- Home: Home X and Y axes
- End: Home Z axes
- 1, 2, 3, 4: change step size used (0.1, 1, 10, 100mm)
* Controls for adjusting feed and flow rate factor added to Controls ([#362](https://github.com/foosel/OctoPrint/issues/362))
* Custom controls now also support slider controls
* Custom controls now support a row layout
* Users can now define custom GCODE scripts to run upon starting/pausing/resuming/success/failure of a print or for
custom controls ([#457](https://github.com/foosel/OctoPrint/issues/457), [#347](https://github.com/foosel/OctoPrint/issues/347))
* Bundled [Discovery Plugin](https://github.com/foosel/OctoPrint/wiki/Plugin:-Discovery) allows discovery of OctoPrint
instances via SSDP/UPNP and optionally also via ZeroConf/Bonjour/Avahi.
* Bundled [Software Update Plugin](https://github.com/foosel/OctoPrint/wiki/Plugin:-Software-Update) takes care of notifying
about new OctoPrint releases and also allows updating if configured as such. Plugins may register themselves with the
update notification and application process through a new hook ["octoprint.plugin.softwareupdate.check_config"](https://github.com/foosel/OctoPrint/wiki/Plugin:-Software-Update#octoprintpluginsoftwareupdatecheck_config).
### Improvements
@@ -29,50 +705,225 @@
* Start counting the layers at 1 instead of 0 in the GCODE viewer
* Upgraded [Font Awesome](https://fortawesome.github.io/Font-Awesome/) to version 3.2.1
* Better error reporting for timelapse rendering and system commands
* Custom control can now be defined so that they show a Confirm dialog with configurable text before executing
* Custom control can now be defined so that they show a Confirm dialog with configurable text before executing
([#532](https://github.com/foosel/OctoPrint/issues/532) and [#590](https://github.com/foosel/OctoPrint/pull/590))
* Slicing has been greatly improved:
* It now allows for a definition of slicing profiles to use for slicing plus overrides which can be defined per slicing
job (defining overrides is not yet part of the UI but it's on the roadmap).
* Slicers themselves are integrated into the system via ``SlicingPlugins``.
* The [Cura integration](https://github.com/daid/Cura) has changed in such a way that OctoPrint now calls the
[CuraEngine](https://github.com/Ultimaker/CuraEngine) directly instead of depending on the full Cura installation. See
[the wiki](https://github.com/foosel/OctoPrint/wiki/Plugin:-Cura) for instructions on how to change your setup to
accommodate the new integration.
* The "Slicing done" notification is now colored green ([#558](https://github.com/foosel/OctoPrint/issues/558)).
* File management now supports STL files as first class citizens (including UI adjustments to allow management of
uploaded STL files including removal and reslicing) and also allows folders (not yet supported by UI)
* Also interpret lines starting with "!!" as errors
* Serial communication: Also interpret lines starting with "!!" as errors
* Added deletion of pyc files to the `python setup.py clean` command
* Settings now show a QRCode for the API Key ([#637](https://github.com/foosel/OctoPrint/pull/637))
* Username in UI is no longer enclosed in scare quotes ([#595](https://github.com/foosel/OctoPrint/pull/595))
* Username in login dialog is not automatically capitalized on mobile devices anymore ([#639](https://github.com/foosel/OctoPrint/pull/639))
* "Slicing Done" and "Streaming Done" notifications now have a green background ([#558](https://github.com/foosel/OctoPrint/issues/558))
* Files that are currently in use, be it for slicing, printing or whatever, are now tracked and can not be deleted as
long as they are in use
* Settings in UI get refreshed when opening settings dialog
* New event "SettingsUpdated"
* "Print time left" is now not displayed until it becomes somewhat stable. Display in web interface now also happens
in a fuzzy way instead of the format hh:mm:ss, to not suggest a high accuracy anymore where the can't be one. Additionally
OctoPrint will use data from prior prints to enhance the initial print time estimation.
* Added handler for uncaught exceptions to make sure those get logged, should make the logs even more useful for analysing
bug reports
* The server now tracks the modification date of the configuration file and reloads it prior to saving the config if
it has been changed during runtime by external editing, hence no config settings added manually while the server
was running should be overwritten anymore.
* Display a "Please Reload" overlay when a new server version or a change in installed plugins is detected after a
reconnect to the server.
* Better handling of errors on the websocket - no more logging of the full stack trace to the log, only a warning
message for now.
* Daemonized OctoPrint now cleans up its pidfile when receiving a TERM signal ([#711](https://github.com/foosel/OctoPrint/issues/711))
* Added serial types for OpenBSD ([#551](https://github.com/foosel/OctoPrint/pull/551))
* Improved behaviour of terminal:
* Disabling autoscrolling now also stops cutting off the log while it's enabled, effectively preventing log lines from
being modified at all ([#735](https://github.com/foosel/OctoPrint/issues/735))
* Applying filters displays ``[...]`` where lines where removed and doesn't cause scrolling on filtered lines
anymore ([#286](https://github.com/foosel/OctoPrint/issues/286))
* Added a link to scroll to the end of the terminal log (useful for when autoscroll is disabled)
* Added a link to select all current contents of the terminal log for easy copy-pasting
* Added a display of how many lines are displayed, how many are filtered and how many are available in total
* Frame rate for timelapses can now be configured per timelapse ([#782](https://github.com/foosel/OctoPrint/pull/782))
* Added an option to specify the amount of encoding threads for FFMPEG ([#785](https://github.com/foosel/OctoPrint/pull/785))
* "Disconnected" screen now is not shown directly after a close of the socket, instead the client first tries to
directly reconnect once, and only if that doesn't work displays the dialog. Should reduce short popups of the dialog
due to shaky network connections and/or weird browser behaviour when downloading things from the UI.
* Development dependencies can now be installed with ``pip -e .[develop]``
* White and transparent colors ;) are supported for the navigation bar ([#789](https://github.com/foosel/OctoPrint/pull/789))
* Drag-n-drop overlay for file uploads now uses the full available screen space, improving usability on high resolution
displays ([#187](https://github.com/foosel/OctoPrint/issues/187))
* OctoPrint server should no longer hang when big changes in the system time happen, e.g. after first contact to an
NTP server on a Raspberry Pi image. Achieved through monkey patching Tornado with
[this PR](https://github.com/tornadoweb/tornado/pull/1290).
* Serial ports matching ``/dev/ttyAMA*`` are not anymore listed by default (this was the reason for a lot of people
running into problems while attempting to connect to their printer on their Raspberry Pis, on which ``/dev/ttyAMA0``
is the OS's serial console by default). Added configuration of additional ports to the Serial Connection section in
the Settings to make it easier for those people who do indeed have their printer connected to ``/dev/ttyAMA0``.
* Better behaviour of the settings dialog on low-width devices, navigation and content also now scroll independently
from each other (see also [#823](https://github.com/foosel/OctoPrint/pull/823))
* Renamed "Temperature Timeout" and "SD Status Timeout" in Settings to "Temperature Interval" and "SD Status Interval"
to better reflect what those values are actually used for.
* Added support for rectangular printer beds with the origin in the center ([#682](https://github.com/foosel/OctoPrint/issues/682)
and [#852](https://github.com/foosel/OctoPrint/pull/852)). Printer profiles now contain a new settings ``volume.origin``
which can either be ``lowerleft`` or ``center``. For circular beds only ``center`` is supported.
* Made baudrate detection a bit more solid, still can't perform wonders.
* Only show configuration options for additional extruders if more than one is available, and don't include offset
configuration for first nozzle which acts as reference for the other offsets ([#677](https://github.com/foosel/OctoPrint/issues/677)).
* Cut off of the temperature graph is now not based on the number of data points any more but on the actual time of the
data points. Anything older than ``n`` minutes will be cut off, with ``n`` defaulting to 30min. This value can be
changed under "Temperatures" in the Settings ([#343](https://github.com/foosel/OctoPrint/issues/343)).
* High-DPI support for the GCode viewer ([#837](https://github.com/foosel/OctoPrint/issues/837)).
* Stop websocket connections from multiplying ([#888](https://github.com/foosel/OctoPrint/pull/888)).
* New setting to rotate webcam by 90° counter clockwise ([#895](https://github.com/foosel/OctoPrint/issues/895) and
[#906](https://github.com/foosel/OctoPrint/pull/906))
* System commands now be set to a) run asynchronized by setting their `async` property to `true` and b) to ignore their
result by setting their `ignore` property to `true`.
* Various improvements of newly introduced features over the course of development:
* File management: The new implementation will migrate metadata from the old one upon first startup after upgrade from
version 1.1.x to 1.2.x. That should speed up initial startup.
* File management: GCODE Analysis backlog processing has been throttled to not take up too many resources on system
startup. Freshly uploaded files should still be analyzed at full speed.
* Plugins: SettingsPlugins may track versions of configuration format stored in `config.yaml`, including a custom
migration method getting called when a mismatch between the currently stored configuration format version and the one
reported by the plugin as current is detected.
* Plugins: Plugins may now have a folder for plugin related data whose path can be retrieved from the plugin itself
via its new method [`get_plugin_data_folder`](http://docs.octoprint.org/en/master/modules/plugin.html#octoprint.plugin.types.OctoPrintPlugin.get_plugin_data_folder).
* Plugin Manager: Don't allow plugin management actions (like installing/uninstalling or enabling/disabling) while the
printer is printing (see also unreproduced issue [#936](https://github.com/foosel/OctoPrint/issues/936)).
* Plugin Manager: More options to try to match up installed plugin packages with discovered plugins.
* Plugin Manager: Display a more friendly message if after the installation of a plugin it could not be correctly
identifier.
* Software Update: Enforce refreshing of available updates after any changes in enabled plugins.
### Bug Fixes
* [#435](https://github.com/foosel/OctoPrint/issues/435) - Always interpret negative duration (e.g. for print time left)
as 0
* [#633](https://github.com/foosel/OctoPrint/issues/633) - Correctly interpret temperature lines from multi extruder
setups under Smoothieware
* [#516](https://github.com/foosel/OctoPrint/issues/516) - Also require API key even if ACL is disabled.
* [#556](https://github.com/foosel/OctoPrint/issues/556) - Allow login of the same user from multiple browsers without
side effects
* [#612](https://github.com/foosel/OctoPrint/issues/612) - Fixed GCODE viewer in zoomed out browsers
* [#633](https://github.com/foosel/OctoPrint/issues/633) - Correctly interpret temperature lines from multi extruder
setups under Smoothieware
* [#680](https://github.com/foosel/OctoPrint/issues/680) - Don't accidentally include a newline from the MIME headers
in the parsed multipart data from file uploads
* [#709](https://github.com/foosel/OctoPrint/issues/709) - Properly initialize time estimation for SD card transfers too
* [#715](https://github.com/foosel/OctoPrint/issues/715) - Fixed an error where Event Triggers of type command caused
and exception to be raised due to a misnamed attribute in the code
* [#717](https://github.com/foosel/OctoPrint/issues/717) - Use ``shutil.move`` instead of ``os.rename`` to avoid cross
device renaming issues
* [#752](https://github.com/foosel/OctoPrint/pull/752) - Fix error in event handlers sending multiple gcode commands.
* [#780](https://github.com/foosel/OctoPrint/issues/780) - Always (re)set file position in SD files to 0 so that reprints
work correctly
* [#784](https://github.com/foosel/OctoPrint/pull/784) - Also include ``requirements.txt`` in files packed up for
``python setup.py sdist``
* [#330](https://github.com/foosel/OctoPrint/issues/330) - Ping pong sending to fix potential acknowledgement errors.
Also affects [#166](https://github.com/foosel/OctoPrint/issues/166), [#470](https://github.com/foosel/OctoPrint/issues/470)
and [#490](https://github.com/foosel/OctoPrint/issues/490). A big thank you to all people involved in these tickets
in getting to the ground of this.
* [#825](https://github.com/foosel/OctoPrint/issues/825) - Fixed "please visualize" button of large GCODE files
* Various fixes of bugs in newly introduced features and improvements:
* [#625](https://github.com/foosel/OctoPrint/pull/625) - Newly added GCODE files were not being added to the analysis
queue
* [#664](https://github.com/foosel/OctoPrint/issues/664) - Fixed jog controls again
* [#677](https://github.com/foosel/OctoPrint/issues/677) - Fixed extruder offsets not being properly editable in
printer profiles
* [#678](https://github.com/foosel/OctoPrint/issues/678) - SockJS endpoints is now referenced by relative URL
using ``url_for``, should solve any issues with IE11.
* [#683](https://github.com/foosel/OctoPrint/issues/683) - Fixed heated bed option not being properly displayed in
printer profiles
* [#685](https://github.com/foosel/OctoPrint/issues/685) - Quoted file name for Timelapse creation to not make
command hiccup on ``~`` in file name
* [#709](https://github.com/foosel/OctoPrint/issues/709) - Fixed file sending to SD card
* [#714](https://github.com/foosel/OctoPrint/issues/714) - Fixed type validation of printer profiles
* Heating up the heated bed (if present) was not properly configured in CuraEngine plugin
* [#720](https://github.com/foosel/OctoPrint/issues/720) - Fixed translation files not being properly copied over
during install
* [#724](https://github.com/foosel/OctoPrint/issues/724) - Fixed timelapse deletion for timelapses with non-ascii
characters in their name
* [#726](https://github.com/foosel/OctoPrint/issues/726) - Fixed ``babel_refresh`` command
* [#759](https://github.com/foosel/OctoPrint/pull/759) - Properly initialize counter for template plugins of type
"generic"
* [#775](https://github.com/foosel/OctoPrint/pull/775) - Error messages in javascript console show the proper name
of the objects
* [#795](https://github.com/foosel/OctoPrint/issues/795) - Allow adding slicing profiles for unconfigured slicers
* [#809](https://github.com/foosel/OctoPrint/issues/809) - Added proper form validation to printer profile editor
* [#824](https://github.com/foosel/OctoPrint/issues/824) - Settings getting lost when switching between panes in
the settings dialog (fix provided by [#879](https://github.com/foosel/OctoPrint/pull/879))
* [#892](https://github.com/foosel/OctoPrint/issues/892) - Preselected baudrate is now properly used for auto detected
serial ports
* [#909](https://github.com/foosel/OctoPrint/issues/909) - Fixed Z-Timelapse for Z changes on ``G1`` moves.
* Fixed another instance of a missing `branch` field in version dicts generated by versioneer (compare
[#634](https://github.com/foosel/OctoPrint/pull/634)). Caused an issue when installing from source archive
downloaded from Github.
* [#931](https://github.com/foosel/OctoPrint/issues/931) - Adjusted `octoprint_setuptools` to be compatible to older
versions of setuptools potentially site-wide installed on hosts.
* [#942](https://github.com/foosel/OctoPrint/issues/942) - Settings can now be saved again after installing a new
plugin. Plugins must not use `super` anymore to call parent implementation of `SettingsPlugin.on_settings_save` but
should instead switch to `SettingsPlugin.on_settings_save(self, ...)`. Settings API will capture related
`TypeErrors` and log a big warning to the log file indicating which plugin caused the problem and needs to be
updated. Also updated all bundled plugins accordingly.
* Software Update: Don't persist more check data than necessary in the configuration. Solves an issue where persisted
information overrode updated check configuration reported by plugins, leading to a "an update is available" loop.
An auto-migration function was added that should remove the redundant data.
* Various fixes without tickets:
* GCODE viewer now doesn't stumble over completely extrusionless GCODE files
* Do not deliver the API key on settings API unless user has admin rights
* Don't hiccup on slic3r filament_diameter comments in GCODE generated for multi extruder setups
* Color code successful or failed print results directly in file list, not just after a reload
* Changing Timelapse post roll activates save button
* Timelapse post roll is loaded properly from config
* Handling of files on the printer's SD card contained in folders now works correctly
* Don't display a "Disconnected" screen when trying to download a timelapse in Firefox
* Fixed handling of SD card files in folders
* Fixed refreshing of timelapse file list upon finished rendering of a new one
* Fixed ``/api/printer`` which wasn't adapter yet to new internal offset data model
* Made initial connection to printer a bit more responsive: Having to wait for the first serial timeout before sending
the first ``M105`` even when not waiting for seeing a "start" caused unnecessary wait times for reaching the
"Operational" state.
* Log cancelled prints only once (thanks to @imrahil for the headsup)
## 1.1.2 (Unreleased)
### More information
* [Commits](https://github.com/foosel/OctoPrint/compare/1.1.2...1.2.0)
* Release Candidates:
* [RC1](https://github.com/foosel/OctoPrint/releases/tag/1.2.0-rc1)
* [RC2](https://github.com/foosel/OctoPrint/releases/tag/1.2.0-rc2)
* [RC3](https://github.com/foosel/OctoPrint/releases/tag/1.2.0-rc3)
## 1.1.2 (2015-03-23)
### Improvements
* Added deletion of `*.pyc` files to `python setup.py clean` command, should help tremendously when switching branches (backported
from [9e014eb](https://github.com/foosel/OctoPrint/commit/9e014eba1feffde11ed0601d9c911b8cac9f3fb0))
* Increased default communication and connection timeouts
* [#706](https://github.com/foosel/OctoPrint/issues/706) - Do not truncate error reported from printer
### Bug Fixes
* [#539](https://github.com/foosel/OctoPrint/issues/539) - Limit maximum number of tools, sanity check tool numbers in
GCODE files against upper limit and refuse to create 10000 tools due to weird slicers. (backported from `devel`)
* [#634](https://github.com/foosel/OctoPrint/pull/634) - Fixed missing `branch` fields in version dicts generated
by versioneer
* [#679](https://github.com/foosel/OctoPrint/issues/679) - Fix error where API state is requested and printer is offline
(backport of [619fe9a](https://github.com/foosel/OctoPrint/commit/619fe9a0e78826bd1524b235a910156439bcb6d7)).
* [#719](https://github.com/foosel/OctoPrint/issues/719) - Properly center print bed in GCODE viewer
* [#780](https://github.com/foosel/OctoPrint/issues/780) - Always (re)set file position in SD files to 0 so that reprints
work correctly (backported from ``devel``)
* [#801](https://github.com/foosel/OctoPrint/issues/801) - Fixed setting of bed temperature offset
* [IRC] - Don't hiccup on slic3r ``filament_diameter`` comments generated for multi extruder setups
* [ML] - Fixed relative URL to SockJS endpoint, wasn't yet using the proper base url
* [unreported] & [#698](https://github.com/foosel/OctoPrint/issues/698) - Generated URLs now take X-Forwarded-Host header
sent by proxies into account for included host and port, also fixed [#698](https://github.com/foosel/OctoPrint/issues/698)
introduced by this
* [unreported] Fixed a bug causing gcodeInterpreter to hiccup on GCODES containing invalid coordinates such as Xnan or
Yinf (backported from `devel`)
* Small fixes for timelapse creation:
- [#344](https://github.com/foosel/OctoPrint/issues/344) - Made timelapses capable of coping with missing captures in between by decrementing the image counter again if there
was an error fetching the latest image from the snapshot URL (backport of [1a7a468](https://github.com/foosel/OctoPrint/commit/1a7a468eb65fdf2a13b4c7a7723280e822c9c34b)
and [bf9d5ef](https://github.com/foosel/OctoPrint/commit/bf9d5efe43a1e57aacd8512125082ddca06b4efc))
- [#693](https://github.com/foosel/OctoPrint/issues/693) - Try not to capture an image if image counter is still unset
- [unreported] Synchronize image counter decrementing as well as incrementing to prevent rare race conditions when generating the
image file names
([Commits](https://github.com/foosel/OctoPrint/compare/1.1.1...1.1.2))
## 1.1.1 (2014-10-27)
@@ -90,11 +941,13 @@
* [#604](https://github.com/foosel/OctoPrint/issues/604) - Properly initialize settings basedir on server startup
* [IRC] Also allow downloading .g files via Tornado
([Commits](https://github.com/foosel/OctoPrint/compare/1.1.0...1.1.1))
## 1.1.0 (2014-09-03)
### New Features
* New REST API, including User API Keys additionally to the global API key. Please note that **this will break existing
* New REST API, including User API Keys additionally to the global API key. Please note that **this will break existing
API clients** as it replaces the old API (same endpoint). You can find the documentation of the new API at
[docs.octoprint.org](http://docs.octoprint.org/en/1.1.0/api/index.html).
* New Event structure allows more flexibility regarding payload data, configuration files will be migrated automatically.
@@ -119,9 +972,9 @@
* The dimensions of the print bed can now be configured via the Settings ([#396](https://github.com/foosel/OctoPrint/pull/396))
* Target temperature reporting format of Repetier Firmware is now supported as well ([360](https://github.com/foosel/OctoPrint/issues/360))
* Version tracking now based on git tagging and [versioneer](https://github.com/warner/python-versioneer/). Version number,
git commit and branch get reported in the format `<version tag>-<commits since then>-g<commit hash> (<branch> branch)`,
git commit and branch get reported in the format `<version tag>-<commits since then>-g<commit hash> (<branch> branch)`,
e.g. `1.2.0-dev-172-ga48b5de (devel branch)`.
* Made "Center viewport on model" and "Zoom in on model" in the GCODE viewer automatically deselect and de-apply if
* Made "Center viewport on model" and "Zoom in on model" in the GCODE viewer automatically deselect and de-apply if
viewport gets manipulated by the user ([#398](https://github.com/foosel/OctoPrint/issues/398))
* GCODE viewer now interprets inverted axes for printer control and mirrors print bed accordingly ([#431](https://github.com/foosel/OctoPrint/issues/431))
* Added `clean` command to `setup.py`, removes old build artifacts (mostly interesting for developers)
@@ -140,7 +993,7 @@
* [#381](https://github.com/foosel/OctoPrint/issues/381) - Only list those SD files that have an ASCII filename
* Fixed a race condition that could occur when pressing "Print" (File not opened yet, but attempt to read from it)
* [#398](https://github.com/foosel/OctoPrint/issues/398) - Fixed interfering options in GCODE viewer
* [#399](https://github.com/foosel/OctoPrint/issues/399) & [360](https://github.com/foosel/OctoPrint/issues/360) - Leave
* [#399](https://github.com/foosel/OctoPrint/issues/399) & [360](https://github.com/foosel/OctoPrint/issues/360) - Leave
bed temperature unset when not detected (instead of dying a horrible death)
* [#492](https://github.com/foosel/OctoPrint/issues/492) - Fixed a race condition which could lead to an attempt to read
from an already closed serial port, causing an error to be displayed to the user
+398 -16
View File
@@ -1,22 +1,404 @@
Issues, Tickets, however you may call them
------------------------------------------
# Contribution Guidelines
Read the following short instructions **fully** and **follow them** if you want your ticket to be taken care of and not closed again directly!
This document outlines what you need to know before **[creating tickets](#issues-tickets-however-you-may-call-them)**
or **[creating pull requests](#pull-requests)**.
- Always create **one ticket for one purpose**. So don't mix two or more feature requests, support requests, bugs etc into one ticket. If you do, your ticket will be treated as if only describing the first purpose, the others will be ignored!
- If you want to report a bug, **READ AND FOLLOW [How to file a bug report](https://github.com/foosel/OctoPrint/wiki/How-to-file-a-bug-report)!** Tickets will be automatically checked if they comply with the requirements outlined in that wiki node! Other then what's written in there (**and really EVERYTHING that is written in there!**) you don't have to do anything special with your ticket.
- If you want to post a **request** of any kind (feature request, documentation request, ...), **add [Request] to your issue's title!**
- If you need **support** with a problem of your installation (e.g. if you have problems getting the webcam to work), **add [Support] to your issue's title!**. Note that for problems like these, the [Mailinglist](https://groups.google.com/group/octoprint) or the [Google+ Community](https://plus.google.com/communities/102771308349328485741) will probably get you help faster!
- If you have a general **question**, **add [Question] to your issue's title!**. Note that for problems like these, the [Mailinglist](https://groups.google.com/group/octoprint) or the [Google+ Community](https://plus.google.com/communities/102771308349328485741) will probably get you help faster!
- If you have another reason for creating a ticket that doesn't fit any of the above categories, think hard if it might not be something better suited for the [Mailinglist](https://groups.google.com/group/octoprint) or the [Google+ Community](https://plus.google.com/communities/102771308349328485741). If you are sure it needs to be reported here, **add [Misc] to your issue's title!**
## Contents
Following these guidelines (**especially EVERYTHING mentioned in ["How to file a bug report"](https://github.com/foosel/OctoPrint/wiki/How-to-file-a-bug-report)**) is necessary so the tickets stay manageable - you are not the only one with an open issue, so please respect that you have to **play by the rules** so that your problem can be taken care of. Tickets not playing by the rules **will be closed without further investigation!**.
* [Issues, Tickets, however you may call them](#issues-tickets-however-you-may-call-them)
* [How to file a bug report](#how-to-file-a-bug-report)
* [What should I do before submitting a bug report?](#what-should-i-do-before-submitting-a-bug-report)
* [What should I include in a bug report?](#what-should-i-include-in-a-bug-report)
* [Where can I find which version and branch I'm on?](#where-can-i-find-which-version-and-branch-im-on)
* [Where can I find those log files you keep talking about?](#where-can-i-find-those-log-files-you-keep-talking-about)
* [Where can I find my browser's error console?](#where-can-i-find-my-browsers-error-console)
* [Pull requests](#pull-requests)
* [What do the branches mean?](#what-do-the-branches-mean)
* [How OctoPrint is versioned](#how-octoprint-is-versioned)
* [History](#history)
* [Footnotes](#footnotes)
Pull Requests
-------------
## Issues, Tickets, however you may call them
1. Please create all pull requests against the `devel` branch.
2. Create **one pull request per feature/bug fix**.
3. Create a custom branch for your feature/bug fix and use that as base for your pull request. Pull requests directly against your version of `devel` will be closed.
4. In your pull request's description, state what your pull request is doing, as in, what feature does it implement, what bug does it fix.
Please read the following short instructions fully and follow them. You can
help the project tremendously this way: not only do you help the maintainers
to **address problems in a timely manner** but also keep it possible for them
to **fix bugs, add new and improve on existing functionality** instead of doing
nothing but ticket management.
![Ticket flow chart](http://i.imgur.com/qYSZyuw.png)
- **[Read the FAQ](https://github.com/foosel/OctoPrint/wiki/FAQ)**
- If you want to report a **bug**, [read "How to file a bug report" below](#how-to-file-a-bug-report)
and *[use the provided template](#what-should-i-include-in-a-ticket)*.
You do not need to do anything else with your ticket.
- If you want to post a **feature request** or a **documentation request**, add `[Request]`
to your issue's title (e.g. `[Request] Awesome new feature`). A question on how to run/change/setup
something is **not** what qualifies as a request here, use the
[Mailinglist](https://groups.google.com/group/octoprint) or the
[Google+ Community](https://plus.google.com/communities/102771308349328485741) for
such support issues.
- If you are a **developer** that wants to brainstorm a pull request or possible
changes to the plugin system, add [Brainstorming] to your issue's title (e.g.
`[Brainstorming] New plugin hook for doing some cool stuff`).
- If you need **support**, have a **question** or some **other reason** that
doesn't fit any of the above categories, the issue tracker is not the right place.
Consult the [Mailinglist](https://groups.google.com/group/octoprint) or the
[Google+ Community](https://plus.google.com/communities/102771308349328485741) instead.
No matter what kind of ticket you create, never mix two or more "ticket reasons"
into one ticket: One ticket per bug, request, brainstorming thread please.
----
**Note**: A bot is in place that monitors new tickets, automatically
categorizes them and checks new bug reports for usage of the provided template.
That bot will only bother you if you open a ticket that appears to be a bug (no
`[Request]` or `[Brainstorming]` in the title) without the template, and it
will do that only to ensure that all information needed to solve the issue is
available for the maintainers to directly start tackling that problem.
----
## How to file a bug report
If you encounter an issue with OctoPrint, you are welcome to
[submit a bug report](https://github.com/foosel/OctoPrint/issues/new).
Before you do that for the first time though please take a moment to read the
following section *completely* and also follow the instructions in the
"new issue" form. Thank you! :)
### What should I do before submitting a bug report?
1. **Make sure you are at the right location**. This is the Github repository
of the official version of OctoPrint, which is the 3D print server and
corresponding web interface itself.
**This is not the Github respository of OctoPi**, which is the preconfigured
Raspberry Pi image including OctoPrint among other things - that one can be found
[here](https://github.com/guysoft/OctoPi). Please note that while we do have
some entries regarding OctoPi in the FAQ, any bugs should be reported in the
[proper bug tracker](https://github.com/guysoft/OctoPi/issues) which - again -
is not here.
**This is also not the Github repository of any OctoPrint Plugins you
might have installed**. Report any issues with those in their corresponding
bug tracker (probably linked to from the plugin's homepage).
Finally, **this is also not the right issue tracker if you are running a
forked version of OctoPrint**. Seek help for such unofficial versions from
the people maintaining them instead.
2. Please make sure to **test out the current version** of OctoPrint to see
whether the problem you are encountering still exists, and **test without
any non-bundled plugins enabled** to make sure it's not a misbehaving
plugin causing the issue at hand.
If you are feeling up to it you might also want to try the current development
version of OctoPrint (if you aren't already). Refer to the [FAQ](https://github.com/foosel/OctoPrint/wiki/FAQ)
for information on how to do this.
3. The problem still exists? Then please **look through the
[existing tickets](https://github.com/foosel/OctoPrint/issues?state=open)
(use the [search](https://github.com/foosel/OctoPrint/search?q=&ref=cmdform&type=Issues))**
to check if there already exists a report of the issue you are encountering.
Sorting through duplicates of the same issue sometimes causes more work than
fixing it. Take the time to filter through possible duplicates and be really
sure that your problem definitely is a new one. Try more than one search query
(e.g. do not only search for "webcam" if you happen to run into an issue
with your webcam, also search for "timelapse" etc). Do not only read the subject lines
of tickets that look like they might be related, but also read the ticket itself!
**Very important:** Please make absolutely sure that if you find a bug that looks like
it is the same as your's, it actually behaves the same as your's. E.g. if someone gives steps
to reproduce his bug that looks like your's, reproduce the bug like that if possible,
and only add a "me too" if you actually can reproduce the same
issue. Also **provide all information** as [described below](#what-should-i-include-in-a-bug-report)
and whatever was additionally requested over the course of the ticket
even if you "only" add to an existing ticket. The more information available regarding a bug, the higher
the chances of reproducing and solving it. But "me too" on an actually unrelated ticket
makes it more difficult due to on top of having to figure out the original problem
there's now also a [red herring](https://en.wikipedia.org/wiki/Red_herring) interfering - so please be
very diligent here!
### What should I include in a bug report?
First of all make sure your use **a descriptive title**. "It doesn't work"
and similar unspecific complaints are NOT descriptive titles.
**Always use the following template** (please remove what's within `[...]`, that's
only provided here as some additional information for you), **even if only adding a
"me too" to an existing ticket**:
#### What were you doing?
[Please be as specific as possible here. The maintainers will need to
reproduce your issue in order to fix it and that is not possible if they
don't know what you did to get it to happen in the first place.
If you encountered a problem with specific files of any sorts, make sure
to also include a link to a file with which to reproduce the problem.]
#### What did you expect to happen?
#### What happened instead?
#### Branch & Commit or Version of OctoPrint
[Can be found in the lower left corner of the web interface. ALWAYS INCLUDE.]
#### Printer model & used firmware incl. version
[If applicable, always include if unsure.]
#### Browser and Version of Browser, Operating System running Browser
[If applicable, always include if unsure.]
#### Link to octoprint.log
[On gist.github.com or pastebin.com. ALWAYS INCLUDE and never truncate.]
#### Link to contents of terminal tab or serial.log
[On gist.github.com or pastebin.com. If applicable, always include if unsure or
reporting communication issues. Never truncate.
serial.log is usually not written due to performance reasons and must be
enabled explicitly. Provide at the very least the FULL contents of your
terminal tab at the time of the bug occurrence, even if you do not have
a serial.log.]
#### Link to contents of Javascript console in the browser
[On gist.github.com or pastebin.com or alternatively a screenshot. If applicable -
always include if unsure or reporting UI issues.]
#### Screenshot(s) showing the problem:
[If applicable. Always include if unsure or reporting UI issues.]
I have read the FAQ.
Copy-paste this template **completely**. Do not skip any lines or the bot
*will* complain!
### Where can I find which version and branch I'm on?
You can find out all of them by taking a look into the lower left corner of the
OctoPrint UI:
![Current version and git branch info in OctoPrint's UI](http://i.imgur.com/HyHMlY2.png)
If you don't have access to the UI you can find out that information via the
command line as well. Either `octoprint --version` or `python setup.py version`
in OctoPrint's folder will tell you the version of OctoPrint you are running
(note: if it doesn't then you are running a version older than 1.1.0,
*upgrade now*). A `git branch` in your OctoPrint installation folder will mark
the branch you are on with a little *. `git rev-parse HEAD` will tell you the
current commit.
### Where can I find those log files you keep talking about?
OctoPrint by default provides two log outputs, a third one can be enabled if
more information is needed.
One is contained in the **"Terminal" tab** within OctoPrint's UI and is a log
of the last 300 lines of communication with the printer. Please copy-paste
this *completely* somewhere (disable auto scroll to make copying the contents easier) -
e.g. http://pastebin.com or http://gist.github.com - and include a link in
your bug report.
There is also **OctoPrint's application log file** or in short `octoprint.log`,
which is by default located at `~/.octoprint/logs/octoprint.log` on Linux,
`%APPDATA%\OctoPrint\logs\octoprint.log` on Windows and
`~/Library/Application Support/OctoPrint/logs/octoprint.log` on MacOS. You can
also access it directly through OctoPrint via Settings > Logs. Please
copy-paste this *completely* to pastebin or gist as well and include a link in your bug
report.
It might happen that you are asked to provide a more **thorough log of the
communication with the printer** if you haven't already done so, the `serial.log`.
This is not written by default due to performance reasons, but you can enable
it in the settings dialog. After enabling that log, please reproduce the problem
again (connect to the printer, do whatever triggers it), then copy-paste
`~/.octoprint/logs/serial.log` (Windows: `%APPDATA%\OctoPrint\logs\serial.log`,
MacOS: `~/Library/Application Support/OctoPrint/logs/serial.log`) to pastebin
or gist and include the link in the bug report.
You might also be asked to provide a log with an increased log level. You can
find information on how to do just that in the
[docs](http://docs.octoprint.org/en/master/configuration/logging_yaml.html).
### Where can I find my browser's error console?
See [How to open the Javascript Console in different browsers](https://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers)
## Pull requests
1. If you want to add a new feature to OctoPrint, **please always first
consider if it wouldn't be better suited for a plugin.** As a general rule
of thumb, any feature that is only of interest to a small sub group should
be moved into a plugin. If the current plugin system doesn't allow you to
implement your feature as a plugin, create a "Brainstorming" ticket to get
the discussion going on how best to solve *this* in OctoPrint's plugin
system - maybe that's the actual PR you have been waiting for to contribute :)
2. If you plan to make **any large or otherwise disruptive changes to the
code or appearance, please open a "Brainstorming" ticket first** so
that we can determine if it's a good time for your specific pull
request. It might be that we're currently in the process of making
heavy changes to the code locations you'd target as well, or your
approach doesn't fit the general "project vision", and that would
just cause unnecessary work and frustration for everyone or
possibly get the PR rejected.
3. Create your pull request **from a custom branch** on your end (e.g.
`dev/myNewFeature`)[1] **against the `devel` branch**. Create **one pull request
per feature/bug fix**. If your PR contains an important bug fix, we will
make sure to backport it to the `maintenance` branch to also include it in
the next release.
4. Make sure there are **only relevant changes** included in your PR. No
changes to unrelated files, no additional files that don't belong (e.g.
commits of your full virtual environment). Make sure your PR consists
**ideally of only one commit** (use git's rebase and squash functionality).
5. Make sure you **follow the current coding style**. This means:
* Tabs instead of spaces in the Python files[2]
* Spaces instead of tabs in the Javascript sources
* English language (code, variables, comments, ...)
* Comments where necessary: Tell *why* the code does something like it does
it, structure your code
* Following the general architecture
* If your PR needs to make changes to the Stylesheets, change the
``.less`` files from which the CSS is compiled.
* Make sure you do not add dead code (e.g. commented out left-overs
from experiments).
6. Ensure your changes **pass the existing unit tests**. PRs that break
those cannot be accepted.
7. **Test your changes thoroughly**. That also means testing with usage
scenarios you don't normally use, e.g. if you only use access control, test
without and vice versa. If you only test with your printer, test with the
virtual printer and vice versa. State in your pull request how your tested
your changes. Ideally **add unit tests** - OctoPrint severly lacks in that
department, but we are trying to change that, so any new code already covered
with a test suite helps a lot!
8. In your pull request's description, **state what your pull request does**,
as in, what feature does it implement, what bug does it fix. The more
thoroughly you explain your intent behind the PR here, the higher the
chances it will get merged fast. There is a template provided below
that can help you here.
9. Don't forget to **add yourself to the [AUTHORS](./AUTHORS.md)
file** :)
Template to use for Pull Request descriptions:
```
#### What does this PR do and why is it necessary?
#### How was it tested? How can it be tested by the reviewer?
#### Any background context you want to provide?
#### What are the relevant tickets if any?
#### Screenshots (if appropriate)
#### Further notes
```
## What do the branches mean?
There are three main branches in OctoPrint:
* `master`: The master branch always contains the current stable release. It
is *only* updated on new releases. Will have a version number following
the scheme `<x>.<y>.<z>` (e.g. `1.2.9`) or - if it's absolutely necessary to
add a commit after release to this branch - `<x>.<y>.<z>.post<commits since x.y.z>`
(e.g. `1.2.9.post1`).
* `maintenance`: Improvements and fixes of the current release that make up
the next release go here. More or less continously 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>.<z+1>.dev<commits since increase of z>` for an OctoPrint version of `<x>.<y>.<z>`
(e.g. `1.2.10.dev12`).
* `devel`: Ongoing development of new features that will go into the next bigger
release (MINOR version number increases) will happen on this branch. Usually
kept stable, sometimes stuff can break though or lose backwards compatibility
temporarily. Can be considered the "bleeding edge". All PRs should target
*this* branch. Important improvements and fixes from PRs here are backported to
`maintenance` as needed. Will usually have a version number following the
scheme `<x>.<y+1>.0.dev<commits since increase of y>` for a current OctoPrint version
of `<x>.<y>.<z>` (e.g. `1.3.0.dev123`).
* `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.2.9rc1`).
* `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>.<y+1>.0rc<n>` (e.g. `1.3.0rc1`)
for a current stable OctoPrint version of `<x>.<y>.<z>`.
Additionally, from time to time you might see other branches pop up in the repository.
Those usually have one of the following prefixes:
* `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 is also the `gh-pages` branch, which holds OctoPrint's web page, and a couple of
older development branches that are slowly being migrated or deleted.
## How OctoPrint is versioned
OctoPrint follows the [semantic versioning scheme](http://semver.org/) of **MAJOR.MINOR.PATCH**.
The **PATCH** version number is the one increasing most often due to OctoPrint's maintenance releases.
Releases that only change the patch number indicate that they contain bug fixes and small improvements
of existing functionality. Example: 1.2.8 to 1.2.9.
The **MINOR** version number increases with releases that add a lot of new functionality and
large features. Example: 1.2.x to 1.3.0.
Finally, the **MAJOR** version number increases if there are breaking API changes that concern any of the
documented interfaces (REST API, plugin interfaces, ...). So far this hasn't happened. Example: 1.x.y to 2.0.0.
OctoPrint's version numbers are automatically generated using [versioneer](https://github.com/warner/python-versioneer)
and depend on the selected git branch, nearest git tag and commits. The generated version number
should always be [PEP440](https://www.python.org/dev/peps/pep-0440/) compatible. 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.
## History
* 2015-01-23: More guidelines for creating pull requests, support/questions
redirected to Mailinglist/G+ community
* 2015-01-27: Added another explicit link to the FAQ
* 2015-07-07: Added step to add yourself to AUTHORS when creating a PR :)
* 2015-12-01: Heavily reworked to include examples, better structure and
all information in one document.
* 2016-02-10: Added information about branch structure and versioning.
* 2016-02-16: Added requirement to add information from template to existing
tickets as well, explained issue with "me too" red herrings.
* 2016-03-14: Some more requirements for PRs, and a PR template.
* 2016-06-08: New `prerelease` and `rc` branches explained.
* 2016-09-09: New `rc/*` branches explained.
* 2016-09-23: Some more work on "How to file a bug report" based on recent
experiences
## Footnotes
* [1] - If you are wondering why, the problem is that anything that you add
to your PR's branch will also become part of your PR, so if you create a
PR from your version of `devel` chances are high you'll add changes to the
PR that do not belong to the PR.
* [2] - Yes, we know that this goes against PEP-8. OctoPrint started out as
a fork of Cura and hence stuck to the coding style found therein. Changing
it now would make the history and especially `git blame` completely
unusable, so for now we'll have to deal with it (this decision might be
revisited in the future).
+5
View File
@@ -1,4 +1,9 @@
recursive-include src/octoprint/static *
recursive-include src/octoprint/templates *
recursive-include src/octoprint/plugins *
recursive-include src/octoprint/translations *
include versioneer.py
include src/octoprint/_version.py
include requirements.txt
include *.md
exclude CONTRIBUTING.md
+69 -20
View File
@@ -1,28 +1,69 @@
OctoPrint
=========
# OctoPrint
[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=foosel&url=https://github.com/foosel/OctoPrint&title=OctoPrint&language=&tags=github&category=software)
OctoPrint provides a responsive web interface for controlling a 3D printer (RepRap, Ultimaker, ...). It is Free Software
OctoPrint provides a snappy web interface for controlling a 3D printer (RepRap, Ultimaker, ...). It is Free Software
and released under the [GNU Affero General Public License V3](http://www.gnu.org/licenses/agpl.html).
Its website can be found at [octoprint.org](http://octoprint.org).
Contributing
------------
The documentation is located at [docs.octoprint.org](http://docs.octoprint.org).
Please see the project's [Contribution Guidelines](https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md).
The official plugin repository can be reached at [plugins.octoprint.org](http://plugins.octoprint.org).
Installation
------------
OctoPrint's development wouldn't be possible without the [financial support by its community](http://octoprint.org/support-octoprint/).
If you enjoy OctoPrint, please consider becoming a regular supporter!
Installation instructions for installing from source for different operating systems can be found [on the wiki](https://github.com/foosel/OctoPrint/wiki#assorted-guides).
![Screenshot](http://i.imgur.com/dF3noFp.png)
You are currently looking at the source code repository of OctoPrint. If you already installed it
(e.g. by using the Raspberry Pi targeted distribution [OctoPi](https://github.com/guysoft/OctoPi)) and only
want to find out how to use it, [the documentation](http://docs.octoprint.org/) and [the public wiki](https://github.com/foosel/OctoPrint/wiki)
might be of more interest for you. You might also want to subscribe to [the mailing list](https://groups.google.com/group/octoprint)
or the [G+ Community](https://plus.google.com/communities/102771308349328485741) where there are other active users who might be
able to help you with any questions you might have.
## Contributing
Contributions of all kinds are welcome, not only in the form of code but also with regards to the
[official documentation](http://docs.octoprint.org/) or [the public wiki](https://github.com/foosel/OctoPrint/wiki), support
of other users in the [bug tracker](https://github.com/foosel/OctoPrint/issues),
[the Mailinglist](https://groups.google.com/group/octoprint) or
[the G+ Community](https://plus.google.com/communities/102771308349328485741) and also [financially](http://octoprint.org/support-octoprint/).
If you think something is bad about OctoPrint or its documentation the way it is, please help
in any way to make it better instead of just complaining about it -- this is an Open Source Project
after all :)
For information about how to go about contributions of any kind, please see the project's
[Contribution Guidelines](https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md).
## Installation
Installation instructions for installing from source for different operating
systems can be found [on the wiki](https://github.com/foosel/OctoPrint/wiki#assorted-guides).
If you want to run OctoPrint on a Raspberry Pi you might want to take a look at [OctoPi](https://github.com/guysoft/OctoPi)
which is a custom SD card image that includes OctoPrint plus dependencies.
Dependencies
------------
The generic steps that should basically be done regardless of operating system
and runtime environment are the following (as *regular
user*, please keep your hands *off* of the `sudo` command here!) - this assumes
you already have Python 2.7, pip and virtualenv set up on your system:
1. Checkout OctoPrint: `git clone https://github.com/foosel/OctoPrint.git`
2. Change into the OctoPrint folder: `cd OctoPrint`
3. Create a user-owned virtual environment therein: `virtualenv venv`
4. Install OctoPrint *into that virtual environment*: `./venv/bin/python setup.py install`
You may then start the OctoPrint server via `/path/to/OctoPrint/venv/bin/octoprint`, see [Usage](#usage)
for details.
After installation, please make sure you follow the first-run wizard and set up
access control as necessary. If you want to not only be notified about new
releases but also be able to automatically upgrade to them from within
OctoPrint, take a look [at the documentation of the Software Update Plugin](https://github.com/foosel/OctoPrint/wiki/Plugin:-Software-Update#making-octoprint-updateable-on-existing-installations)
and at its settings.
## Dependencies
OctoPrint depends on a couple of python modules to do its job. Those are automatically installed when installing
OctoPrint via `setup.py`:
@@ -33,10 +74,13 @@ You should also do this every time after pulling from the repository, since the
OctoPrint currently only supports Python 2.7.
Usage
-----
## Usage
Running the `setup.py` script installs the `octoprint` script in your Python installation's scripts folder
Running the `setup.py` script via
python setup.py install
installs the `octoprint` script in your Python installation's scripts folder
(which depending on whether you installed OctoPrint globally or into a virtual env will be on your `PATH` or not). The
following usage examples assume that said `octoprint` script is on your `PATH`.
@@ -69,13 +113,18 @@ See `octoprint --help` for further information.
OctoPrint also ships with a `run` script in its source directory. You can also invoke that to start up the server, it
takes the same command line arguments as the `octoprint` script.
Configuration
-------------
## Configuration
If not specified via the commandline, the configfile `config.yaml` for OctoPrint is expected in the settings folder,
which is located at `~/.octoprint` on Linux, at `%APPDATA%/OctoPrint` on Windows and
at `~/Library/Application Support/OctoPrint` on MacOS.
A comprehensive overview of all available configuration settings can be found
[on the wiki](https://github.com/foosel/OctoPrint/wiki/Configuration). Please note that the most commonly used
configuration settings can also easily be edited from OctoPrint's settings dialog.
[in the docs](http://docs.octoprint.org/en/master/configuration/config_yaml.html).
Please note that the most commonly used configuration settings can also easily
be edited from OctoPrint's settings dialog.
## Special Thanks
Cross-browser testing services are kindly provided by [BrowserStack](http://www.browserstack.com/).
Profiling is done with the help of [PyVmMonitor](http://www.pyvmmonitor.com).
+73
View File
@@ -0,0 +1,73 @@
# Supporters
Development of this version of OctoPrint wouldn't have been possible without
[financial support by the community](http://octoprint.org/support-octoprint/) -
thanks to everyone who contributed!
## Patreon Patrons
* 3D Moniak
* Aleph Objects, Inc.
* Andrew Moorby
* Arnljot Arntsen
* Aurelio Bernal
* Bart Zudell
* Boris Hussein
* Brad Jackson
* Brad Mooneyham
* Brent Fiegle
* Brian E. Tyler
* Charles Mitchell
* Christopher Day
* Christian Petropolis
* COLLE+McVOY
* CreativeTools
* D Brian Kimmel
* DeltaMaker 3D Printers
* Doug Johnson
* E3D BigBox
* Erik de Bruijn
* Ernesto Martinez
* Exovite
* Frank Sander
* Gary Deen
* Gary N McKinney
* George Robles
* J. Eckert
* Jason Galarneau
* Josh Daniels
* Joshua David Gregory
* Kaile Riser
* Kale Stedman
* Kazuhiro Ogura
* Lamin Kivelä
* M Khorakiwala
* Makespace Madrid
* Mark Qvist
* Mark Walker
* Masayoshi Mitsui
* Michael Aumock
* Michael McDargh Sr
* Miles Flavel
* Noe Ruiz
* Patrick McGinnis
* Peter Grace
* Peter Schmehl
* PRINT3Dforum.com
* Robert Gusek
* Roger Strolz
* Roy Cortes
* Samer Najia
* SD3D
* SeeMeCNC
* Shane Ekerbicer
* Simon Hallam
* Stefan Krister
* Stephane Schittly
* Steven Pearson
* Sven Mueller
* Terrance Shaw
* Thomas Hatley
* Trent Shumay
and 989 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
+55
View File
@@ -0,0 +1,55 @@
# Third Party Licenses
## Web Interface
* [AVLTree](https://gist.github.com/viking/2424106) (modified): GPL, LGPL (dual licensed)
* [Babel JavaScript Support](https://github.com/mitsuhiko/babel/blob/master/contrib/babel.js): BSD
* [Bootstrap](http://getbootstrap.com/): Apache License 2.0
* [Bootstrap Modal](http://jschr.github.io/bootstrap-modal/): Apache License 2.0
* [Bootstrap Slider Knockout Bindings](https://github.com/cosminstefanxp/bootstrap-slider-knockout-binding): MIT
* [Bootstrap Slider](http://seiyria.com/bootstrap-slider/): Apache License 2.0
* [Bootstrap Tabdrop](http://www.eyecon.ro/bootstrap-tabdrop): Apache License 2.0
* [Detect Mobile Browser](http://detectmobilebrowsers.com/): Public Domain
* [Flot](http://www.flotcharts.org/): MIT
* [JavaScript MD5](https://github.com/blueimp/JavaScript-MD5): MIT
* [JQuery](http://jquery.com/): MIT
* [JQuery Bootstrap Wizard](http://github.com/VinceG/twitter-bootstrap-wizard): MIT, GPL (dual licensed)
* [JQuery File Upload](https://github.com/blueimp/jQuery-File-Upload): MIT
* [JQuery iframe transport](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.iframe-transport.js): MIT
* [JQuery QRCode](http://larsjung.de/jquery-qrcode/): MIT
* [JQuery Slimscroll](http://rocha.la/jQuery-slimScroll): MIT, GPL (dual licensed)
* [JQuery UI Core, Mouse, Slider and Widget](http://jqueryui.com): MIT
* [Knockout](http://knockoutjs.com/): MIT
* [LESS](http://lesscss.org): Apache License 2.0
* [lodash](https://lodash.com): MIT
* [Loglevel](https://github.com/pimterry/loglevel): MIT
* [Modernizr](http://modernizr.com): MIT
* [Moment.js](http://momentjs.com/): MIT
* [PNotify](http://sciactive.com/pnotify/): GPL, LGPL, MPL (triple licensed)
* [pusher.color.js](http://cache.preserve.io/5g18q0pw/index.html) (original link dead): MIT
* [SockJS](https://github.com/sockjs/sockjs-client): MIT
* [sprintf-js](http://alexei.ro/): BSD
## Server
* [feedparser](https://github.com/kurtmckee/feedparser): BSD
* [Flask](http://flask.pocoo.org/): BSD
* [Flask-Assets](http://github.com/miracle2k/flask-assets): BSD
* [Flask-Babel](http://github.com/mitsuhiko/flask-babel): BSD
* [Flask-Login](https://github.com/maxcountryman/flask-login): MIT
* [Flask-Markdown](http://github.com/dcolish/flask-markdown): BSD
* [Flask-Principal](http://packages.python.org/Flask-Principal/): MIT
* [netaddr](https://github.com/drkjam/netaddr/): BSD
* [netifaces](https://bitbucket.org/al45tair/netifaces): MIT
* [pkginfo](http://pypi.python.org/pypi/pkginfo/): Python
* [psutil](https://github.com/giampaolo/psutil): BSD
* [pylru](https://github.com/jlhutch/pylru): GPLv2
* [pyserial](http://pyserial.sourceforge.net/): Python
* [PyYAML](http://pyyaml.org/wiki/PyYAML): MIT
* [requests](http://python-requests.org/): Apache License 2.0
* [rsa](http://stuvel.eu/rsa): Apache License 2.0
* [sarge](http://sarge.readthedocs.org/): BSD
* [semantic_version](https://github.com/rbarrois/python-semanticversion): BSD
* [SockJS-Tornado](http://github.com/mrjoes/sockjs-tornado/): MIT
* [Tornado](http://www.tornadoweb.org/): Apache License 2.0
* [watchdog](http://github.com/gorakhargosh/watchdog): Apache License 2.0
+3 -1
View File
@@ -1,6 +1,8 @@
[python: src/octoprint/**.py]
[jinja2: src/octoprint/templates/**.jinja2]
extensions=jinja2.ext.autoescape, jinja2.ext.with_
[jinja2: src/octoprint/plugins/**.jinja2]
extensions=jinja2.ext.autoescape, jinja2.ext.with_, webassets.ext.jinja2.AssetsExtension
[javascript: src/octoprint/static/js/app/**.js]
[javascript: src/octoprint/plugins/**.js]
extract_messages = gettext, ngettext
+54
View File
@@ -0,0 +1,54 @@
/* override table width restrictions */
.wy-table-responsive table td, .wy-table-responsive table th {
/* !important prevents the common CSS stylesheets from
overriding this as on RTD they are loaded after this stylesheet */
white-space: normal !important;
}
.wy-table-responsive {
overflow: visible !important;
}
/* style headlink for code block captions like other headlinks */
.code-block-caption .headerlink {
display: none;
visibility: hidden;
font-size: 14px;
font-family: inherit;
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
}
.code-block-caption:hover .headerlink {
display: inline-block;
}
.code-block-caption .headerlink:after {
visibility: visible;
content: "\f0c1";
font-family: FontAwesome;
display: inline-block;
}
/* make whitespace visualization in code listings not appear on same vertical position as dashes */
.highlight .w {
vertical-align: 10%;
}
/* make code tags non-red again */
code,
.rst-content tt {
color: #000 !important;
}
a code,
.rst-content a tt {
color: #2980B9 !important;
}
a:visited code,
.rst-content a:visited tt {
color: #9B59B6 !important;
}
+24 -1
View File
@@ -75,6 +75,12 @@ Issue a connection command
disconnect
Instructs OctoPrint to disconnect from the printer.
fake_ack
Fakes an acknowledgement message for OctoPrint in case one got lost on the serial line and the communication
with the printer since stalled. This should only be used in "emergencies" (e.g. to save prints), the reason
for the lost acknowledgement should always be properly investigated and removed instead of depending on this
"symptom solver".
**Example Connect Request**
.. sourcecode:: http
@@ -114,7 +120,24 @@ Issue a connection command
HTTP/1.1 204 No Content
:json string command: The command to issue, either ``connect`` or ``disconnect``
**Example FakeAck Request**
.. sourcecode:: http
POST /api/connection HTTP/1.1
Host: example.com
Content-Type: application/json
X-Api-Key: abcdef...
{
"command": "fake_ack"
}
.. sourcecode:: http
HTTP/1.1 204 No Content
:json string command: The command to issue, either ``connect``, ``disconnect`` or ``fake_ack``.
:json string port: ``connect`` command: The port to connect to. If left out either the existing ``portPreference``
will be used, or if that is not available OctoPrint will attempt auto detection. Must be part
of the available ports.
+46 -39
View File
@@ -216,6 +216,10 @@ Progress information
File related
============
.. todo::
Update to reflect enhanced data now available.
.. _sec-api-datamodel-files-file:
File information
@@ -233,10 +237,51 @@ File information
- 1
- String
- The name of the file
* - ``type``
- 1
- String
- Type of file. ``model`` or ``machinecode``. Or ``folder`` if it's a folder, in which case the ``children``
node will be populated
Additional properties depend on ``type``. For a ``type`` value of ``folder``, see "Folders". For any other value
see "Files".
Folders
'''''''
.. list-table::
:widths: 15 5 10 30
:header-rows: 1
* - Name
- Multiplicity
- Type
- Description
* - ``children``
- 0..*
- Array of :ref:`File information items <sec-api-datamodel-files-file>`
- Contained children for entries of type ``folder``
Files
'''''
.. list-table::
:widths: 15 5 10 30
:header-rows: 1
* - Name
- Multiplicity
- Type
- Description
* - ``hash``
- 1
- String
- MD5 hash of the file
* - ``size``
- 0..1
- Number
- The size of the file in bytes. Only available for ``local`` files.
- The size of the file in bytes. Only available for ``local`` files or ``sdcard`` files if the printer
supports file sizes for sd card files.
* - ``date``
- 0..1
- Unix timestamp
@@ -254,10 +299,6 @@ File information
- 0..1
- :ref:`GCODE analysis information <sec-api-datamodel-files-gcodeanalysis>`
- Information from the analysis of the GCODE file, if available. Left out in abridged version.
* - ``prints``
- 0..1
- :ref:`Print history <sec-api-datamodel-files-prints>`
- Information regarding prints of this file, if available. Left out in abridged version.
.. _sec-api-datamodel-files-gcodeanalysis:
@@ -290,40 +331,6 @@ GCODE analysis information
- The volume of filament used, in cm³
.. _sec-api-datamodel-files-prints:
Print history
-------------
.. list-table::
:widths: 15 5 10 30
:header-rows: 1
* - Name
- Multiplicity
- Type
- Description
* - ``failure``
- 1
- Number
- The number of failed prints on record for the file
* - ``success``
- 1
- Number
- The number of successful prints on record for the file
* - ``last``
- 0..1
- Object
- Information regarding the last print on record for the file
* - ``last.date``
- 1
- Unix timestamp
- Timestamp when this file was printed last
* - ``last.success``
- 1
- Boolean
- Whether the last print on record was a success (``true``) or not (``false``)
.. _sec-api-datamodel-files-ref:
References
+50 -14
View File
@@ -161,18 +161,10 @@ Upload file
Content-Disposition: form-data; name="file"; filename="whistle_v2.gcode"
Content-Type: application/octet-stream
;Generated with Cura_SteamEngine 13.11.2
M109 T0 S220.000000
T0
;Sliced at: Wed 11-12-2013 16:53:12
;Basic settings: Layer height: 0.2 Walls: 0.8 Fill: 20
;Print time: #P_TIME#
;Filament used: #F_AMNT#m #F_WGHT#g
;Filament cost: #F_COST#
;M190 S70 ;Uncomment to add your own bed temperature line
;M109 S220 ;Uncomment to add your own temperature line
G21 ;metric values
G90 ;absolute positioning
G21
G90
...
------WebKitFormBoundaryDeC2E3iWbTv1PwMC
Content-Disposition: form-data; name="select"
@@ -188,7 +180,7 @@ Upload file
HTTP/1.1 200 OK
Content-Type: application/json
Location: http://example.com/api/files/sdcard/whistle_.gcode
Location: http://example.com/api/files/sdcard/whistle_v2.gcode
{
"files": {
@@ -208,6 +200,46 @@ Upload file
}
}
},
"done": false
}
**Example with UTF-8 encoded filename following RFC 5987**
.. sourcecode:: http
POST /api/files/local HTTP/1.1
Host: example.com
X-Api-Key: abcdef...
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryDeC2E3iWbTv1PwMC
------WebKitFormBoundaryDeC2E3iWbTv1PwMC
Content-Disposition: form-data; name="file"; filename*=utf-8''20mm-%C3%BCml%C3%A4ut-b%C3%B6x.gcode
Content-Type: application/octet-stream
M109 T0 S220.000000
T0
G21
G90
...
------WebKitFormBoundaryDeC2E3iWbTv1PwMC--
.. sourcecode:: http
HTTP/1.1 200 OK
Content-Type: application/json
Location: http://example.com/api/files/local/20mm-umlaut-box.gcode
{
"files": {
"local": {
"name": "20mm-umlaut-box",
"origin": "local",
"refs": {
"resource": "http://example.com/api/files/local/whistle_v2.gcode",
"download": "http://example.com/downloads/files/local/whistle_v2.gcode"
}
}
},
"done": true
}
@@ -219,8 +251,11 @@ Upload file
to ``false``.
:form print: Whether to start printing the file directly after upload (``true``) or not (``false``). If set, `select`
is implicitely ``true`` as well. Optional, defaults to ``false``.
:form userdata: [Optional] An optional string that if specified will be interpreted as JSON and then saved along
with the file as metadata (metadata key ``userdata``)
:statuscode 201: No error
:statuscode 400: If no `file` is included in the request, or the request is otherwise invalid.
:statuscode 400: If no `file` is included in the request, `userdata` was provided but could not be parsed as JSON
or the request is otherwise invalid.
:statuscode 404: If `location` is neither ``local`` nor ``sdcard`` or trying to upload to SD card and SD card support
is disabled
:statuscode 409: If the upload of the file would override the file that is currently being printed or if an upload
@@ -387,8 +422,9 @@ Issue a file command
}
:param target: The target location on which to delete the file, either ``local`` (for OctoPrint's ``uploads``
folder) or ``sdcard`` for the printer's SD card (if available)
:param target: The target location on which the file to send the command for is located, either
``local`` (for OctoPrint's ``uploads`` folder) or ``sdcard`` for the printer's SD card
(if available)
:param filename: The filename of the file for which to issue the command
:json string command: The command to issue for the file, currently only ``select`` is supported
:json boolean print: ``select`` and ``slice`` command: Optional, whether to start printing the file directly after selection
+13 -1
View File
@@ -74,7 +74,19 @@ Encoding
OctoPrint uses UTF-8 as charset.
.. _sec-api-cross-origin:
That also includes headers in ``multipart/form-data`` requests, in order to allow the full UTF-8 range of characters
for uploaded filenames. If a ``multipart/form-data`` sub header cannot be decoded as UTF-8, OctoPrint will also attempt
to decode it as ISO-8859-1.
Additionally, OctoPrint supports replacing the ``filename`` field in the ``Content-Disposition`` header of a
multipart field with a ``filename*`` field following `RFC 5987, Section 3.2 <https://tools.ietf.org/html/rfc5987#section-3.2>`_,
which allows defining the charset used for encoding the filename. If both ``filename`` and ``filename*`` fields are
present, following the recommendation of the RFC ``filename*`` will be used.
For an example on how to send a request utilizing RFC 5987 for the ``filename*`` attribute, see the second example
in :ref:`Upload file <sec-api-fileops-uploadfile>`.
.. _sec-api-general-crossorigin:
Cross-origin requests
=====================
+3 -3
View File
@@ -1,8 +1,8 @@
.. _sec-api:
#################
API Documentation
#################
########
REST API
########
.. toctree::
:maxdepth: 2
+71 -13
View File
@@ -19,17 +19,38 @@ Issue a job command
Starts the print of the currently selected file. For selecting a file, see :ref:`Issue a file command <sec-api-fileops-filecommand>`.
If a print job is already active, a :http:statuscode:`409` will be returned.
cancel
Cancels the current print job. If no print job is active (either paused or printing), a :http:statuscode:`409`
will be returned.
restart
Restart the print of the currently selected file from the beginning. There must be an active print job for this to work
and the print job must currently be paused. If either is not the case, a :http:statuscode:`409` will be returned.
pause
Pauses/unpauses the current print job. If no print job is active (either paused or printing), a :http:statuscode:`409`
will be returned.
Equivalent to issuing a ``cancel`` command while paused, directly followed by a ``start`` command.
cancel
Cancels the current print job. If no print job is active (either paused or printing), a :http:statuscode:`409`
will be returned.
pause
Pauses/resumes/toggles the current print job. Accepts one optional additional parameter ``action``
specifying which action to take. Valid values for this parameter are:
pause
Pauses the current job if it's printing, does nothing if it's already paused.
resume
Resumes the current job if it's paused, does nothing if it's printing.
toggle
Toggles the pause state of the job, pausing it if it's printing and resuming it if it's currently paused.
In order to stay backwards compatible to earlier iterations of this API, the default
action to take if no ``action`` parameter is supplied is to toggle the print job status.
If no print job is active (either paused or printing), a :http:statuscode:`409` will be returned.
.. note::
While the approach to implement pause/resume/toggle behaviour through sub commands via the ``action``
parameter instead of having dedicated ``pause``, ``resume`` and ``toggle`` commands seems clumsy, this path
was chosen to have the API stay backwards compatible to prior versions which only offered the toggle
behaviour under the ``pause`` command.
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
@@ -37,7 +58,7 @@ Issue a job command
.. sourcecode:: http
POST /api/control/job HTTP/1.1
POST /api/job HTTP/1.1
Host: example.com
Content-Type: application/json
X-Api-Key: abcdef...
@@ -50,11 +71,28 @@ Issue a job command
HTTP/1.1 204 No Content
**Example Cancel Request**
.. sourcecode:: http
POST /api/job HTTP/1.1
Host: example.com
Content-Type: application/json
X-Api-Key: abcdef...
{
"command": "cancel"
}
.. sourcecode:: http
HTTP/1.1 204 No Content
**Example Restart Request**
.. sourcecode:: http
POST /api/control/job HTTP/1.1
POST /api/job HTTP/1.1
Host: example.com
Content-Type: application/json
X-Api-Key: abcdef...
@@ -71,30 +109,50 @@ Issue a job command
.. sourcecode:: http
POST /api/control/job HTTP/1.1
POST /api/job HTTP/1.1
Host: example.com
Content-Type: application/json
X-Api-Key: abcdef...
{
"command": "pause"
"command": "pause",
"action": "pause"
}
.. sourcecode:: http
HTTP/1.1 204 No Content
**Example Cancel Request**
**Example Resume Request**
.. sourcecode:: http
POST /api/control/job HTTP/1.1
POST /api/job HTTP/1.1
Host: example.com
Content-Type: application/json
X-Api-Key: abcdef...
{
"command": "cancel"
"command": "pause",
"action": "resume"
}
.. sourcecode:: http
HTTP/1.1 204 No Content
**Example Pause Toggle Request**
.. sourcecode:: http
POST /api/job HTTP/1.1
Host: example.com
Content-Type: application/json
X-Api-Key: abcdef...
{
"command": "pause",
"action": "toggle"
}
.. sourcecode:: http
+1 -1
View File
@@ -15,7 +15,7 @@ Log file management
Retrieve a list of available log files
======================================
.. http:post:: /api/logs
.. http:get:: /api/logs
Retrieve information regarding all log files currently available and regarding the disk space still available
in the system on the location the log files are being stored.
+157 -8
View File
@@ -25,7 +25,8 @@ Tool
See :ref:`sec-api-printer-toolcommand`.
Bed
Bed commands allow setting the temperature and temperature offset for the printer's heated bed. Querying the
corresponding resource returns temperature information including an optional history.
corresponding resource returns temperature information including an optional history. Note that Bed commands
are only available if the currently selected printer profile has a heated bed.
See :ref:`sec-api-printer-bedcommand`.
SD card
SD commands allow initialization, refresh and release of the printer's SD card (if available). Querying the
@@ -199,8 +200,13 @@ Issue a print head command
* ``axes``: A list of axes which to home, valid values are one or more of ``x``, ``y``, ``z``.
All of these commands may only be sent if the printer is currently operational and not printing. Otherwise a
:http:statuscode:`409` is returned.
feedrate
Changes the feedrate factor to apply to the movement's of the axes.
* ``factor``: The new factor, percentage as integer or float (percentage divided by 100) between 50 and 200%.
All of these commands except ``feedrate`` may only be sent if the printer is currently operational and not printing.
Otherwise a :http:statuscode:`409` is returned.
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
@@ -246,13 +252,34 @@ Issue a print head command
HTTP/1.1 204 No Content
**Example feed rate request**
Set the feed rate factor to 105%.
.. sourcecode:: http
POST /api/printer/printhead HTTP/1.1
Host: example.com
Content-Type: application/json
X-Api-Key: abcdef...
{
"command": "feedrate",
"factor": 105
}
.. sourcecode:: http
HTTP/1.1 204 No Content
:json string command: The command to issue, either ``jog`` or ``home``.
:json number x: ``jog`` command: The amount to travel on the X axis in mm.
:json number y: ``jog`` command: The amount to travel on the Y axis in mm.
:json number z: ``jog`` command: The amount to travel on the Z axis in mm.
:json array axes: ``home`` command: The axes which to home, valid values are one or more of ``x``, ``y`` and ``z``.
:json number factor: ``feedrate`` command: The factor to apply to the feed rate, percentage between 50 and 200% as integer or float.
:statuscode 204: No error
:statuscode 400: Invalid axis specified, invalid value for travel amount for a jog command or otherwise invalid
:statuscode 400: Invalid axis specified, invalid value for travel amount for a jog command or factor for feed rate or otherwise invalid
request.
:statuscode 409: If the printer is not operational or currently printing.
@@ -288,6 +315,10 @@ Issue a tool command
* ``amount``: The amount of filament to extrude in mm. May be negative to retract.
flowrate
Changes the flow rate factor to apply to extrusion of the tool.
* ``factor``: The new factor, percentage as integer or float (percentage divided by 100) between 75 and 125%.
All of these commands may only be sent if the printer is currently operational and -- in case of ``select`` and
``extrude`` -- not printing. Otherwise a :http:statuscode:`409` is returned.
@@ -400,14 +431,35 @@ Issue a tool command
HTTP/1.1 204 No Content
**Example flow rate request**
Set the flow rate factor to 95%.
.. sourcecode:: http
POST /api/printer/tool HTTP/1.1
Host: example.com
Content-Type: application/json
X-Api-Key: abcdef...
{
"command": "flowrate",
"factor": 95
}
.. sourcecode:: http
HTTP/1.1 204 No Content
:json string command: The command to issue, either ``target``, ``offset``, ``select`` or ``extrude``.
:json object targets: ``target`` command: The target temperatures to set. Valid properties have to match the format ``tool{n}``.
:json object offsets: ``offset`` command: The offset temperature to set. Valid properties have to match the format ``tool{n}``.
:json object tool: ``select`` command: The tool to select, value has to match the format ``tool{n}``.
:json object amount: ``extrude`` command: The amount of filament to extrude from the currently selected tool.
:json number factor: ``flowrate`` command: The factor to apply to the flow rate, percentage between 75 and 125% as integer or float.
:statuscode 204: No error
:statuscode 400: If ``targets`` or ``offsets`` contains a property or ``tool`` contains a value not matching the format
``tool{n}``, the target/offset temperature or extrusion amount is not a valid number or outside of
``tool{n}``, the target/offset temperature, extrusion amount or flow rate factor is not a valid number or outside of
the supported range, or if the request is otherwise invalid.
:statuscode 409: If the printer is not operational or -- in case of ``select`` or ``extrude`` -- currently printing.
@@ -513,6 +565,9 @@ Issue a bed command
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
If no heated bed is configured for the currently selected printer profile, the resource will return
an :http:statuscode:`409`.
**Example Target Temperature Request**
Set the target temperature for the printer's heated bed to 75°C.
@@ -559,7 +614,8 @@ Issue a bed command
:statuscode 204: No error
:statuscode 400: If ``target`` or ``offset`` is not a valid number or outside of the supported range, or if the
request is otherwise invalid.
:statuscode 409: If the printer is not operational.
:statuscode 409: If the printer is not operational or the selected printer profile
does not have a heated bed.
.. _sec-api-printer-bedstate:
@@ -576,6 +632,9 @@ Retrieve the current bed state
Returns a :http:statuscode:`200` with a Temperature Response in the body upon success.
If no heated bed is configured for the currently selected printer profile, the resource will return
an :http:statuscode:`409`.
.. note::
If you want both tool and bed temperature information at the same time, take a look at
:ref:`Retrieve the current printer state <sec-api-printer-state>`.
@@ -624,7 +683,8 @@ Retrieve the current bed state
:query limit: If set to an integer (``n``), only the last ``n`` data points from the printer's temperature history
will be returned. Will be ignored if ``history`` is not enabled.
:statuscode 200: No error
:statuscode 409: If the printer is not operational.
:statuscode 409: If the printer is not operational or the selected printer profile
does not have a heated bed.
.. _sec-api-printer-sdcommand:
@@ -755,6 +815,61 @@ Retrieve the current SD state
:statuscode 200: No error
:statuscode 404: If SD support has been disabled in OctoPrint's config.
.. _sec-api-printer-arbcommand:
Send an arbitrary command to the printer
========================================
.. http:post:: /api/printer/command
Sends any command to the printer via the serial interface. Should be used with some care as some commands can interfere with
or even stop a running print job.
Expects a :ref:`Arbitrary Command Request <sec-api-printer-datamodel-arbcommand>` as the request's body.
If successful returns a :http:statuscode:`204` and an empty body.
**Example for sending a single command**
.. sourcecode:: http
POST /api/printer/command HTTP/1.1
Host: example.com
Content-Type: application/json
X-Api-Key: abcdef...
{
"command": "M106"
}
.. sourcecode:: http
HTTP/1.1 204 No Content
**Example for sending multiple commands**
.. sourcecode:: http
POST /api/printer/command HTTP/1.1
Host: example.com
Content-Type: application/json
X-Api-Key: abcdef...
{
"commands": [
"M18",
"M106 S0"
]
}
.. sourcecode:: http
HTTP/1.1 204 No Content
:json string command: Single command to send to the printer, mutually exclusive with ``commands``.
:json string commands: List of commands to send to the printer, mutually exclusive with ``command``.
:statuscode 204: No error
.. _sec-api-printer-datamodel:
Datamodel
@@ -807,7 +922,8 @@ Temperature State
* - ``bed``
- 0..1
- :ref:`Temperature Data <sec-api-datamodel-printer-tempdata>`
- Current temperature stats for the printer's heated bed. Not included if querying only tool state.
- Current temperature stats for the printer's heated bed. Not included if querying only tool state or if
the currently selected printer profile does not have a heated bed.
* - ``history``
- 0..1
- List of :ref:`Historic Temperature Datapoint <sec-api-datamodel-printer-temphistory>`
@@ -831,3 +947,36 @@ SD State
- Boolean
- Whether the SD card has been initialized (``true``) or not (``false``).
.. _sec-api-printer-datamodel-arbcommand:
Arbitrary Command Request
-------------------------
.. list-table::
:widths: 15 5 10 30
:header-rows: 1
* - Name
- Multiplicity
- Type
- Description
* - ``command``
- 0..1
- String
- Single command to send to the printer, mutually exclusive with ``commands`` and ``script``.
* - ``commands``
- 0..*
- Array of String
- Multiple commands to send to the printer (in the given order), mutually exclusive with ``command`` and ``script``.
* - ``script``
- 0..*
- String
- Name of the GCODE script template to send to the printer, mutually exclusive with ``command`` and ``commands``.
* - ``parameters``
- 0..1
- Map of key value pairs
- Key value pairs of parameters to replace in sent commands/provide to the script renderer
* - ``context``
- 0..1
- Map of key value pairs
- (only if ``script`` is set) additional template variables to provide to the script renderer
+2 -2
View File
@@ -65,7 +65,7 @@ Profile list
- :ref:`Profile <sec-api-slicing-datamodel-profile>`
- Information about a profile stored in the system.
.. _sec-api-slicing-datamodel-update:
.. _sec-api-printerprofiles-datamodel-update:
Add or update request
---------------------
@@ -84,7 +84,7 @@ Add or update request
- Information about the profile being added/updated. For adding new profiles, all fields must be populated. For updating
and existing profile, only the values to be overwritten need to be supplied.
.. _sec-api-slicing-datamodel-profile:
.. _sec-api-printerprofiles-datamodel-profile:
Profile
-------
+19 -1
View File
@@ -12,7 +12,7 @@ Push updates
.. contents::
To enable real time information exchange between client and server, OctoPrint uses
To enable real time information exchange between client and server, OctoPrint uses
`SockJS <https://github.com/sockjs/sockjs-protocol>`_ to push
status updates, temperature changes etc to connected web interface instances.
@@ -43,6 +43,24 @@ Clients must ignore any unknown messages.
The data model of the attached payloads is described further below.
OctoPrint's SockJS socket also accepts one command from the client to the server,
the ``throttle`` command. Usually, OctoPrint will push the general state update
in the ``current`` message twice per second. For some clients that might still
be too fast, so they can signal a different factor to OctoPrint utilizing the
``throttle`` message. OctoPrint expects a single integer here which represents
the multiplier for the base rate limit of one message every 500ms. A value of
1 hence will produce the default behaviour of getting every update. A value of
2 will set the rate limit to maximally one message every 1s, 3 to maximally one
message every 1.5s and so on.
Example for a ``throttle`` client-server-message:
.. sourcecode:: javascript
{
"throttle": 2
}
.. _sec-api-push-datamodel:
Datamodel
+5 -4
View File
@@ -32,7 +32,7 @@ List All Slicers and Slicing Profiles
.. sourcecode:: http
GET /api/slicing/profiles HTTP/1.1
GET /api/slicing HTTP/1.1
Host: example.com
X-Api-Key: abcdef...
@@ -110,7 +110,7 @@ List Slicing Profiles of a Specific Slicer
:param slicer: The identifying key of the slicer for which to list the available profiles.
:statuscode 200: No error
:statuscode 404: If the ``slicer`` was unknown to the system.
:statuscode 404: If the ``slicer`` was unknown to the system or not yet configured.
.. _sec-api-slicing-listspecific:
@@ -155,7 +155,7 @@ Retrieve Specific Profile
:param slicer: The identifying key of the slicer for which to list the available profiles.
:param name: The identifying key of the profile to retrieve
:statuscode 200: No error
:statuscode 404: If the ``slicer`` or the profile was unknown to the system.
:statuscode 404: If the ``slicer`` or the profile ``key`` was unknown to the system.
.. _sec-api-slicing-add:
@@ -215,7 +215,8 @@ Delete Slicing Profile
.. http:delete:: /api/slicing/(string:slicer)/profiles/(string:key)
Delete the slicing profile identified by ``key`` for the slicer ``slicer``.
Delete the slicing profile identified by ``key`` for the slicer ``slicer``. If the profile doesn't exist, the
request will succeed anyway.
:param slicer: The identifying key of the slicer for which to delete the profile
:param key: The identifying key of the profile to delete
+17 -11
View File
@@ -17,6 +17,7 @@ import sys, os
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../src/'))
sys.path.append(os.path.abspath('sphinxext'))
import octoprint._version
from datetime import date
@@ -27,11 +28,12 @@ year_current = date.today().year
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
needs_sphinx = '1.3'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.todo', 'sphinx.ext.autodoc', 'sphinxcontrib.httpdomain']
extensions = ['codeblockext', 'onlineinclude', 'sphinx.ext.todo', 'sphinx.ext.autodoc', 'sphinxcontrib.httpdomain',
'sphinx.ext.napoleon']
todo_include_todos = True
# Add any paths that contain templates here, relative to this directory.
@@ -96,6 +98,7 @@ pygments_style = 'sphinx'
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
numfig = True
# -- Options for HTML output ---------------------------------------------------
@@ -103,9 +106,9 @@ pygments_style = 'sphinx'
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
@@ -140,6 +143,9 @@ if not on_rtd: # only import and set the theme if we're building docs locally
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
def setup(app):
app.add_stylesheet("theme_overrides.css")
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
@@ -187,7 +193,7 @@ htmlhelp_basename = 'OctoPrintdoc'
# -- Options for LaTeX output --------------------------------------------------
latex_elements = {
#latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
@@ -196,14 +202,14 @@ latex_elements = {
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
#}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'OctoPrint.tex', u'OctoPrint Documentation',
u'Gina Häußge', 'manual'),
]
#latex_documents = [
# ('index', 'OctoPrint.tex', u'OctoPrint Documentation',
# u'Gina Häußge', 'manual'),
#]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
+997
View File
@@ -0,0 +1,997 @@
.. _sec-configuration-config_yaml:
config.yaml
===========
If not specified via the command line, the main configuration file ``config.yaml`` for OctoPrint is expected in its
settings folder, which unless defined differently via the command line is located at ``~/.octoprint`` on Linux, at
``%APPDATA%/OctoPrint`` on Windows and at ``~/Library/Application Support/OctoPrint`` on MacOS. If the file is not there,
you can just create it - it will only get created by OctoPrint once you save settings that deviate from the default
settings.
Note that many of these settings are available from the "Settings" menu in OctoPrint itself.
.. contents::
.. _sec-configuration-config_yaml-accesscontrol:
Access Control
--------------
Use the following settings to enable access control:
.. code-block:: yaml
accessControl:
# whether to enable access control or not. Defaults to true
enabled: true
# The user manager implementation to use for accessing user information. Currently only a filebased
# user manager is implemented which stores configured accounts in a YAML file (Default: users.yaml
# in the default configuration folder, see below)
userManager: octoprint.users.FilebasedUserManager
# The YAML user file to use. If left out defaults to users.yaml in the default configuration folder.
userFile: /path/to/users.yaml
# If set to true, will automatically log on clients originating from any of the networks defined in
# "localNetworks" as the user defined in "autologinAs". Defaults to false.
autologinLocal: true
# The name of the user to automatically log on clients originating from "localNetworks" as. Must
# be the name of one of your configured users.
autologinAs: someUser
# A list of networks or IPs for which an automatic logon as the user defined in "autologinAs" will
# take place. If available OctoPrint will evaluate the "X-Forwarded-For" HTTP header for determining
# the client's IP address (see https://code.google.com/p/haproxy-docs/wiki/forwardfor on how to
# configure the sending of this header in HAProxy). Defaults to 127.0.0.0/8 (so basically anything
# originating from localhost).
localNetworks:
- 127.0.0.0/8
- 192.168.1.0/24
.. _sec-configuration-config_yaml-api:
API
---
Settings for the REST API:
.. code-block:: yaml
api:
# Whether to enable the API
enabled: True
# Current API key needed for accessing the API
key: ...
# Whether to allow cross origin access to the API or not
allowCrossOrigin: false
# Additional app api keys, see REST API > Apps in the docs
apps:
"some.app.identifier:some_version":
pubkey: <RSA pubkey>
enabled: true
.. _sec-configuration-config_yaml-appearance:
Appearance
----------
Use the following settings to tweak OctoPrint's appearance a bit to better distinguish multiple instances/printers
appearance or to modify the order and presence of the various UI components:
.. code-block:: yaml
appearance:
# Use this to give your printer a name. It will be displayed in the title bar
# (as "<Name> [OctoPrint]") and in the navigation bar (as "OctoPrint: <Name>")
name: My Printer
# Use this to color the navigation bar. Supported colors are red, orange,
# yellow, green, blue, violet and default.
color: default
# Makes the color of the navigation bar "transparent". In case your printer uses
# acrylic for its frame ;)
colorTransparent: false
# Configures the order and availability of the UI components
components:
# Defines the order of the components within their respective containers.
#
# If overridden by the user the resulting order for display will be calculated as
# follows:
#
# - first all components as defined by the user
# - then all enabled core components as define in the default order (see below)
#
# Components not contained within the default order (e.g. from plugins) will be either
# prepended or appended to that result, depending on component type.
#
# Note that a component is not included in the order as defined by the user will still
# be put into the container, according to the default order. To fully disable a
# component, you'll need to add it to the container's disabled list further below.
order:
# order of navbar items
navbar:
- settings
- systemmenu
- login
# order of sidebar items
sidebar:
- connection
- state
- files
# order of tab items
tab:
- temperature
- control
- gcodeviewer
- terminal
- timelapse
# order of settings, if settings plugins are registered gets extended internally by
# section_plugins and all settings plugins
settings
- section_printer
- serial
- printerprofiles
- temperatures
- terminalfilters
- gcodescripts
- section_features
- features
- webcam
- accesscontrol
- api
- section_octoprint
- folders
- appearance
- logs
# order of user settings
usersettings:
- access
- interface
# order of generic templates
generic: []
# Disabled components per container. If a component is included here it will not
# be included in OctoPrint's UI at all. Note that this might mean that critical
# functionality will not be available if no replacement is registered.
disabled:
navbar: [],
sidebar: [],
tab: [],
settings: [],
usersettings: [],
generic: []
# Default language of OctoPrint. If left unset OctoPrint will try to match up available
# languages with the user's browser settings.
defaultLanguage: null
.. note::
By modifying the ``components`` > ``order`` lists you may reorder OctoPrint's UI components as you like. You can also
inject Plugins at another than their default location in their respective container by adding the entry
``plugin_<plugin identifier>`` where you want them to appear.
Example: If you want the tab of the :ref:`Hello World Plugin <sec-plugins-gettingstarted>` to appear as the first tab
in OctoPrint, you'd need to redefine ``components`` > ``order`` > ``tab`` by including something like this in your
``config.yaml``:
.. code-block:: yaml
appearance:
components:
order:
tab:
- plugin_helloworld
OctoPrint will then turn this into the order ``plugin_helloworld``, ``temperature``, ``control``, ``gcodeviewer``,
``terminal``, ``timelapse`` plus any other plugins.
.. _sec-configuration-config_yaml-controls:
Controls
--------
Use the ``controls`` section to add :ref:`custom controls <sec-features-custom_controls>` to the "Controls" tab within
OctoPrint.
.. code-block:: yaml
controls:
- name: Fan
layout: horizontal
children:
- name: Enable Fan
type: parametric_command
command: M106 S%(speed)s
input:
- name: Speed (0-255)
parameter: speed
default: 255
- name: Disable Fan
type: command
command: M107
.. _sec-configuration-config_yaml-devel:
Development settings
--------------------
The following settings are only relevant to you if you want to do OctoPrint development:
.. code-block:: yaml
# Settings only relevant for development
devel:
# Settings for OctoPrint's internal caching
cache:
# Whether to enable caching. Defaults to true. Setting it to false will cause the UI to always
# be fully rerendered on request to / on the server.
enabled: true
# Whether to enable the preemptive cache
preemptive: true
# Settings for stylesheet preference. OctoPrint will prefer to use the stylesheet type
# specified here. Usually (on a production install) that will be the compiled css (default).
# Developers may specify less here too.
stylesheet: css
# Settings for OctoPrint's web asset merging and minifying
webassets:
# If set to true, OctoPrint will merge all JS, all CSS and all Less files into one file per type
# to reduce request count. Setting it to false will load all assets individually. Note: if this is set to
# false, no minification will take place regardless of the minify setting below.
bundle: true
# If set to true, OctoPrint will minify its viewmodels (that includes those of plugins). Note: if bundle is
# set to false, no minification will take place either.
minify: true
# Whether to delete generated web assets on server startup (forcing a regeneration)
clean_on_startup: true
# Settings for the virtual printer
virtualPrinter:
# Whether to enable the virtual printer and include it in the list of available serial connections.
# Defaults to false.
enabled: true
# Whether to send an additional "ok" after a resend request (like Repetier)
okAfterResend: false
# Whether to force checksums and line number in the communication (like Repetier), if set to true
# printer will only accept commands that come with linenumber and checksum and throw an error for
# lines that don't. Defaults to false
forceChecksum: false
# Whether to send "ok" responses with the line number that gets acknowledged by the "ok". Defaults
# to false.
okWithLinenumber: false
# Number of extruders to simulate on the virtual printer.
numExtruders: 1
# Whether to include the current tool temperature in the M105 output as separate T segment or not.
#
# True: > M105
# < ok T:23.5/0.0 T0:34.3/0.0 T1:23.5/0.0 B:43.2/0.0
# False: > M105
# < ok T0:34.3/0.0 T1:23.5/0.0 B:43.2/0.0
includeCurrentToolInTemps: true
# Whether to include the selected filename in the M23 File opened response.
#
# True: > M23 filename.gcode
# < File opened: filename.gcode Size: 27
# False: > M23 filename.gcode
# > File opened
includeFilenameInOpened: true
# The maximum movement speeds of the simulated printer's axes, in mm/s
movementSpeed:
x: 6000
y: 6000
z: 200
e: 300
# Whether the simulated printer should also simulate a heated bed or not
hasBed: true
# If enabled, reports the set target temperatures as separate messages from the firmware
#
# True: > M109 S220.0
# < TargetExtr0:220.0
# < ok
# > M105
# < ok T0:34.3 T1:23.5 B:43.2
# False: > M109 S220.0
# < ok
# > M105
# < ok T0:34.3/220.0 T1:23.5/0.0 B:43.2/0.0
repetierStyleTargetTemperature: false
# If enabled, uses repetier style resends, sending multiple resends for the same line
# to make sure nothing gets lost on the line
repetierStyleResends: false
# If enabled, reports the first extruder in M105 responses as T instead of T0
#
# True: > M105
# < ok T:34.3/0.0 T1:23.5/0.0 B:43.2/0.0
# False: > M105
# < ok T0:34.3/0.0 T1:23.5/0.0 B:43.2/0.0
smoothieTemperatureReporting: false
# Whether M20 responses will include filesize or not
#
# True: <filename> <filesize in bytes>
# False: <filename>
extendedSdFileList: false
# Forced pause for retrieving from the outgoing buffer
throttle: 0.01
# Whether to send "wait" responses every "waitInterval" seconds when serial rx buffer is empty
sendWait: false
# Interval in which to send "wait" lines when rx buffer is empty
waitInterval: 1
# Size of the simulated RX buffer in bytes, when it's full a send from OctoPrint's
# side will block
rxBuffer: 64
# Size of simulated command buffer
commandBuffer: 4
# Whether to support the M112 command with simulated kill
supportM112: true
# Whether to send messages received via M117 back as "echo:" lines
echoOnM117: true
# Whether to simulate broken M29 behaviour (missing ok after response)
brokenM29: true
.. _sec-configuration-config_yaml-estimation:
Estimation
----------
The following settings provide parameters for estimators within OctoPrint. Currently only
the estimation of the left print time during an active job utilizes this section.
.. code-block:: yaml
estimation:
# Parameters for the print time estmation during an ongoing print job
printTime:
# Until which percentage to do a weighted mixture of statistical duration (analysis or
# past prints) with the result from the calculated estimate if that's already available.
# Utilized to compensate for the fact that the earlier in a print job, the least accuracy
# even a stable calculated estimate provides.
statsWeighingUntil: 0.5
# Range the assumed percentage (based on current estimated statistical, calculated or mixed
# total vs elapsed print time so far) needs to be around the actual percentage for the
# result to be used
validityRange: 0.15
# If no estimate could be calculated until this percentage and no statistical data is available,
# use dumb linear estimate
forceDumbFromPercent: 0.3
# If no estimate could be calculated until this many minutes into the print and no statistical
# data is available, use dumb linear estimate
forceDumbAfterMin: 30
# Average fluctuation between individual calculated estimates to consider in stable range. Seconds
# of difference.
stableThreshold: 60
.. _sec-configuration-config_yaml-events:
Events
------
Use the following settings to add shell/gcode commands to be executed on certain :ref:`events <sec-events>`:
.. code-block:: yaml
events:
subscriptions:
# example event consumer that prints a message to the system log if the printer is disconnected
- event: Disconnected
command: "logger 'Printer got disconnected'"
type: system
# example event consumer that queries printer information from the firmware, prints a "Connected"
# message to the LCD and homes the print head upon established printer connection, disabled though
- event: Connected
command: M115,M117 printer connected!,G28
type: gcode
enabled: False
.. note::
For debugging purposes, you can also add an additional property ``debug`` to your event subscription definitions
that if set to true will make the event handler print a log line with your subscription's command after performing
all placeholder replacements. Example:
.. code-block:: yaml
events:
subscriptions:
- event: Startup
command: "logger 'OctoPrint started up'"
type: system
debug: true
This will be logged in OctoPrint's logfile as
.. code-block:: none
Executing System Command: logger 'OctoPrint started up'
.. _sec-configuration-config_yaml-feature:
Feature
-------
Use the following settings to enable or disable OctoPrint features:
.. code-block:: yaml
feature:
# Whether to enable the gcode viewer in the UI or not
gCodeVisualizer: true
# Whether to enable the temperature graph in the UI or not
temperatureGraph: true
# Specifies whether OctoPrint should wait for the start response from the printer before trying to send commands
# during connect.
waitForStartOnConnect: false
# Specifies whether OctoPrint should send linenumber + checksum with every printer command. Needed for
# successful communication with Repetier firmware
alwaysSendChecksum: false
# Specifies whether OctoPrint should also send linenumber + checksum with commands that are *not*
# detected as valid GCODE (as in, they do not match the regular expression "^\s*([GM]\d+|T)").
sendChecksumWithUnknownCommands: false
# Specifies whether OctoPrint should also use up acknowledgments ("ok") for commands that are *not*
# detected as valid GCODE (as in, they do not match the regular expression "^\s*([GM]\d+|T)").
unknownCommandsNeedAck: false
# Whether to ignore the first ok after a resend response. Needed for successful communication with
# Repetier firmware
swallowOkAfterResend: false
# Specifies whether support for SD printing and file management should be enabled
sdSupport: true
# Specifies whether firmware expects relative paths for selecting SD files
sdRelativePath: false
# Whether to always assume that an SD card is present in the printer.
# Needed by some firmwares which don't report the SD card status properly.
sdAlwaysAvailable: false
# Whether the printer sends repetier style target temperatures in the format
# TargetExtr0:<temperature>
# instead of attaching that information to the regular M105 responses
repetierTargetTemp: false
# Whether to enable external heatup detection (to detect heatup triggered e.g. through the printer's LCD panel or
# while printing from SD) or not. Causes issues with Repetier's "first ok then response" approach to
# communication, so disable for printers running Repetier firmware.
externalHeatupDetection: true
# Whether to enable the keyboard control feature in the control tab
keyboardControl: true
# Whether to actively poll the watched folder (true) or to rely on the OS's file system
# notifications instead (false)
pollWatched: false
# Whether to ignore identical resends from the printer (true, repetier) or not (false)
ignoreIdenticalResends: false
# If ignoredIdenticalResends is true, how many consecutive identical resends to ignore
identicalResendsCount: 7
.. _sec-configuration-config_yaml-folder:
Folder
------
Use the following settings to set custom paths for folders used by OctoPrint:
.. code-block:: yaml
folder:
# Absolute path where to store gcode uploads. Defaults to the uploads folder in the OctoPrint settings folder
uploads: /path/to/upload/folder
# Absolute path where to store finished timelapse recordings. Defaults to the timelapse folder in the OctoPrint
# settings dir
timelapse: /path/to/timelapse/folder
# Absolute path where to store temporary timelapse files. Defaults to the timelapse/tmp folder in the OctoPrint
# settings dir
timelapse_tmp: /path/to/timelapse/tmp/folder
# Absolute path where to store log files. Defaults to the logs folder in the OctoPrint settings dir
logs: /path/to/logs/folder
# Absolute path to the virtual printer's simulated SD card. Only useful for development, just ignore
# it otherwise
virtualSd: /path/to/virtualSd/folder
# Absolute path to a folder being watched for new files which then get automatically
# added to OctoPrint (and deleted from that folder). Can e.g. be used to define a folder which
# can then be mounted from remote machines and used as local folder for quickly adding downloaded
# and/or sliced objects to print in the future.
watched: /path/to/watched/folder
# Absolute path to a folder where manually installed plugins may reside
plugins: /path/to/plugins/folder
# Absolute path where to store slicing profiles
slicingProfiles: /path/to/slicingProfiles/folder
# Absolute path where to store printer profiles
printerProfiles: /path/to/printerProfiles/folder
# Absolute path where to store (GCODE) scripts
scripts: /path/to/scripts/folder
.. _sec-configuration-config_yaml-plugins:
Plugin settings
---------------
The ``plugins`` section is where plugins can store their specific settings. It is also where the installed but disabled
plugins are tracked:
.. code-block:: yaml
# Settings for plugins
plugins:
# Identifiers of installed but disabled plugins
_disabled:
- ...
# The rest are individual plugin settings, each tracked by their identifier, e.g.:
some_plugin:
some_setting: true
some_other_setting: false
.. _sec-configuration-config_yaml-printerprofiles:
Printer Profiles
----------------
Defaults settings for printer profiles.
.. code-block:: yaml
# Settings for printer profiles
printerProfiles:
# Name of the printer profile to default to
default: _default
# Default printer profile
defaultProfile:
...
.. _sec-configuration-config_yaml-scripts:
Scripts
-------
Default scripts and snippets. You'd usually not edit the ``config.yaml`` file to adjust those but instead create the
corresponding files in ``~/.octoprint/scripts/``. See :ref:`GCODE Script <sec-features-gcode_scripts>`.
.. code-block:: yaml
# Configured scripts
scripts:
# GCODE scripts and snippets
gcode:
# Script called after OctoPrint connected to the printer.
afterPrinterConnected:
# Script called before a print was started.
beforePrintStarted:
# Script called after a print was cancelled.
afterPrintCancelled: "; disable motors\nM84\n\n;disable all heaters\n{% snippet 'disable_hotends' %}\nM140 S0\n\n;disable fan\nM106 S0"
# Script called after a print was successfully completed.
afterPrintDone:
# Script called after a print was paused.
afterPrintPaused:
# Script called before a print was resumed.
beforePrintResumed:
# Snippets that may be used in scripts
snippets:
disable_hotends: "{% for tool in range(printer_profile.extruder.count) %}M104 T{{ tool }} S0\n{% endfor %}"
.. _sec-configuration-config_yaml-serial:
Serial
------
Use the following settings to configure the serial connection to the printer:
.. code-block:: yaml
serial:
# Use the following option to define the default serial port, defaults to unset (= AUTO)
port: /dev/ttyACM0
# Use the following option to define the default baudrate, defaults to unset (= AUTO)
baudrate: 115200
# Whether to automatically connect to the printer on server startup (if available)
autoconnect: false
# Whether to log whole communication to serial.log (warning: might decrease performance)
log: false
# Timeouts used for the serial connection to the printer, you might want to adjust these if you are
# experiencing connection problems
timeout:
# Timeout for waiting for a response from the currently tested port during autodetect, in seconds.
# Defaults to 0.5 sec
detection: 0.5
# Timeout for waiting to establish a connection with the selected port, in seconds.
# Defaults to 2 sec
connection: 2
# Timeout during serial communication, in seconds.
# Defaults to 5 sec
communication: 5
# Use this to define additional patterns to consider for serial port listing. Must be a valid
# "glob" pattern (see http://docs.python.org/2/library/glob.html). Defaults to not set.
additionalPorts:
- /dev/myPrinterSymlink
# Commands which are known to take a long time to be acknowledged by the firmware. E.g.
# homing, dwelling, auto leveling etc. Defaults to the below commands.
longRunningCommands:
- G4
- G28
- G29
- G30
- G32
- M400
- M226
# Commands which need to always be send with a checksum. Defaults to only M110
checksumRequiringCommands:
- M110
# Command to send in order to initiate a handshake with the printer.
# Defaults to "M110 N0" which simply resets the line numbers in the firmware and which
# should be acknowledged with a simple "ok".
helloCommand: M110 N0
# Whether to disconnect on errors or not
disconnectOnErrors: true
# Whether to completely ignore errors from the firmware or not
ignoreErrorsFromFirmware: false
# Whether to log resends to octoprint.log or not. Invaluable debug tool without performance
# impact, leave on if possible please
logResends: true
# Whether to support resends without follow-up ok or not
supportResendsWithoutOk: false
# Whether to "manually" trigger an ok for M29 (a lot of versions of this command are buggy and
# the responds skips on the ok)
triggerOkForM29: true
.. _sec-configuration-config_yaml-server:
Server
------
Use the following settings to configure the server:
.. code-block:: yaml
server:
# Use this option to define the host to which to bind the server, defaults to "0.0.0.0" (= all
# interfaces)
host: 0.0.0.0
# Use this option to define the port to which to bind the server, defaults to 5000
port: 5000
# If this option is true, OctoPrint will show the First Run dialog and set it to false after that
# completes
firstRun: false
# Secret key for encrypting cookies and such, randomly generated on first run
secretKey: someSecretKey
# Settings if OctoPrint is running behind a reverse proxy (haproxy, nginx, apache, ...).
# These are necessary in order to make OctoPrint generate correct external URLs so
# that AJAX requests and download URLs work.
reverseProxy:
# The request header from which to determine the url prefix under which OctoPrint
# is served by the reverse proxy
prefixHeader: X-Script-Name
# The request header from which to determine the scheme (http or https) under which
# a specific request to OctoPrint was made to the reverse proxy
schemeHeader: X-Scheme
# The request header from which to determine the host under which OctoPrint
# is served by the reverse proxy
hostHeader: X-Forwarded-Host
# Use this option to define an optional url prefix (with a leading /, so absolute to your
# server's root) under which to run OctoPrint. This should only be needed if you want to run
# OctoPrint behind a reverse proxy under a different root endpoint than `/` and can't configure
# said reverse proxy to send a prefix HTTP header (X-Script-Name by default, see above) with
# forwarded requests.
prefixFallback:
# Use this option to define an optional forced scheme (http or https) under which to run
# OctoPrint. This should only be needed if you want to run OctoPrint behind a reverse
# proxy that also does HTTPS determination but can't configure said reverse proxy to
# send a scheme HTTP header (X-Scheme by default, see above) with forwarded requests.
schemeFallback:
# Use this option to define an optional forced host under which to run OctoPrint. This should
# only be needed if you want to run OctoPrint behind a reverse proxy with a different hostname
# than OctoPrint itself but can't configure said reverse proxy to send a host HTTP header
# (X-Forwarded-Host by default, see above) with forwarded requests.
hostFallback:
# Settings for file uploads to OctoPrint, such as maximum allowed file size and
# header suffixes to use for streaming uploads. OctoPrint does some nifty things internally in
# order to allow streaming of large file uploads to the application rather than just storing
# them in memory. For that it needs to do some rewriting of the incoming upload HTTP requests,
# storing the uploaded file to a temporary location on disk and then sending an internal request
# to the application containing the original filename and the location of the temporary file.
uploads:
# Maximum size of uploaded files in bytes, defaults to 1GB.
maxSize: 1073741824
# Suffix used for storing the filename in the file upload headers when streaming uploads.
nameSuffix: name
# Suffix used for storing the path to the temporary file in the file upload headers when
# streaming uploads.
pathSuffix: path
# Maximum size of requests other than file uploads in bytes, defaults to 100KB.
maxSize: 102400
# Commands to restart/shutdown octoprint or the system it's running on
commands:
# Command to restart OctoPrint, defaults to being unset
serverRestartCommand: sudo service octoprint restart
# Command to restart the system OctoPrint is running on, defaults to being unset
systemRestartCommand: sudo shutdown -r now
# Command to shut down the system OctoPrint is running on, defaults to being unset
systemShutdownCommand: sudo shutdown -h now
# Settings of when to display what disk space warning
diskspace:
# Threshold (bytes) after which to consider disk space becoming sparse,
# defaults to 500MB
warning: 63488000
# Threshold (bytes) after which to consider disk space becoming critical,
# defaults to 200MB
critical: 209715200
# Configuration of the preemptive cache
preemptiveCache:
# which server paths to exclude from the preemptive cache
exceptions:
- /some/path
# How many days to leave unused entries in the preemptive cache config
until: 7
.. note::
If you want to run OctoPrint behind a reverse proxy such as HAProxy or Nginx and use a different base URL than the
server root ``/`` you have two options to achieve this. One approach is using the configuration settings ``baseUrl`` and
``scheme`` mentioned above in which OctoPrint will only work under the configured base URL.
The second and better approach is to make your proxy send a couple of custom headers with each forwarded requests:
* ``X-Script-Name``: should contain your custom baseUrl (absolute server path), e.g. ``/octoprint``
* ``X-Scheme``: should contain your custom URL scheme to use (if different from ``http``), e.g. ``https``
If you use these headers OctoPrint will work both via the reverse proxy as well as when called directly. Take a look
`into OctoPrint's wiki <https://github.com/foosel/OctoPrint/wiki/Reverse-proxy-configuration-examples>`_ for a couple
of examples on how to configure this.
.. _sec-configuration-config_yaml-slicing:
Slicing
-------
Settings for the built-in slicing support:
.. code-block:: yaml
# Slicing settings
slicing:
# Whether to enable slicing support or not
enabled:
# Default slicer to use
defaultSlicer: cura
# Default slicing profiles per slicer
defaultProfiles:
cura: ...
.. _sec-configuration-config_yaml-system:
System
------
Use the following settings to add custom system commands to the "System" dropdown within OctoPrint's top bar.
Commands consist of a name, an action identifier, the commandline to execute and an optional confirmation message to
display before actually executing the command (should be set to False if a confirmation dialog is not desired).
The following example defines a command for shutting down the system under Linux. It assumes that the user under which
OctoPrint is running is allowed to do this without password entry:
.. code-block:: yaml
system:
actions:
- name: Shutdown
action: shutdown
command: sudo shutdown -h now
confirm: You are about to shutdown the system.
You can also add an divider by setting action to divider like this:
.. code-block:: yaml
system:
actions:
- action: divider
.. _sec-configuration-config_yaml-temperature:
Temperature
-----------
Use the following settings to configure temperature profiles which will be displayed in the temperature tab:
.. code-block:: yaml
temperature:
profiles:
- name: ABS
extruder: 210
bed: 100
- name: PLA
extruder: 180
bed: 60
.. _sec-configuration-config_yaml-terminalfilters:
Terminal Filters
----------------
Use the following settings to define a set of terminal filters to display in the terminal tab for filtering certain
lines from the display terminal log.
Use `Javascript regular expressions <https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions>`_:
.. code-block:: yaml
# A list of filters to display in the terminal tab. Defaults to the filters shown below
terminalFilters:
- name: Suppress M105 requests/responses
regex: '(Send: M105)|(Recv: ok T:)'
- name: Suppress M27 requests/responses
regex: '(Send: M27)|(Recv: SD printing byte)'
.. _sec-configuration-config_yaml-webcam:
Webcam
------
Use the following settings to configure webcam support:
.. code-block:: yaml
webcam:
# Use this option to enable display of a webcam stream in the UI, e.g. via MJPG-Streamer.
# Webcam support will be disabled if not set
stream: http://<stream host>:<stream port>/?action=stream
# Use this option to enable timelapse support via snapshot, e.g. via MJPG-Streamer.
# Timelapse support will be disabled if not set
snapshot: http://<stream host>:<stream port>/?action=snapshot
# Path to ffmpeg binary to use for creating timelapse recordings.
# Timelapse support will be disabled if not set
ffmpeg: /path/to/ffmpeg
# Number of how many threads to instruct ffmpeg to use for encoding. Defaults to 1.
# Should be left at 1 for RPi1.
ffmpegThreads: 1
# The bitrate to use for rendering the timelapse video. This gets directly passed to ffmpeg.
bitrate: 5000k
# Whether to include a "created with OctoPrint" watermark in the generated timelapse movies
watermark: true
# The default timelapse settings.
timelapse:
# The timelapse type. Can be either "off", "zchange" or "timed". Defaults to "off"
type: timed
# Additional options depending on the timelapse type. All timelapses take a postRoll and an fps setting.
options:
# The number of seconds in the rendered video to add after a finished print. The exact way how the
# additional images will be recorded depends on timelapse type. Timed timelapses continue to
# record just like at the beginning, so the recording will continue another
# fps * postRoll * interval seconds. Zchange timelapses will take one final picture and add it fps * postRoll
postRoll: 0
# The framerate at which to render the movie
fps: 25
# Timed timelapses only: The interval which to leave between images in seconds
interval: 2
+12
View File
@@ -0,0 +1,12 @@
.. _sec-configuration:
#############
Configuration
#############
.. toctree::
:maxdepth: 2
yaml.rst
config_yaml.rst
logging_yaml.rst
+100
View File
@@ -0,0 +1,100 @@
.. _sec-configuration-logging_yaml:
logging.yaml
============
The logging configuration file ``logging.yaml`` for OctoPrint is expected in its settings folder, which unless defined
differently on the command line is located at ``~/.octoprint`` on Linux, at ``%APPDATA%/OctoPrint`` on Windows and at
``~/Library/Application Support/OctoPrint`` on MacOS.
You can use it to change the log levels of the individual components within OctoPrint, which might be necessary to help
in debugging issues you are experiencing, or to change the configuration of the logging handlers themselves, e.g. in
order to change size after which to rollover the ``serial.log``.
Changing log levels
-------------------
If you need to change the default logging level within OctoPrint, create the file with a text editor of your choice
(it's usually not there). The general format is this::
loggers:
<component>:
level: <loglevel>
with ``<component>`` being the internal OctoPrint component for which to change the loglevel, and ``<loglevel>`` being the
new log level to set. An example for increasing the log level of the events and the file management components to
``DEBUG`` (the highest amount of logging) would be this ``logging.yaml``:
.. code-block:: yaml
loggers:
octoprint.events:
level: DEBUG
octoprint.filemanager:
level: DEBUG
A list of important components for which an increase in logging might be interesting follows:
* ``octoprint.events``: the event sub system
* ``octoprint.filemanager``: the file management layer
* ``octoprint.plugin``: the plugin sub system
* ``octoprint.plugins.<plugin>``: the plugin ``<plugin>``, e.g. ``octoprint.plugins.discovery`` to change the log level of
the `Discovery plugin <https://github.com/foosel/OctoPrint/wiki/Plugin:-Discovery>`_ or ``octoprint.plugins.cura``
to change the log level of the `Cura plugin <https://github.com/foosel/OctoPrint/wiki/Plugin:-Cura>`_.
* ``octoprint.slicing``: the slicing sub system
This list will be expanded when deemed necessary.
Changing logging handlers
-------------------------
You can also change the configuration of the logging handlers themselves, e.g. in order to make the ``serial.log`` larger
for debugging long running communications or to change the behaviour of the ``octoprint.log``.
You can find the default configurations of the ``file`` handler used for the ``octoprint.log``, the ``serialFile`` handler
used for the ``serial.log`` and the ``console`` handler used for the output to stdout in YAML format below:
.. code-block:: yaml
handlers:
# stdout
console:
class: logging.StreamHandler
level: DEBUG
formatter: simple
stream: ext://sys.stdout
# octoprint.log
file:
class: logging.handlers.TimedRotatingFileHandler
level: DEBUG
formatter: simple
when: D
backupCount: 1
filename: /path/to/octoprints/logs/octoprint.log
# serial.log
serialFile:
class: logging.handlers.RotatingFileHandler
level: DEBUG
formatter: simple
maxBytes: 2097152 # 2 * 1024 * 1024 = 2 MB in bytes
filename: /path/to/octoprints/logs/serial.log
You can find more information on the used logging handlers in the
`Python documentation on logging handlers <https://docs.python.org/2/library/logging.handlers.html>`_.
Changing logging formatters
---------------------------
The logging formatters can be defined via ``logging.yaml`` as well. The ``simple`` formatter as referenced above is
expressed in YAML as follows:
.. code-block:: yaml
formatters:
simple:
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
The possible keys for the logging format can be found in the
`Python documentation on LogRecord attributes <https://docs.python.org/2/library/logging.html#logrecord-attributes>`_.
+224
View File
@@ -0,0 +1,224 @@
.. _sec-configuration-yaml:
A YAML Primer
=============
Most of OctoPrint's configuration is done under the hood through `YAML <https://en.wikipedia.org/wiki/YAML>`_ files,
which is why it makes sense to shed some light on the basics of this data serialization format.
YAML is a text based format which excels at representing the most common of data structures in an easy and very human
readable way, which is why it was chosen for OctoPrint's configuration files. A text editor is all you need in order
to write YAML configuration files.
.. _sec-configuration-yaml-basic:
Basic Rules
-----------
First of all some basic things to know about working with YAML files:
* Never use tabs outside of quoted strings, especially not for indentation. The tab character is illegal within
YAML files.
* Whitespace and indentation matters and plays an important part in structuring the data, so take special care
to stay consistent here.
* YAML's comments start with a ``#`` and go until the end of the line.
.. _sec-configuration-yaml-types:
Interesting data types
----------------------
You will probably only come across the three most basic types of data within OctoPrint's YAML files: scalars
(such as strings, integers, ...), lists and associated arrays (aka key-value-pairs, aka maps, aka dictionaries).
.. _sec-configuration-yaml-types-scalar:
Scalars
.......
Scalars are the most basic of all data types and are simple string, integer, float or boolean values.
For most scalars you don't need any quotes at all, but if you need to define some piece of data which contains characters
that could be mistaken with YAML syntax you need to quote it in either double ``"`` or single ``'`` quotes for the
YAML file to stay valid. As simple rule of thumb, if your data contains any of these characters ``:-{}[]!#|>&%@`` better
quote it. Also quote it if you want a string but it could be mistaken for a valid number (integer or float) or if
it consists only of "Yes", "No", "yes", "no", "true" or "false", which would be converted to a boolean without quotes.
In double quoted strings if you need to include a literal double quote in your string you can escape it by prefixing
it with a backslash ``\`` (which you can in turn escape by itself). In single quoted strings the single quote character
can be escaped by prefixing it with another single quote, basically doubling it. Backslashes in single quoted strings
do not need to be escaped.
Quoted strings can also span across multiple lines, just indent the following lines. Note that you'll need to add a
completely empty line in order for force a line break, the data will not be actually wrapped across multiple lines
just because you spread its representation across multiple lines.
.. _sec-configuration-yaml-types-scalar-int:
int
'''
.. code-block:: yaml
23
42
.. _sec-configuration-yaml-types-scalar-float:
float
'''''
.. code-block:: yaml
23.5
100.0
.. _sec-configuration-yaml-types-scalar-boolean:
boolean
'''''''
.. code-block:: yaml
true
false
Yes
No
yes
no
.. _sec-configuration-yaml-types-scalar-string:
string
''''''
.. code-block:: yaml
a string
"some quoted string with a : colon and a { bracket and a quote \" and a backslash \\ - phew"
'some single quoted string with a single quote '' and a backslash \ - yay'
"and a multiline string - just because we can we'll make it span
across not two but four YAML lines!
Including this paragraph. But in fact it will only be two lines :)"
"23"
"42.3"
"Yes"
"No"
"true"
"false"
yes and no
true or false
.. _sec-configuration-yaml-types-lists:
Lists
.....
Lists allow to "collect" a number of similar things into one data structure. They are created by prefixing one or more
consecutive lines with a ``-``:
.. code-block:: yaml
- item 1
- 23.42
- 57
- true
Take special care to have all of your list items at the same indentation level!
.. _sec-configuration-yaml-types-dicts:
Dictionaries
............
Dictionaries (aka associative arrays aka maps) allow organizing the data in key value pairs, with the key and the value
being separated through a colon ``:``:
.. sourcecode:: yaml
key: value
anotherkey: another value
.. _sec-configuration-yaml-examples:
Examples
--------
Based on the three types explained above, quite complex data structures are possible (whitespace made visible to
help track indentation):
.. code-block-ext:: yaml
:whitespace:
general:
some_setting: some_value
a_list:
- item 1
- 23.42
- 57
- true
some_flag: true
quoted_string: "This string is quoted because {we have this here} and also > this and : that"
specific:
setting1: value1
setting2:
subsetting21: value11
subsetting22:
- subsubsetting221
- subsubsetting222
- subsubsetting223
the_end: yes
In this example we have a dictionary on the top most "layer" which has three keys, ``general``, ``specific`` and
``the_end``.
``general`` in turn is a dictionary with the keys ``some_setting`` (a string), ``a_list`` (a list with four items,
a string, a float, an int and a boolean), ``some_flag`` (a boolean) and ``quoted_string`` (a -- you guessed it -- string).
``specific`` is also a dictionary, with keys ``setting1`` (a string) and ``setting2``, a dictionary with two keys, one
a string and the other again a list.
Finally, ``the_end`` is just a boolean, since an unquoted ``yes`` evaluates as a boolean value as we saw in the
:ref:`section about boolean scalars above <sec-configuration-yaml-types-scalar-boolean>`.
Don't get confused by the list "dividing" one part of the dictionary under ``general`` from the other -- your mind is
just playing a trick on you due to the list's dashes ``-`` being on the same levels as the dictionary keys. You could
also just add two more spaces to your identation and write that part like this, which makes the structure a bit
clearer (whitespace again made visible to help track indentation):
.. code-block-ext:: yaml
:whitespace:
general:
some_setting: some_value
a_list:
- item 1
- 23.42
- 57
- true
some_flag: true
# ...
Just make sure you follow a consistent way of indenting your files -- YAML is not as strict as Python when it comes to
differing identation variants within the same file (as long as it's still valid), but consistency will help you as
a lot as a human. Ideally you'll use a text editor which highlights white space characters for you (most editors can
be configured this way), this will help tremendously when editing whitespace sensitive syntax such as YAML.
+10
View File
@@ -0,0 +1,10 @@
.. _sec-development:
###########
Development
###########
.. todo::
This is where notes regarding developing OctoPrint will be placed, such as workflow for setting up the
development environment, code guidelines etc.
+42 -10
View File
@@ -1,16 +1,19 @@
.. _sec-events:
####################
Events Documentation
####################
######
Events
######
.. contents::
With release of OctoPrint 1.1.0, the payload data has been harmonized, it is now a key-value-map for all events.
Additionally, the format of the placeholders in both system command and gcode command triggers has been changed to
accommodate for this new format. Last but not least, the way of specifying event hooks has changed, OctoPrint no longer
separates hooks into two sections (gcodeCommandTrigger and systemCommandTrigger) but instead event hooks are now typed
to indicate what to do with the command contained.
.. note::
With release of OctoPrint 1.1.0, the payload data has been harmonized, it is now a key-value-map for all events.
Additionally, the format of the placeholders in both system command and gcode command triggers has been changed to
accommodate for this new format. Last but not least, the way of specifying event hooks has changed, OctoPrint no longer
separates hooks into two sections (gcodeCommandTrigger and systemCommandTrigger) but instead event hooks are now typed
to indicate what to do with the command contained.
.. _sec-events-configuration:
@@ -56,7 +59,7 @@ Example
Placeholders
============
You can use the following generic placeholders in your events:
You can use the following generic placeholders in your event hooks:
* ``{__currentZ}``: the current Z position of the head if known, -1 if not available
* ``{__filename}``: filename of the currently selected file, "NO FILE" if not available
@@ -96,6 +99,10 @@ ClientOpened
ClientClosed
A client has disconnected from the webserver
Payload:
* ``remoteAddress``: the remote address (IP) of the client that disconnected
Printer communication
---------------------
@@ -161,7 +168,8 @@ FileSelected
Payload:
* ``file``: the file's name
* ``file``: the full path to the file
* ``filename``: the file's name
* ``origin``: the origin of the file, either ``local`` or ``sdcard``
FileDeselected
@@ -357,6 +365,30 @@ SlicingFailed
* ``gcode``: the sliced GCODE's filename
* ``reason``: the reason for the slicing having failed
SlicingProfileAdded
A new slicing profile was added.
Payload:
* ``slicer``: the slicer for which the profile was added
* ``profile``: the profile that was added
SlicingProfileModified
A new slicing profile was modified.
Payload:
* ``slicer``: the slicer for which the profile was modified
* ``profile``: the profile that was modified
SlicingProfileDeleted
A slicing profile was deleted.
Payload:
* ``slicer``: the slicer for which the profile was deleted
* ``profile``: the profile that was deleted
Settings
--------
+69
View File
@@ -0,0 +1,69 @@
.. _sec-features-access_control:
Access Control
==============
When Access Control is enabled, anonymous users (not logged in) will only see
the read-only parts of the UI which are the following:
* printer state
* available gcode files and stats (upload is disabled)
* temperature
* webcam
* gcode viewer
* terminal output (sending commands is disabled)
* available timelapse movies
* any components provided through plugins which are enabled for anonymous
users
Logged in users will get access to everything besides the Settings and System
Commands, which are admin-only.
If Access Control is disabled, everything is directly accessible. **That also
includes all administrative functionality as well as full control over the
printer!**
Upon first start a configuration wizard is provided which allows configuration
of the first administrator account or alternatively disabling Access Control
(which is **NOT** recommended for systems that are directly accessible via the
Internet!).
.. hint::
If you plan to have your OctoPrint instance accessible over the internet,
**always enable Access Control**.
.. _sec-features-access_control-rerunning_wizard:
Rerunning the wizard
--------------------
In case Access Control was disabled in the configuration wizard, it is
possibly to re-run it by editing ``config.yaml`` [#f1]_ and setting ``firstRun``
in the ``server`` section and ``enabled`` in the ``accessControl`` section to
``true``:
.. code-block-ext:: yaml
accessControl:
enabled: true
# ...
server:
firstRun: true
Then restart the server and connect to the web interface - the wizard should
be shown again.
.. note::
If user accounts were created prior to disabling Access Control and those
user accounts are not to be used any more, remove ``.octoprint/users.yaml``.
If you don't remove this file, the above changes won't lead to the
configuration being shown again, instead Access Control will just be
enabled using the already existing login data. This is to prevent you from
resetting access control by accident.
.. rubric:: Footnotes
.. [#f1] For Linux that will be ``~/.octoprint/config.yaml``, for Windows it will be ``%APPDATA%/OctoPrint/config.yaml`` and for
Mac ``~/Library/Application Support/OctoPrint/config.yaml``
+36
View File
@@ -0,0 +1,36 @@
.. _sec-features-action_commands:
Action Commands
===============
Action commands are a feature defined for the GCODE based RepRap communication protocol. To quote from the
`GCODE node of the RepRap wiki <http://reprap.org/wiki/Gcode#Replies_from_the_RepRap_machine_to_the_host_computer>`_:
The RepRap machine may also send lines that look like this:
**// This is some debugging or other information on a line on its own. It may be sent at any time.**
Such lines will always be preceded by //.
On the latest version of Pronterface and [...] OctoPrint a special comment of the form:
**// action:command**
is allowed to be sent from the firmware[. T]he command can currently be pause, resume or disconnect which will
execute those commands on the host. As this is also a comment other hosts will just ignored these commands.
OctoPrint out of the box supports handling of the above mentioned commands:
pause
When this command is received from the printer, OctoPrint will pause streaming of a current print job just like if the
"Pause" button had been clicked.
resume
When this command is received from the printer, OctoPrint will resume streaming of a current print job just like if
the "Resume" button had been clicked.
disconnect
When this command is Received from the printer, OctoPrint will immediately disconnect from it.
Support for additional commands may be added by plugins by implementing a handler for the
:ref:`octoprint.comm.protocol.action <sec-plugins-hook-comm-protocol-action>` hook.
+293
View File
@@ -0,0 +1,293 @@
.. _sec-features-custom_controls:
Custom Controls
===============
.. contents::
OctoPrint allows you to add custom controls to the "Control" tab of its interface. Control types reach from simple
buttons which trigger sending of one or more lines of GCODE to the printer over more complex controls allowing
parameterization of these commands with values entered by the user to full blown GCODE script templates backed by
`Jinja2 <http://jinja.pocoo.org/>`_.
Custom controls are configured within :ref:`config.yaml <sec-configuration-config_yaml>` [#f1]_ in a ``controls`` section which
basically represents a hierarchical structure of all configured custom controls of various types.
.. note::
To make sure that your ``config.yaml`` stays valid when adding custom controls, don't hesitate to take a look at the
:ref:`YAML Primer <sec-configuration-yaml>`.
The following example defines a control for enabling the cooling fan with a variable speed defined by the user
(default 255 and selectable through a slider UI element) and a control for disabling the fan, all within a section named
"Fan", two example controls with multiple commands in a section "Example for multiple commands", a command with printer
feedback evaluation for the result of the M114 "Get Position" gcode inside a section named "Reporting" and finally
a GCODE script including user input.
.. code-block-ext:: yaml
controls:
- name: Fan
layout: horizontal
children:
- name: Enable Fan
command: M106 S%(speed)s
input:
- name: Speed (0-255)
parameter: speed
default: 255
slider:
min: 0
max: 255
- name: Disable Fan
command: M107
- name: Example for multiple commands
children:
- name: Move X (static)
confirm: You are about to move the X axis right by 10mm with 3000mm/s.
commands:
- G91
- G1 X10 F3000
- G90
- name: Move X (parametric)
commands:
- G91
- G1 X%(distance)s F%(speed)s
- G90
input:
- default: 10
name: Distance
parameter: distance
- default: 3000
name: Speed
parameter: speed
- name: Reporting
children:
- name: Get Position
command: M114
regex: "X:([-+]?[0-9.]+) Y:([-+]?[0-9.]+) Z:([-+]?[0-9.]+) E:([-+]?[0-9.]+)"
template: "Position: X={0}, Y={1}, Z={2}, E={3}"
- name: Fun stuff
children:
- name: Dance
script: custom/dance.gco
input:
- name: Go arounds
parameter: repetitions
slider:
max: 10
min: 1
step: 1
Adding this to ``config.yaml``, restarting the OctoPrint server and switching to the "Control" tab within its
interface yields the visual representation in :numref:`fig-configuration-customcontrols-example`.
.. _fig-configuration-customcontrols-example:
.. figure:: ../images/features-custom_controls-example.png
:align: center
:alt: The rendered output created through the example configuration
The rendered output created through the example configuration
As you can see you have two basic types of control definitions here: controls that actually do something (providing a
button that sends one or more commands to the printer when clicked, displaying output received from the printer) and
controls that just serve as *container* for other controls, the latter being identified by having a ``children``
attribute wrapping more controls.
.. hint::
Take a look at the `Custom Control Editor plugin <http://plugins.octoprint.org/plugins/customControl/>`_
which allows you configuring your Custom Controls through OctoPrint's
settings interface without the need to manually edit the configuration
file.
.. _sec-features-custom_controls-types:
Types
-----
Let's take a closer look at the possible attributes that are available for both basic types.
.. _sec-features-custom_controls-types-containers:
Containers
..........
.. list-table::
:widths: 25 75
* - **Attribute**
- **Description**
* - ``children``
- A list of children controls or containers contained within this container
* - ``name``
- (Optional) A name to display above the container, basically a section header
* - ``layout``
- (Optional) The layout to use for laying out the contained children, either from top to bottom (``vertical``) or
from left to right (``horizontal``). Defaults to a ``vertical`` layout.
.. _sec-features-custom_controls-types-controls:
Controls
........
.. list-table::
:widths: 25 75
* - **Attribute**
- **Description**
* - ``name``
- The name of the control, will be displayed either on the button if it's a control sending a command or as a label
for controls which only display output.
* - ``command``
- (Optional) A single GCODE command to send to the printer. Will be rendered as a button which sends the command to
the printer upon click. The button text will be the value of the ``name`` attribute. Mutually exclusive with
``commands`` and ``script``. The rendered button be disabled if the printer is currently offline or printing or
alternatively if the requirements defined via the ``enabled`` attribute are not met.
* - ``commands``
- (Optional) A list of GCODE commands to send to the printer. Will be rendered as a button which sends the commands
to the printer upon click. The button text will be the value of the ``name`` attribute. Mutually exclusive with
``command`` and ``script``. The rendered button will be disabled if the printer is currently offline or printing
or alternatively if the requirements defined via the ``enabled`` attribute are not met.
* - ``script``
- (Optional) The name of a full blown :ref:`GCODE script <sec-features-gcode_scripts>` to send to the printer.
Will be rendered as a button which sends the script to the printer upon click. The button text will be the value
of the ``name`` attribute. Mutually exclusive with ``command`` and ``commands``. The rendered button will be
disabled if the printer is currently offline or printing or alternatively if the requirements defined via the
``enabled`` attribute are not met.
Values of input parameters will be available in the template context under the ``parameter`` variable (e.g.
an input parameter ``speed`` will be available in the script template as ``parameter.speed``). On top of that all
other variables defined in the :ref:`GCODE template context <sec-features-gcode_scripts-context>` will be available.
:ref:`See below for an example <sec-features-custom_controls-examples-gcode_script>`.
* - ``javascript``
- (Optional) A JavaScript snippet to be executed when the button rendered for ``command`` or ``commands`` is
clicked. This allows to override the direct sending of the command or commands to the printer with more
sophisticated behaviour. The JavaScript snippet is ``eval``'d and processed in a context where the control
it is part of is provided as local variable ``data`` and the ``ControlViewModel`` is available as ``self``.
* - ``enabled``
- (Optional) A JavaScript snippet returning either ``true`` or ``false`` determining whether the control
should be enabled or not. This allow to override the default logic for this (disabled if printer is offline
or currently printing). The JavaScript snippet is ``eval``'d and processed in a context where the control
it is part of is provided as local variable ``data`` and the ``ControlViewModel`` is available as ``self``.
* - ``input``
- (Optional) A list of definitions of input parameters for a ``command`` or ``commands``, to be rendered as
additional input fields. ``command``/``commands`` may contain placeholders to be replaced by the values obtained
from the user for the defined input fields:
.. code-block-ext:: yaml
name: Enable Fan
command: M106 S%(speed)s
input:
- name: Speed (0-255)
parameter: speed
default: 255
slider:
min: 0
max: 255
In OctoPrint's default UI input fields are always rendered left to right (inline).
* - ``input.name``
- Name to display for the input field.
* - ``input.parameter``
- Internal parameter name for the input field, used as a placeholder in ``command``/``commands``.
* - ``input.default``
- Default value for the input field.
* - ``input.slider``
- (Optional) If this attribute is included, instead of an input field a slider control will
be rendered. If you don't want to define any of ``min``, ``max`` or ``step``, write ``slider: {}`` to render
a slider based on default values.
* - ``input.slider.min``
- (Optional) Minimum value of the slider, defaults to 0.
* - ``input.slider.max``
- (Optional) Maximum value of the slider, defaults to 255.
* - ``input.slider.step``
- (Optional) Step size per slider "tick", defaults to 1.
* - ``regex``
- (Optional) A `regular expression <https://docs.python.org/2/library/re.html#regular-expression-syntax>`_ to
match against lines received from the printer to retrieve information from it (e.g. specific output). Together
with ``template`` this allows rendition of received data from the printer within the UI.
* - ``template``
- (Optional) A template to use for rendering the match of ``regex``. May contain placeholders in
`Python Format String Syntax <https://docs.python.org/2/library/string.html#format-string-syntax>`_ for either named
groups within the regex (e.g. ``Temperature: {temperature}`` for a regex ``T:\s*(?P<temperature>\d+(\.\d*)``)
or positional groups within the regex (e.g. ``Position: X={0}, Y={1}, Z={2}, E={3}`` for a regex
``X:([0-9.]+) Y:([0-9.]+) Z:([0-9.]+) E:([0-9.]+)``).
* - ``confirm``
- (Optional) A text to display to the user to confirm his button press. Can be used with sensitive custom controls
like changing EEPROM values in order to prevent accidental clicks. The text will be displayed in a confirmation
dialog like in :numref:`fig-configuration-customcontrols-confirm`.
.. _fig-configuration-customcontrols-confirm:
.. figure:: ../images/features-custom_controls-confirm.png
:align: center
:alt: An example confirmation dialog
An example confirmation dialog
.. _sec-features-custom_controls-examples:
Examples
--------
.. _sec-features-custom_controls-examples-gcode_script:
Parameterized GCODE Script
..........................
.. code-block-ext:: yaml
:caption: Control definition in ~/.octoprint/config.yaml
:name: code-features-custom_controls-example-gcode_script-config_yaml
name: Dance
script: custom/dance.gco
input:
- default: 5
name: Go arounds
parameter: repetitions
slider:
max: 10
min: 1
step: 1
.. code-block-ext:: jinja
:caption: ~/.octoprint/scripts/gcode/custom/dance.gco
:name: code-features-custom_controls-example-gcode_script-dance_gco
{% set center_x = printer_profile.volume.width / 2 %}
{% set center_y = printer_profile.volume.depth / 2 %}
{% set speed_x = printer_profile.axes.x.speed %}
{% set speed_y = printer_profile.axes.y.speed %}
{% set speed_z = printer_profile.axes.z.speed %}
M117 run {{ script.name }}
G4 P500
G1 Z10
G1 X{{ center_x }} Y{{ center_y }} F{{ speed_x }}
M117 let's dance!
G91
G1 X-1 Y-1 F{{ speed_x }}
{% for n in range(parameters.repetitions) %}
M117 and {{ n + 1 }}
{% if n % 2 == 0 %}
G1 Z1 F{{ speed_z }}
G1 Z-2 F{{ speed_z }}
G1 Z1 F{{ speed_z }}
{% endif %}
G1 X2 F{{ speed_x }}
G1 Y2 F{{ speed_y }}
G1 X-2 F{{ speed_x }}
G1 Y-2 F{{ speed_y }}
{% endfor %}
G90
G1 X{{ center_x }} Y{{ center_y }} F{{ speed_x }}
G28 X0 Y0
Note the usage of the ``parameters.repetitions`` template variable in the GCODE script template, which will contain
the value selected by the user for the "Go arounds" slider.
.. rubric:: Footnotes
.. [#f1] For Linux that will be ``~/.octoprint/config.yaml``, for Windows it will be ``%APPDATA%/OctoPrint/config.yaml`` and for
Mac ``~/Library/Application Support/OctoPrint/config.yaml``
+121
View File
@@ -0,0 +1,121 @@
.. _sec-features-gcode_scripts:
GCODE Scripts
=============
.. contents::
OctoPrint allows you to define custom GCODE scripts to be executed on specified occasions, e.g. when a print
starts, when OctoPrint connects to a printer, or when a :ref:`button defined as a custom control <sec-features-custom_controls>`
is clicked.
Unless :ref:`configured otherwise <sec-configuration-config_yaml-folder>`, OctoPrint expects scripts to be located in
the ``scripts/gcode`` folder in OctoPrint configuration directory (per default ``~/.octoprint`` on Linux, ``%APPDATA%\OctoPrint``
on Windows and ``~/Library/Application Support/OctoPrint`` on MacOS).
These GCODE scripts are backed by the templating engine `Jinja2 <http://jinja.pocoo.org/>`_, allowing more than just
simple "send-as-is" scripts but making use of a full blown templating language in order to create your scripts. To
this end, OctoPrint injects a couple of variables into the :ref:`template rendering context <sec-features-gcode_scripts-context>`
as described below.
.. _sec-features-gcode_scripts-predefined:
Predefined Scripts
------------------
The following GCODE scripts are sent by OctoPrint automatically:
* ``afterPrinterConnected``: Sent after OctoPrint successfully connected to a printer. Defaults to an empty script.
* ``beforePrintStarted``: Sent just before a print job is started. Defaults to an empty script.
* ``afterPrintCancelled``: Sent just after a print job was cancelled. Defaults to the
:ref:`bundled script listed below <sec-features-gcode_scripts-bundled>`.
* ``afterPrintDone``: Sent just after a print job finished. Defaults to an empty script.
* ``afterPrintPaused``: Sent just after a print job was paused. Defaults to an empty script.
* ``beforePrintResumed``: Sent just before a print job is resumed. Defaults to an empty script.
.. note::
Plugins may extend these scripts through :ref:`a hook <sec-plugins-hook-comm-protocol-scripts>`.
.. _sec-features-gcode_scripts-snippets:
Snippets
--------
For making small GCODE snippets reusable in a template (e.g. for :ref:`disabling all hotends <sec-features-gcode_scripts-bundled>`)
there's an additional Jinja template command ``{% snippet '<snippet name>' %}`` available which allows including
snippets stored under ``scripts/gcode/snippets`` in OctoPrint's configuration directory. They fully support
the whole spectrum of the Jinja2 templating language (that includes including other snippets).
.. _sec-features-gcode_scripts-context:
Context
-------
All GCODE scripts have access to the following template variables through the template context:
* ``printer_profile``: The currently selected Printer Profile, including
information such as the extruder count, the build volume size, the filament diameter etc.
* ``script``: An object wrapping the script's type (``gcode``) and name (e.g. ``afterPrintCancelled``) as ``script.type``
and ``script.name`` respectively.
The :ref:`predefined GCODE scripts <sec-features-gcode_scripts-predefined>` are also called with the following additional
template variables:
* ``event``: The payload of the ``Connected``, ``PrintStarted``, ``PrintCancelled``, ``PrintDone``, ``PrintPaused`` or
``PrintResumed`` event. See :ref:`the documentation of events <sec-events-available_events>` for the contained values.
GCODE scripts attached to :ref:`custom controls <sec-features-custom_controls>` are called with the following
additional template variables:
* ``parameters``: The parameters as defined for the custom control, if it has any inputs.
* ``context``: Additional ``context`` included in the definition of the custom control.
.. _sec-features-gcode_scripts-bundled:
Bundled Scripts
---------------
Out of the box, OctoPrint defaults to the following script setup for ``afterPrintCancelled``:
.. code-block:: jinja
:caption: Default ``afterPrintCancelled`` script
; disable motors
M84
;disable all heaters
{% snippet 'disable_hotends' %}
[% snippet 'disable_bed' %}
;disable fan
M106 S0
The ``disable_hotends`` snippet is defined as follows:
.. code-block:: jinja
:caption: Default ``disable_hotends`` snippet
{% for tool in range(printer_profile.extruder.count) %}
M104 T{{ tool }} S0
{% endfor %}
The ``disable_bed`` snippet is defined as follows:
.. code-block:: jinja
:caption: Default ``disable_bed`` snippet
{% if printer_profile.heatedBed %}
M140 S0
{% endif %}
As you can see, the ``disable_hotends`` and ``disable_bed`` snippets utilize the
``printer_profile`` context variable in order to iterate through all available
extruders and set their temperature to 0, and to also set the bed temperature
to 0 if a heated bed is configured.
.. seealso::
`Jinja Template Designer Documentation <http://jinja.pocoo.org/docs/dev/templates/>`_
Jinja's Template Designer Documentation describes the syntax and semantics of the template language used
also by OctoPrint's GCODE scripts.
+14
View File
@@ -0,0 +1,14 @@
.. _section-features:
********
Features
********
.. toctree::
:maxdepth: 2
accesscontrol.rst
custom_controls.rst
gcode_scripts.rst
action_commands.rst
plugins.rst
+70
View File
@@ -0,0 +1,70 @@
.. _sec-features-plugins:
*******
Plugins
*******
Starting with OctoPrint 1.2.0, there's now a plugin system in place which allows to individually
extend OctoPrint's functionality.
Right now plugins can be used to extend OctoPrint's web interface, to execute specific tasks on server startup and
shutdown, to provide custom (API) endpoints or whole user interfaces with special functionality, to react to system
events or progress reports or to add support for additional slicers. More plugin types are planned for the future.
.. _sec-features-plugins-available:
Finding Plugins
===============
The official OctoPrint Plugin Repository can be found at `plugins.octoprint.org <http://plugins.octoprint.org>`_.
Some plugins may also be found in the list provided in `the OctoPrint wiki <https://github.com/foosel/OctoPrint/wiki#plugins>`_
and on the `OctoPrint organization Github page <https://github.com/OctoPrint>`_.
.. _sec-features-plugins-installing:
Installing Plugins
==================
Plugins can be installed through the bundled Plugin Manager, which allows installing plugins available in the
`OctoPrint Plugin Repository <http://plugins.octoprint.org>`_, from a web address or from an uploaded file archive.
Please refer to the documentation of the plugin for additional installations instructions.
Manual Installation
-------------------
If you don't want or can't use the Plugin Manager, plugins may also be installed manually either by copying and
unpacking them into one of the configured plugin folders (regularly those are ``<octoprint source root>/plugins`` and
``<octoprint config folder>/plugins`` [#f1]_ or by installing them as regular python modules via ``pip`` [#f2]_.
For a plugin available on the Python Package Index (PyPi), the process is as simple as issuing a
.. code-block:: bash
pip install <plugin_name>
For plugins not available on PyPi, you'll have to give ``pip`` an URL from which to install the package (e.g. the URL to
a ZIP file of the current master branch of a Github repository hosting a plugin, or even a ``git+https`` URL), example:
.. code-block:: bash
pip install https://github.com/OctoPrint/OctoPrint-Growl/archive/master.zip
See `the pip install documentation <http://pip.readthedocs.org/en/latest/reference/pip_install.html>`_ for what URL
types are possible.
.. _sec-features-plugins-developing:
Developing Plugins
==================
See :ref:`Developing Plugins <sec-plugins>`.
.. rubric:: Footnotes
.. [#f1] For Linux that will be ``~/.octoprint/plugins``, for Windows it will be ``%APPDATA%/OctoPrint/plugins`` and for
Mac ``~/Library/Application Support/OctoPrint/plugins``
.. [#f2] Make sure to use the exact same Python installation for installing the plugin that you also used for
installing & running OctoPrint. For OctoPi this means using ``~/oprint/bin/pip`` for installing plugins
instead of just ``pip``.
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

+309
View File
@@ -0,0 +1,309 @@
<?xml version="1.0"?>
<Document xmlns="http://www.evolus.vn/Namespace/Pencil"><Properties/><Pages><Page><Properties><Property name="name">sidebar</Property><Property name="id">1421408377849_1407</Property><Property name="width">1531</Property><Property name="height">847</Property><Property name="dimBackground"/><Property name="transparentBackground">true</Property><Property name="backgroundColor">#FFFFFFFF</Property><Property name="background">transparent</Property></Properties><Content><g xmlns="http://www.w3.org/2000/svg" p:type="Group" xmlns:p="http://www.evolus.vn/Namespace/Pencil" transform="translate(200,211.5)" id="9c37daabc3ba46d8a8d9392db9c5bfec" p:sizing-gow="533.5" p:sizing-goh="366.5"><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="db0858b72c864467b215dbf33d56f344" transform="matrix(1,0,0,1,57,-0.5)" p:sizing-ox="58" p:sizing-oy="0.5" p:sizing-ow="264" p:sizing-oh="368"><p:metadata><p:property name="box"><![CDATA[264,368]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,46]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<rect width="262" height="366" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="6a0c5dd8bb904291948a061be156b69a" transform="translate(1,1)"/>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="47e2c5b978d04acdae01fb06a59a4447">
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
</filter>
</defs>
<use xlink:href="#6a0c5dd8bb904291948a061be156b69a" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#47e2c5b978d04acdae01fb06a59a4447)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="1bb1baaca7cc44c1b02cd9b42c705cc4"/>
<use xlink:href="#6a0c5dd8bb904291948a061be156b69a" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="46" y="184" width="172" height="0" p:name="text" id="85bd2e4e256b4cb7842522f2f03f3c81" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
</div></foreignObject>
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="76483818cd584af4995434fb28810ce8" transform="matrix(1,0,0,1,73,15.5)" p:sizing-ox="74" p:sizing-oy="16.5" p:sizing-ow="232" p:sizing-oh="112"><p:metadata><p:property name="box"><![CDATA[232,112]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,14]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<rect width="230" height="110" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="3013ddbcc4fa492995a68798edd29384" transform="translate(1,1)"/>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="d1e4f71d5d584c4791ec9a7c9e5be830">
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
</filter>
</defs>
<use xlink:href="#3013ddbcc4fa492995a68798edd29384" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#d1e4f71d5d584c4791ec9a7c9e5be830)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="99bedd6f63d44a4a98c846ef4bec10a1"/>
<use xlink:href="#3013ddbcc4fa492995a68798edd29384" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="14" y="56" width="204" height="0" p:name="text" id="628f108cd2324e66b43059a0f6820ee6" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
</div></foreignObject>
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="cab18e5323344976a22116d09ed7f8d9" transform="matrix(1,0,0,1,73,143.5)" p:sizing-ox="74" p:sizing-oy="144.5" p:sizing-ow="232" p:sizing-oh="208"><p:metadata><p:property name="box"><![CDATA[232,208]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,25.999999999999993]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<rect width="230" height="206" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="81f28baf72ac469cbdebdcaeb5aeb243" transform="translate(1,1)"/>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="d7c2713036ee43909c0c1edc167e270b">
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
</filter>
</defs>
<use xlink:href="#81f28baf72ac469cbdebdcaeb5aeb243" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#d7c2713036ee43909c0c1edc167e270b)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="825e8e4a336247cba2f89994b72de93e"/>
<use xlink:href="#81f28baf72ac469cbdebdcaeb5aeb243" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="26" y="104" width="180" height="0" p:name="text" id="5da32f0eb5b64ebc8ed60f5ad52e1693" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
</div></foreignObject>
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="5bb69b63f17c4b90bab26e055b40809d" transform="matrix(1,0,0,1,88,52.5)" p:sizing-ox="89" p:sizing-oy="53.5" p:sizing-ow="200" p:sizing-oh="56"><p:metadata><p:property name="box"><![CDATA[200,56]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,7]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|5,5]]></p:property><p:property name="textContent"><![CDATA[
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<rect width="198" height="54" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1; stroke-dasharray: 5, 5;" p:name="rrRect" id="50d1edd378e8475a976ee62cc51e187a" transform="translate(1,1)"/>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="646abf607f094b84b088ebb2615c88cd">
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
</filter>
</defs>
<use xlink:href="#50d1edd378e8475a976ee62cc51e187a" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#646abf607f094b84b088ebb2615c88cd)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="ebb65993472448b0827d87c3a3b09450"/>
<use xlink:href="#50d1edd378e8475a976ee62cc51e187a" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="7" y="28" width="186" height="0" p:name="text" id="1ebe6438f1de49eaab62aa0ac42a63dd" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
</div></foreignObject>
</g><g p:type="Shape" p:def="Evolus.Common:PlainTextV2" id="253be0b8bade43249b1d0373589b4bde" transform="matrix(1,0,0,1,118,43.5)" p:sizing-ox="117.859375" p:sizing-oy="21.5" p:sizing-ow="79.7890625" p:sizing-oh="28"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[<name>]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Open Sans|bold|normal|20px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="a00b6941683d4803957395e5c0b93fc5" width="0" height="0"/>
<text xml:space="preserve" p:name="text" id="907a2badd36140fa9e10760dbe67b52d" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Open Sans; font-size: 20px; font-weight: bold; font-style: normal; text-decoration: none;"><tspan x="0" y="0">&lt;name&gt;</tspan></text>
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="a7b1d219b2e04f00946f8ad6fb892a70" transform="matrix(1,0,0,1,333,186.5)" p:sizing-ox="305.5" p:sizing-oy="187" p:sizing-ow="200" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[200,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,12]]></p:property><p:property name="leftEnd"><![CDATA[0,33]]></p:property><p:property name="rightStart"><![CDATA[200,12]]></p:property><p:property name="rightEnd"><![CDATA[200,33]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,80]]></p:property><p:property name="bottomEnd"><![CDATA[33,80]]></p:property><p:property name="pin"><![CDATA[-28,23]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">styles_content / styles<br />classes_content / classes</span><br />]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="d1b2e26143ba4dc9b5011127eaf859fa">
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
</filter>
<g p:name="container" id="1d983e33baff4b5db9814e8bc44d5ff2">
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="9d05a5c681eb4e8690d7092cfde36dd4" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 72 C 200 77.33333333333333 197.33333333333334 80 192 80 L 8 80 C 2.6666666666666665 80 0 77.33333333333333 0 72 L 0 33 L -28 23 L 0 12 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
</g>
</defs>
<use xlink:href="#1d983e33baff4b5db9814e8bc44d5ff2" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#d1b2e26143ba4dc9b5011127eaf859fa)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="0a8c818f34d64855927948dca5fdd21e"/>
<use xlink:href="#1d983e33baff4b5db9814e8bc44d5ff2" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="8" y="24" width="184" height="33" p:name="text" id="4edecb8e11ca486cad7e10fecaff8778" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">styles_content / styles<br />classes_content / classes</span><br /></div></foreignObject>
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="c736be040cc84947b5eb28896b2f18b0" transform="matrix(1,0,0,1,333,-0.5)" p:sizing-ox="321.5" p:sizing-oy="0" p:sizing-ow="200" p:sizing-oh="94"><p:metadata><p:property name="box"><![CDATA[200,94]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,14.100000000000001]]></p:property><p:property name="leftEnd"><![CDATA[0,38.775]]></p:property><p:property name="rightStart"><![CDATA[200,14.100000000000001]]></p:property><p:property name="rightEnd"><![CDATA[200,38.775]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,94]]></p:property><p:property name="bottomEnd"><![CDATA[33,94]]></p:property><p:property name="pin"><![CDATA[-12,27.025000000000002]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles_wrapper / styles<br />classes_wrapper / classes<br /></span>]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="da71a006d4af4ce6b8f0dc6b1763b086">
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
</filter>
<g p:name="container" id="9352a73150934cfd986e88ce1ab4a93e">
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="1d692ff756b24c2aafa9c15372494c5d" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 86 C 200 91.33333333333333 197.33333333333334 94 192 94 L 8 94 C 2.6666666666666665 94 0 91.33333333333333 0 86 L 0 38.775 L -12 27.025000000000002 L 0 14.100000000000001 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
</g>
</defs>
<use xlink:href="#9352a73150934cfd986e88ce1ab4a93e" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#da71a006d4af4ce6b8f0dc6b1763b086)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="2186895b427e4e0bac628bdbf5b65fe6"/>
<use xlink:href="#9352a73150934cfd986e88ce1ab4a93e" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="8" y="22" width="184" height="50" p:name="text" id="b02113fca2d14fa783c537fba5d391e6" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles_wrapper / styles<br />classes_wrapper / classes<br /></span></div></foreignObject>
</g><g p:type="Shape" p:def="Evolus.Common:PlainTextV2" id="61991a849e7f4c72a857ddebed80da33" transform="matrix(1,0,0,1,89,166.5)" p:sizing-ox="87.3984375" p:sizing-oy="154.5" p:sizing-ow="60" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[template]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="6d064b059239458684409f224ccbb316" width="0" height="0"/>
<text xml:space="preserve" p:name="text" id="dadbe69e489042ce8e4eb9fc489ea745" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">template</tspan></text>
</g><g p:type="Shape" p:def="Evolus.Common:PlainTextV2" id="39a78451571e4e14b57426ec83d5c92a" transform="matrix(1,0,0,1,100,75.5)" p:sizing-ox="98.3984375" p:sizing-oy="63.5" p:sizing-ow="109.1640625" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[template_header]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="538be6af592e49a686d10f714de79255" width="0" height="0"/>
<text xml:space="preserve" p:name="text" id="bb1be320b027418592c6edf7f319411d" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">template_header</tspan></text>
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="2f7cafb48e32492193fc2507d4a77a41" transform="matrix(1,0,0,1,88,24.5)" p:sizing-ox="89" p:sizing-oy="25.5" p:sizing-ow="24" p:sizing-oh="24"><p:metadata><p:property name="box"><![CDATA[24,24]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,3]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<rect width="22" height="22" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(255, 255, 255); stroke-opacity: 1;" p:name="rrRect" id="226ab97c12354c4c824fbf94a11a98b0" transform="translate(1,1)"/>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="8ae0aa26919c481db673739e49601e78">
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
</filter>
</defs>
<use xlink:href="#226ab97c12354c4c824fbf94a11a98b0" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#8ae0aa26919c481db673739e49601e78)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="13e998ab0f984d15b0b4f7c8f136ac21"/>
<use xlink:href="#226ab97c12354c4c824fbf94a11a98b0" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="3" y="12" width="18" height="0" p:name="text" id="998c2f0c678e447fa46f5424e9b8a698" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
</div></foreignObject>
</g><g p:type="Shape" p:def="Evolus.Common:arrow" id="f983474041574164a9ed540858755610" transform="matrix(1,0,0,1,-144,61.5)" p:sizing-ox="16" p:sizing-oy="30.5" p:sizing-ow="72" p:sizing-oh="63"><p:metadata><p:property name="startPin"><![CDATA[160,32]]></p:property><p:property name="endPin" p:connectedShapeId="2f7cafb48e32492193fc2507d4a77a41" p:connectedOutletId="middle-left" p:viax="222" p:viay="-25"><![CDATA[232,-25]]></p:property><p:property name="withStartArrow"><![CDATA[false]]></p:property><p:property name="withEndArrow"><![CDATA[true]]></p:property><p:property name="mode"><![CDATA[curvy]]></p:property><p:property name="detached"><![CDATA[false]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<path style="stroke-linejoin: round; fill: none;" p:name="path" id="d96ef38bf8c04e81aec043fef0b2d21c" d="M 160 32 C 160 -14 186 -25 232 -25 M 226 -31 L 232 -25 L 226 -19"/>
</defs>
<use xlink:href="#d96ef38bf8c04e81aec043fef0b2d21c" xmlns:xlink="http://www.w3.org/1999/xlink" stroke-width="10" stroke-opacity="0" stroke="#FF0000"/>
<use xlink:href="#d96ef38bf8c04e81aec043fef0b2d21c" xmlns:xlink="http://www.w3.org/1999/xlink" p:name="outArrow1" id="66e4484f068b49a09813e21c39d8994e" style="stroke: rgb(27, 50, 128); stroke-opacity: 1; stroke-width: 2;"/>
<text p:name="text" id="b0d40ebba7664c20a9a4f1452c86a07d" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;">
<textPath xlink:href="#d96ef38bf8c04e81aec043fef0b2d21c" xmlns:xlink="http://www.w3.org/1999/xlink" startOffset="50%" text-anchor="middle" alignment-baseline="middle">
<tspan dy="-4.333333333333333" p:name="textSpan" id="73255d7945434ce9bc661341349735e1" dx="-16"></tspan>
</textPath>
</text>
</g><g p:type="Shape" p:def="Evolus.Common:PlainTextV2" id="86ed3ea65aee42199bac08824c3826a6" transform="matrix(1,0,0,1,1,104.5)" p:sizing-ox="0" p:sizing-oy="92.5" p:sizing-ow="31.140625" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[icon]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="a9ecdbb9c77b4ce4928e46b7cfe54dcf" width="0" height="0"/>
<text xml:space="preserve" p:name="text" id="02a5711e99924fc4b34e5730e2a78fa8" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">icon</tspan></text>
</g></g></Content></Page><Page><Properties><Property name="name">tab</Property><Property name="id">1421409530685_8513</Property><Property name="width">1531</Property><Property name="height">847</Property><Property name="dimBackground"/><Property name="transparentBackground">true</Property><Property name="backgroundColor">#FFFFFFFF</Property><Property name="background">transparent</Property></Properties><Content><g xmlns="http://www.w3.org/2000/svg" p:type="Group" xmlns:p="http://www.evolus.vn/Namespace/Pencil" transform="translate(201,144)" id="d8e8f6e0f752428680f67384aa52208f" p:sizing-gow="598.5" p:sizing-goh="310"><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="9e881048fedf43d6a67dfad7f06548e9" transform="matrix(1,0,0,1,0,47)" p:sizing-ox="1" p:sizing-oy="48" p:sizing-ow="384" p:sizing-oh="264"><p:metadata><p:property name="box"><![CDATA[384,264]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,33]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<rect width="382" height="262" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="12a9d962fb7b4cabbe2795c5e396d6ec" transform="translate(1,1)"/>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="76b2ce77019f45daad45b48817f65325">
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
</filter>
</defs>
<use xlink:href="#12a9d962fb7b4cabbe2795c5e396d6ec" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#76b2ce77019f45daad45b48817f65325)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="6ed5bd1e00f648a792981e16e260963e"/>
<use xlink:href="#12a9d962fb7b4cabbe2795c5e396d6ec" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="33" y="132" width="318" height="0" p:name="text" id="14b2622dcb514c21a19fcf064f8abe55" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
</div></foreignObject>
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="fb37074399fd40dc8078a398f9299f3e" transform="matrix(1,0,0,1,16,63)" p:sizing-ox="17" p:sizing-oy="64" p:sizing-ow="352" p:sizing-oh="232"><p:metadata><p:property name="box"><![CDATA[352,232]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,29]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<rect width="350" height="230" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="d8debccd7e4f482b8c04420ef54ffa70" transform="translate(1,1)"/>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="1eb07f64e796487984ddffea498f79b9">
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
</filter>
</defs>
<use xlink:href="#d8debccd7e4f482b8c04420ef54ffa70" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#1eb07f64e796487984ddffea498f79b9)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="9b45931ea5e84b15a01479b46dc76b83"/>
<use xlink:href="#d8debccd7e4f482b8c04420ef54ffa70" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="29" y="116" width="294" height="0" p:name="text" id="6d8d3f3cce8b4da0b0f97ed8a5fce058" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
</div></foreignObject>
</g><g p:type="Shape" p:def="Evolus.Common:PlainTextV2" id="407ebd46fa5f48f395a7d5a0b8d46d2a" transform="matrix(1,0,0,1,26,83)" p:sizing-ox="24.3984375" p:sizing-oy="71" p:sizing-ow="60" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[template]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="efd58ec8f2eb45dcbeea7bb13c573cc5" width="0" height="0"/>
<text xml:space="preserve" p:name="text" id="ba9f30328268467ba17566dbd14ae998" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">template</tspan></text>
</g><g p:type="Shape" p:def="Evolus.Common:trapezoid" id="cb49850d258c4367abbee3628aa93512" transform="matrix(1,0,0,1,0,0)" p:sizing-ox="0" p:sizing-oy="0" p:sizing-ow="119" p:sizing-oh="48"><p:metadata><p:property name="box"><![CDATA[119,48]]></p:property><p:property name="a"><![CDATA[29.750000000000004,0]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property></p:metadata>
<path style="stroke-linejoin: round; stroke: rgb(0, 0, 0); stroke-opacity: 1; stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1;" p:name="path" id="ac794f7d717045878f0fdebc737e9adc" transform="translate(0,0)" d="M 29.750000000000004 0 L 89.25 0 L 119 48 L 0 48 z"/>
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:trapezoid" id="b0b14e6d505d4af7a04a05a8cc7fe672" transform="matrix(1,0,0,1,87,0)" p:sizing-ox="87" p:sizing-oy="0" p:sizing-ow="120" p:sizing-oh="48"><p:metadata><p:property name="box"><![CDATA[120,48]]></p:property><p:property name="a"><![CDATA[30,0]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property></p:metadata>
<path style="stroke-linejoin: round; stroke: rgb(0, 0, 0); stroke-opacity: 1; stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1;" p:name="path" id="5c4e128120224a0f87c3c6f9e98f9183" transform="translate(0,0)" d="M 30 0 L 90 0 L 120 48 L 0 48 z"/>
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:trapezoid" id="b95ce307dbc04cb297e1d019f1c31d0d" transform="matrix(1,0,0,1,263,0)" p:sizing-ox="263" p:sizing-oy="0" p:sizing-ow="120" p:sizing-oh="48"><p:metadata><p:property name="box"><![CDATA[120,48]]></p:property><p:property name="a"><![CDATA[30,0]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property></p:metadata>
<path style="stroke-linejoin: round; stroke: rgb(0, 0, 0); stroke-opacity: 1; stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1;" p:name="path" id="58f26895549a4afe87215738aad60c7f" transform="translate(0,0)" d="M 30 0 L 90 0 L 120 48 L 0 48 z"/>
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:trapezoid" id="dd08c65002d54b4d963c0fc1ddd8da56" transform="matrix(1,0,0,1,175,0)" p:sizing-ox="175" p:sizing-oy="0" p:sizing-ow="120" p:sizing-oh="48"><p:metadata><p:property name="box"><![CDATA[120,48]]></p:property><p:property name="a"><![CDATA[30,0]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property></p:metadata>
<path style="stroke-linejoin: round; stroke: rgb(0, 0, 0); stroke-opacity: 1; stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1;" p:name="path" id="2ff5fd3ed1174b1ca120e0521506dfdb" transform="translate(0,0)" d="M 30 0 L 90 0 L 120 48 L 0 48 z"/>
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:PlainTextV2" id="c821784d3f6f4c54a482c9b800303096" transform="matrix(1,0,0,1,196,38)" p:sizing-ox="195.859375" p:sizing-oy="16" p:sizing-ow="79.7890625" p:sizing-oh="28"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[<name>]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Open Sans|bold|normal|20px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="45c9bc72749f4114b754dd78d39294d9" width="0" height="0"/>
<text xml:space="preserve" p:name="text" id="510af970bf6e4a3299e10d5726dc506b" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Open Sans; font-size: 20px; font-weight: bold; font-style: normal; text-decoration: none;"><tspan x="0" y="0">&lt;name&gt;</tspan></text>
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="28819f317c9a44f487d89358bc01d35e" transform="matrix(1,0,0,1,398,0)" p:sizing-ox="284.5" p:sizing-oy="0.5" p:sizing-ow="200" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[200,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,12]]></p:property><p:property name="leftEnd"><![CDATA[0,33]]></p:property><p:property name="rightStart"><![CDATA[200,12]]></p:property><p:property name="rightEnd"><![CDATA[200,33]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,80]]></p:property><p:property name="bottomEnd"><![CDATA[33,80]]></p:property><p:property name="pin"><![CDATA[-114,22]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles_link / styles<br />classes_link / classes</span><br />]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="f46117a9847b442a848d6dc6d0f1ca02">
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
</filter>
<g p:name="container" id="7e565a2554874c8693bee8c3b1fb4a96">
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="35606f3a84d34cfabef6fd7995e162c9" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 72 C 200 77.33333333333333 197.33333333333334 80 192 80 L 8 80 C 2.6666666666666665 80 0 77.33333333333333 0 72 L 0 33 L -114 22 L 0 12 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
</g>
</defs>
<use xlink:href="#7e565a2554874c8693bee8c3b1fb4a96" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#f46117a9847b442a848d6dc6d0f1ca02)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="fba23d0e302047588af7e9e586dfb238"/>
<use xlink:href="#7e565a2554874c8693bee8c3b1fb4a96" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="8" y="15" width="184" height="50" p:name="text" id="d94b77112885453db437a00ff25500ca" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles_link / styles<br />classes_link / classes</span><br /></div></foreignObject>
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="6f1c4f61a1fb4f14a28d1793b958ba0a" transform="matrix(1,0,0,1,397,120)" p:sizing-ox="369.5" p:sizing-oy="120.5" p:sizing-ow="200" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[200,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,12]]></p:property><p:property name="leftEnd"><![CDATA[0,33]]></p:property><p:property name="rightStart"><![CDATA[200,12]]></p:property><p:property name="rightEnd"><![CDATA[200,33]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,80]]></p:property><p:property name="bottomEnd"><![CDATA[33,80]]></p:property><p:property name="pin"><![CDATA[-28,23]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles_content / styles<br />classes_content / classes</span><br />]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="acf275ea0a954d79ae41107f58d208ae">
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
</filter>
<g p:name="container" id="a75b69e48d5e40f4b6150b1ec2953af3">
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="eb3218f33a0b49fb8ec0ad9f86d2872a" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 72 C 200 77.33333333333333 197.33333333333334 80 192 80 L 8 80 C 2.6666666666666665 80 0 77.33333333333333 0 72 L 0 33 L -28 23 L 0 12 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
</g>
</defs>
<use xlink:href="#a75b69e48d5e40f4b6150b1ec2953af3" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#acf275ea0a954d79ae41107f58d208ae)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="809f63827dbe473db68c768a9299d7be"/>
<use xlink:href="#a75b69e48d5e40f4b6150b1ec2953af3" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="8" y="15" width="184" height="50" p:name="text" id="31d16c095ee849c791565b6c88b93fad" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles_content / styles<br />classes_content / classes</span><br /></div></foreignObject>
</g></g></Content></Page><Page><Properties><Property name="name">settings</Property><Property name="id">1421410253180_3579</Property><Property name="width">1531</Property><Property name="height">847</Property><Property name="dimBackground"/><Property name="transparentBackground">true</Property><Property name="backgroundColor">#FFFFFFFF</Property><Property name="background">transparent</Property></Properties><Content><g xmlns="http://www.w3.org/2000/svg" p:type="Group" xmlns:p="http://www.evolus.vn/Namespace/Pencil" transform="translate(323,143)" id="7395842d34de4079b3029fbb8f377213" p:sizing-gow="769.5" p:sizing-goh="390"><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="5267d389e1714536a6262df513ff7665" transform="matrix(1,0,0,1,-1,-1)" p:sizing-ox="0" p:sizing-oy="0" p:sizing-ow="144" p:sizing-oh="392"><p:metadata><p:property name="box"><![CDATA[144,392]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,49]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<rect width="142" height="390" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="cb16e9a309e341f1ba7f6440a0483dc7" transform="translate(1,1)"/>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="54e55b5fad5d4a3995c3806b790f2d05">
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
</filter>
</defs>
<use xlink:href="#cb16e9a309e341f1ba7f6440a0483dc7" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#54e55b5fad5d4a3995c3806b790f2d05)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="904bde4e72cb4b5aa6cb5b963c339bdf"/>
<use xlink:href="#cb16e9a309e341f1ba7f6440a0483dc7" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="49" y="196" width="46" height="0" p:name="text" id="e13fe7a85e1a4ca081470478b747bc8c" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
</div></foreignObject>
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="00107838b5c846ac87f4bbc67a235524" transform="matrix(1,0,0,1,143,-1)" p:sizing-ox="144" p:sizing-oy="0" p:sizing-ow="416" p:sizing-oh="392"><p:metadata><p:property name="box"><![CDATA[416,392]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,49]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<rect width="414" height="390" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="cbe5e6469a9647b9a54b064a30ee0c35" transform="translate(1,1)"/>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="8d5eca961f8d499abcbcdb90c9f38da8">
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
</filter>
</defs>
<use xlink:href="#cbe5e6469a9647b9a54b064a30ee0c35" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#8d5eca961f8d499abcbcdb90c9f38da8)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="34141c77145742d3810b0e7474f6e012"/>
<use xlink:href="#cbe5e6469a9647b9a54b064a30ee0c35" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="49" y="196" width="318" height="0" p:name="text" id="41ef32306e1e4d9da9165746657a5965" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
</div></foreignObject>
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="dfc036f4a3394f48abfd564cd42b2b0e" transform="matrix(1,0,0,1,159,15)" p:sizing-ox="160" p:sizing-oy="16" p:sizing-ow="384" p:sizing-oh="360"><p:metadata><p:property name="box"><![CDATA[384,360]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,45]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<rect width="382" height="358" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="29dc0c2600da465fb63911073183eafe" transform="translate(1,1)"/>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="451d197a117c48f7a68d1c1be41304e5">
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
</filter>
</defs>
<use xlink:href="#29dc0c2600da465fb63911073183eafe" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#451d197a117c48f7a68d1c1be41304e5)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="6c260c83376042eda5122f600dac0784"/>
<use xlink:href="#29dc0c2600da465fb63911073183eafe" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="45" y="180" width="294" height="0" p:name="text" id="cb978529c3144a3085a502964a33bfa4" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
</div></foreignObject>
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="f2e9506fa0ed4466890d1042d5ac901e" transform="matrix(1,0,0,1,15,175)" p:sizing-ox="16" p:sizing-oy="176" p:sizing-ow="112" p:sizing-oh="40"><p:metadata><p:property name="box"><![CDATA[112,40]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,5]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<rect width="110" height="38" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="76d805dced5640149e7d9b75b58e9479" transform="translate(1,1)"/>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="4fc6940222be4d1bb3d1bba581209b59">
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
</filter>
</defs>
<use xlink:href="#76d805dced5640149e7d9b75b58e9479" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#4fc6940222be4d1bb3d1bba581209b59)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="60a990d0eb9e4ea69c10c41791e58323"/>
<use xlink:href="#76d805dced5640149e7d9b75b58e9479" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="5" y="20" width="102" height="0" p:name="text" id="54e8a52460b84409b8c52e713918e527" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
</div></foreignObject>
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:PlainTextV2" id="3a5c9441f4dd450489ef6c32b84277bb" transform="matrix(1,0,0,1,22,202)" p:sizing-ox="21.859375" p:sizing-oy="180" p:sizing-ow="79.7890625" p:sizing-oh="28"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[<name>]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Open Sans|bold|normal|20px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="49590ece8832421093f480572615621e" width="0" height="0"/>
<text xml:space="preserve" p:name="text" id="638c493afd75474bba33ba6ed7f6b418" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Open Sans; font-size: 20px; font-weight: bold; font-style: normal; text-decoration: none;"><tspan x="0" y="0">&lt;name&gt;</tspan></text>
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:PlainTextV2" id="ebd3473021234611aefc9fa212dcc943" transform="matrix(1,0,0,1,175,37)" p:sizing-ox="173.3984375" p:sizing-oy="25" p:sizing-ow="60" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[template]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="a7f7b8da20384df091964756d22bd5df" width="0" height="0"/>
<text xml:space="preserve" p:name="text" id="85ffc835cc2f4e8ea41c1857b55af53e" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">template</tspan></text>
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="a0d9b8a91b8d4913bc11cca99c86a459" transform="matrix(1,0,0,1,569,15)" p:sizing-ox="541.5" p:sizing-oy="15.5" p:sizing-ow="200" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[200,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,12]]></p:property><p:property name="leftEnd"><![CDATA[0,33]]></p:property><p:property name="rightStart"><![CDATA[200,12]]></p:property><p:property name="rightEnd"><![CDATA[200,33]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,80]]></p:property><p:property name="bottomEnd"><![CDATA[33,80]]></p:property><p:property name="pin"><![CDATA[-28,23]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles_content / styles<br />classes_content / classes<br /></span>]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="2f5319b357c84839b3986162a515c00e">
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
</filter>
<g p:name="container" id="9c15a0a8bd764d0187e813cd78f906d4">
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="0f6d812601a94e60b7f5e3f1d859d630" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 72 C 200 77.33333333333333 197.33333333333334 80 192 80 L 8 80 C 2.6666666666666665 80 0 77.33333333333333 0 72 L 0 33 L -28 23 L 0 12 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
</g>
</defs>
<use xlink:href="#9c15a0a8bd764d0187e813cd78f906d4" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#2f5319b357c84839b3986162a515c00e)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="4a90c69f97384e74ae968cff348b2ed9"/>
<use xlink:href="#9c15a0a8bd764d0187e813cd78f906d4" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="8" y="15" width="184" height="50" p:name="text" id="eac648dfa87d4f719c8d271b82f1c930" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles_content / styles<br />classes_content / classes<br /></span></div></foreignObject>
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="bda1534d936b4b1a8851bd7316333963" transform="matrix(1,0,0,1,137,175)" p:sizing-ox="125.5" p:sizing-oy="175.5" p:sizing-ow="200" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[200,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,12]]></p:property><p:property name="leftEnd"><![CDATA[0,33]]></p:property><p:property name="rightStart"><![CDATA[200,12]]></p:property><p:property name="rightEnd"><![CDATA[200,33]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,80]]></p:property><p:property name="bottomEnd"><![CDATA[33,80]]></p:property><p:property name="pin"><![CDATA[-12,23]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles_link / styles<br />classes_link / classes</span><br />]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="7190c91fd5a0498faee46f6a07e4ee36">
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
</filter>
<g p:name="container" id="e38975d273874cd7ac31fa1c63716ec1">
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="72ab543eb28a48e6bedf116266c72fbb" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 72 C 200 77.33333333333333 197.33333333333334 80 192 80 L 8 80 C 2.6666666666666665 80 0 77.33333333333333 0 72 L 0 33 L -12 23 L 0 12 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
</g>
</defs>
<use xlink:href="#e38975d273874cd7ac31fa1c63716ec1" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#7190c91fd5a0498faee46f6a07e4ee36)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="f143de029bc146c7a3a7bca494562509"/>
<use xlink:href="#e38975d273874cd7ac31fa1c63716ec1" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="8" y="15" width="184" height="50" p:name="text" id="9ba09cfb0e0643c69291c6942df8c8c9" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles_link / styles<br />classes_link / classes</span><br /></div></foreignObject>
</g></g></Content></Page><Page><Properties><Property name="name">navbar</Property><Property name="id">1421410510071_9693</Property><Property name="width">1531</Property><Property name="height">847</Property><Property name="dimBackground"/><Property name="transparentBackground">true</Property><Property name="backgroundColor">#FFFFFFFF</Property><Property name="background">transparent</Property></Properties><Content><g xmlns="http://www.w3.org/2000/svg" p:type="Group" xmlns:p="http://www.evolus.vn/Namespace/Pencil" transform="translate(126,121)" id="31a617e276fe4161a5e3b70380bb0e34" p:sizing-gow="490.5" p:sizing-goh="78"><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="fa8da9aed28744f5af9f11285080496c" transform="matrix(1,0,0,1,-1,-1)" p:sizing-ox="0" p:sizing-oy="0" p:sizing-ow="283" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[283,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,10]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<rect width="281" height="78" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="ea12bfd96e974a0f8f92afced67bdd6f" transform="translate(1,1)"/>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="d5043318357b49a1bb219a00f76eddd9">
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
</filter>
</defs>
<use xlink:href="#ea12bfd96e974a0f8f92afced67bdd6f" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#d5043318357b49a1bb219a00f76eddd9)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="0d42ff0970ff472aa4c006ef85d8e87a"/>
<use xlink:href="#ea12bfd96e974a0f8f92afced67bdd6f" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="10" y="40" width="263" height="0" p:name="text" id="40018080392b490da490d8b286b95c41" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
</div></foreignObject>
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="5b845ca54039496591b80db2010a32bc" transform="matrix(1,0,0,1,122,15)" p:sizing-ox="123" p:sizing-oy="16" p:sizing-ow="144" p:sizing-oh="48"><p:metadata><p:property name="box"><![CDATA[144,48]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,6]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<rect width="142" height="46" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="480225b90d8842139e20649d22caa757" transform="translate(1,1)"/>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="db76ffd36668492aa45c3dacb4ed2d52">
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
</filter>
</defs>
<use xlink:href="#480225b90d8842139e20649d22caa757" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#db76ffd36668492aa45c3dacb4ed2d52)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="125928c2b681488ba446768b095a76a5"/>
<use xlink:href="#480225b90d8842139e20649d22caa757" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="6" y="24" width="132" height="0" p:name="text" id="de5cbf018c224ba3adf8aed52ebc5f77" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
</div></foreignObject>
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:PlainTextV2" id="3637818ac51540849a753285e83d950d" transform="matrix(1,0,0,1,132,35)" p:sizing-ox="130.3984375" p:sizing-oy="23" p:sizing-ow="60" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[template]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="6f91157aa1354619ab2b7960baeb8cba" width="0" height="0"/>
<text xml:space="preserve" p:name="text" id="638334d0a39b4b39a7e4806254e2e418" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">template</tspan></text>
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="c0be16ae150d4dc68b7bffdc19d19262" transform="matrix(1,0,0,1,294,7)" p:sizing-ox="266.5" p:sizing-oy="7.5" p:sizing-ow="196" p:sizing-oh="64"><p:metadata><p:property name="box"><![CDATA[196,64]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[7.84,0]]></p:property><p:property name="leftStart"><![CDATA[0,9.84]]></p:property><p:property name="leftEnd"><![CDATA[0,26.400000000000002]]></p:property><p:property name="rightStart"><![CDATA[196,9.84]]></p:property><p:property name="rightEnd"><![CDATA[196,26.400000000000002]]></p:property><p:property name="topStart"><![CDATA[11.76,0]]></p:property><p:property name="topEnd"><![CDATA[32.339999999999996,0]]></p:property><p:property name="bottomStart"><![CDATA[11.76,64]]></p:property><p:property name="bottomEnd"><![CDATA[32.339999999999996,64]]></p:property><p:property name="pin"><![CDATA[-28,18]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles<br />classes</span><br />]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
<defs>
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="f3a0f53acfa3492abf13b69eb2bf8e75">
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
</filter>
<g p:name="container" id="8eaa88f76ee748fdbb66142e124db376">
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="e5ed7702279b485f83a84e170232b245" d="M 7.84 0 L 188.16 0 C 193.38666666666666 0 196 2.6133333333333333 196 7.84 L 196 56.16 C 196 61.38666666666667 193.38666666666666 64 188.16 64 L 7.84 64 C 2.6133333333333333 64 0 61.38666666666667 0 56.16 L 0 26.400000000000002 L -28 18 L 0 9.84 L 0 7.84 C 0 2.6133333333333333 2.6133333333333333 0 7.84 0"/>
</g>
</defs>
<use xlink:href="#8eaa88f76ee748fdbb66142e124db376" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#f3a0f53acfa3492abf13b69eb2bf8e75)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="e7a7687af8d14f2888d588636e0cd333"/>
<use xlink:href="#8eaa88f76ee748fdbb66142e124db376" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<foreignObject x="7.84" y="7" width="180.32" height="50" p:name="text" id="cdcded6607b7463ea18aa393da7520bc" style="font-family: &quot;Liberation Sans&quot;,Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles<br />classes</span><br /></div></foreignObject>
</g></g></Content></Page></Pages></Document>
+6 -3
View File
@@ -6,9 +6,9 @@ Welcome to OctoPrint's documentation!
:alt: The OctoPrint Logo
:align: right
This is a work in progress. The goal is to document OctoPrint's REST API, event system, configuration etc in a way that
allows different documentation per development branch in Git, which so far did not scale well with the Github-Wiki-based
approach.
This documentation is still in the process of being migrated from
`OctoPrint's wiki <https://github.com/foosel/OctoPrint/wiki>`_, so also take
a look there!
Contents
========
@@ -16,7 +16,10 @@ Contents
.. toctree::
:maxdepth: 2
features/index.rst
configuration/index.rst
api/index.rst
events/index.rst
plugins/index.rst
modules/index.rst
+39
View File
@@ -0,0 +1,39 @@
.. _sec-modules-filemanager:
octoprint.filemanager
---------------------
.. automodule:: octoprint.filemanager
:members:
.. _sec-modules-filemanager-analysis:
octoprint.filemanager.analysis
------------------------------
.. automodule:: octoprint.filemanager.analysis
:members:
.. _sec-modules-filemanager-destinations:
octoprint.filemanager.destinations
----------------------------------
.. automodule:: octoprint.filemanager.destinations
:members:
.. _sec-modules-filemanager-storage:
octoprint.filemanager.storage
-----------------------------
.. automodule:: octoprint.filemanager.storage
:members: StorageInterface, LocalFileStorage
.. _sec-modules-filemanager-util:
octoprint.filemanager.util
--------------------------
.. automodule:: octoprint.filemanager.util
:members:
+16
View File
@@ -0,0 +1,16 @@
.. _sec-modules:
################
Internal Modules
################
.. toctree::
:maxdepth: 3
filemanager.rst
plugin.rst
printer.rst
server.rst
settings.rst
slicing.rst
util.rst
+20
View File
@@ -0,0 +1,20 @@
.. _sec-modules-plugin:
octoprint.plugin
----------------
.. automodule:: octoprint.plugin
.. _sec-modules-plugin-core:
octoprint.plugin.core
---------------------
.. automodule:: octoprint.plugin.core
.. _sec-modules-plugin-types:
octoprint.plugin.types
----------------------
.. automodule:: octoprint.plugin.types
+6
View File
@@ -0,0 +1,6 @@
.. _sec-modules-printer:
octoprint.printer
-----------------
.. automodule:: octoprint.printer
+42
View File
@@ -0,0 +1,42 @@
.. _sec-modules-server:
octoprint.server
----------------
.. automodule:: octoprint.server
:members:
.. _sec-modules-server-util:
octoprint.server.util
---------------------
.. automodule:: octoprint.server.util
:members:
.. _sec-modules-server-util-flask:
octoprint.server.util.flask
---------------------------
.. automodule:: octoprint.server.util.flask
:members:
.. _sec-modules-server-util-sockjs:
octoprint.server.util.sockjs
----------------------------
.. automodule:: octoprint.server.util.sockjs
:members:
.. _sec-modules-server-util-tornado:
octoprint.server.util.tornado
-----------------------------
.. automodule:: octoprint.server.util.tornado
:members:
+6
View File
@@ -0,0 +1,6 @@
.. _sec-modules-settings:
octoprint.settings
------------------
.. automodule:: octoprint.settings
+13
View File
@@ -0,0 +1,13 @@
.. _sec-modules-slicing:
octoprint.slicing
-----------------
.. automodule:: octoprint.slicing
.. _sec-modules-slicing-exceptions:
octoprint.slicing.exceptions
----------------------------
.. automodule:: octoprint.slicing.exceptions
+9
View File
@@ -0,0 +1,9 @@
.. _sec-modules-util:
octoprint.util
--------------
.. automodule:: octoprint.util
:members:
+349
View File
@@ -0,0 +1,349 @@
.. _sec-plugin-concepts:
Concepts
========
.. contents::
:local:
OctoPrint's plugins are `Python Packages <https://docs.python.org/2/tutorial/modules.html#packages>`_ which in their
top-level module define a bunch of :ref:`control properties <sec-plugin-concepts-controlproperties>` defining
metadata (like name, version etc of the plugin) as well as information on how to initialize the plugin and into what
parts of the system the plugin will actually plug in to perform its job.
There are three types of ways a plugin might attach itself to the system, through so called
:ref:`mixin <sec-plugin-concepts-mixins>` implementations, by attaching itself to specified
:ref:`hook <sec-plugin-concepts-hooks>` or by offering :ref:`helper <sec-plugin-concepts-helpers>` functionality to be
used by other plugins.
Plugin mixin implementations will get a bunch of :ref:`properties injected <sec-plugins-concepts-injectedproperties>`
by OctoPrint plugin system to help them work.
.. _sec-plugin-concepts-controlproperties:
Control Properties
------------------
As already mentioned above, plugins are Python packages which provide certain pieces of metadata to tell OctoPrint's
plugin subsystem about themselves. These are simple package attributes defined in the top most package file, e.g.:
.. code-block:: python
import octoprint.plugin
# ...
__plugin_name__ = "My Plugin"
def __plugin_load__():
# whatever you need to do to load your plugin, if anything at all
pass
The following properties are recognized:
``__plugin_name__``
Name of your plugin, optional, overrides the name specified in ``setup.py`` if provided. If neither this property nor
a name from ``setup.py`` is available to the plugin subsystem, the plugin's identifier (= package name) will be
used instead.
``__plugin_version__``
Version of your plugin, optional, overrides the version specified in ``setup.py`` if provided.
``__plugin_description__``
Description of your plugin, optional, overrides the description specified in ``setup.py`` if provided.
``__plugin_author__``
Author of your plugin, optional, overrides the author specified in ``setup.py`` if provided.
``__plugin_url__``
URL of the webpage of your plugin, e.g. the Github repository, optional, overrides the URL specified in ``setup.py`` if
provided.
``__plugin_license__``
License of your plugin, optional, overrides the license specified in ``setup.py`` if provided.
``__plugin_implementation__``
Instance of an implementation of one or more :ref:`plugin mixins <sec-plugins-mixins>`.
``__plugin_hooks__``
Handlers for one or more of the various :ref:`plugin hooks <sec-plugins-hooks>`.
``__plugin_check__``
Method called upon discovery of the plugin by the plugin subsystem, should return ``True`` if the
plugin can be instantiated later on, ``False`` if there are reasons why not, e.g. if dependencies
are missing.
``__plugin_load__``
Method called upon loading of the plugin by the plugin subsystem, can be used to instantiate
plugin implementations, connecting them to hooks etc.
``__plugin_unload__``
Method called upon unloading of the plugin by the plugin subsystem, can be used to do any final clean ups.
``__plugin_enable__``
Method called upon enabling of the plugin by the plugin subsystem. Also see :func:`~octoprint.plugin.core.Plugin.on_plugin_enabled``.
``__plugin_disable__``
Method called upon disabling of the plugin by the plugin subsystem. Also see :func:`~octoprint.plugin.core.Plugin.on_plugin_disabled``.
.. _sec-plugin-concepts-mixins:
Mixins
------
Plugin mixins are the heart of OctoPrint's plugin system. They are :ref:`special base classes <sec-plugins-mixins>`
which are to be subclassed and extended to add functionality to OctoPrint. Plugins declare their instances that
implement one or multiple mixins using the ``__plugin_implementation__`` control property. OctoPrint's plugin core
collects those from the plugins and offers methods to access them based on the mixin type, which get used at multiple
locations within OctoPrint.
Using mixins always follows the pattern of retrieving the matching implementations from the plugin subsystem, then
calling the specific mixin's methods as defined and necessary.
The following snippet taken from OctoPrint's code for example shows how all :class:`~octoprint.plugin.AssetPlugin`
implementations are collected and then all assets they return via their ``get_assets`` methods are retrieved and
merged into one big asset map (differing between javascripts and stylesheets of various types) for use during
rendition of the UI.
.. code-block:: python
:linenos:
asset_plugins = pluginManager.get_implementations(octoprint.plugin.AssetPlugin)
for name, implementation in asset_plugins.items():
all_assets = implementation.get_assets()
if "js" in all_assets:
for asset in all_assets["js"]:
assets["js"].append(url_for('plugin_assets', name=name, filename=asset))
if preferred_stylesheet in all_assets:
for asset in all_assets[preferred_stylesheet]:
assets["stylesheets"].append((preferred_stylesheet, url_for('plugin_assets', name=name, filename=asset)))
else:
for stylesheet in supported_stylesheets:
if not stylesheet in all_assets:
continue
for asset in all_assets[stylesheet]:
assets["stylesheets"].append((stylesheet, url_for('plugin_assets', name=name, filename=asset)))
break
.. seealso::
:ref:`Available Mixins <sec-plugins-mixins>`
An overview of all mixin types available for extending OctoPrint.
:ref:`The Getting Started Guide <sec-plugins-gettingstarted>`
Tutorial on how to write a simple OctoPrint module utilizing mixins for various types of extension.
.. _sec-plugin-concepts-hooks:
Hooks
-----
Hooks are the smaller siblings of mixins, allowing to extend functionality or data processing where a custom mixin type
would be too much overhead. Where mixins are based on classes, hooks are based on methods. Like with the mixin
implementations, plugins inform OctoPrint about hook handlers using a control property, ``__plugin_hooks__``.
Each hook defines a contract detailing the call parameters for the hook handler method and the expected return type.
OctoPrint will call the hook with the define parameters and process the result depending on the hook.
An example for a hook within OctoPrint is ``octoprint.comm.protocol.scripts``, which allows adding additional
lines to OctoPrint's :ref:`GCODE scripts <sec-features-gcode_scripts>`, either as ``prefix`` (before the existing lines)
or as ``postfix`` (after the existing lines).
.. code-block:: python
:linenos:
self._gcode_hooks = self._pluginManager.get_hooks("octoprint.comm.protocol.scripts")
# ...
for hook in self._gcodescript_hooks:
try:
retval = self._gcodescript_hooks[hook](self, "gcode", scriptName)
except:
self._logger.exception("Error while processing gcodescript hook %s" % hook)
else:
if retval is None:
continue
if not isinstance(retval, (list, tuple)) or not len(retval) == 2:
continue
def to_list(data):
if isinstance(data, str):
data = map(str.strip, data.split("\n"))
elif isinstance(data, unicode):
data = map(unicode.strip, data.split("\n"))
if isinstance(data, (list, tuple)):
return list(data)
else:
return None
prefix, suffix = map(to_list, retval)
if prefix:
scriptLines = list(prefix) + scriptLines
if suffix:
scriptLines += list(suffix)
As you can see, the hook's method signature is defined to take the current ``self`` (as in, the current comm layer instance),
the general type of script for which to look for additions ("gcode") and the script name for which to look (e.g.
``beforePrintStarted`` for the GCODE script executed before the beginning of a print job). The hook is expected to
return a 2-tuple of prefix and postfix if has something for either of those, otherwise ``None``. OctoPrint will then take
care to add prefix and suffix as necessary after a small round of preprocessing.
.. note::
At the moment there exists no way to determine the execution order of various hook handlers within OctoPrint,
or to prevent the execution of further handlers down the chain.
This is planned for the very near future though.
Plugins can easily add their own hooks too. For example, the `Software Update Plugin <https://github.com/OctoPrint/OctoPrint-SoftwareUpdate>`_
declares a custom hook "octoprint.plugin.softwareupdate.check_config" which other plugins can add handlers for in order
to register themselves with the Software Update Plugin by returning their own update check configuration.
If you want your hook handler to be an instance method of a mixin implementation of your plugin (for example since you
need access to instance variables handed to your implementation via mixin invocations), you can get this work
by using a small trick. Instead of defining it directly via ``__plugin_hooks__`` utilize the ``__plugin_load__``
property instead, manually instantiate your implementation instance and then add its hook handler method to the
``__plugin_hooks__`` property and itself to the ``__plugin_implementation__`` property. See the following example.
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/custom_action_command.py
:linenos:
:tab-width: 4
:caption: `custom_action_command.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/custom_action_command.py>`_
:name: sec-plugin-concepts-hooks-example
.. seealso::
:ref:`Available Hooks <sec-plugins-hooks>`
An overview of all hooks defined in OctoPrint itself.
.. _sec-plugin-concepts-helpers:
Helpers
-------
Helpers are methods that plugin can exposed to other plugins in order to make common functionality available on the
system. They are registered with the OctoPrint plugin system through the use of the control property ``__plugin_helpers__``.
An example for providing a couple of helper functions to the system can be found in the
`Discovery Plugin <https://github.com/foosel/OctoPrint/wiki/Plugin:-Discovery>`_,
which provides it's SSDP browsing and Zeroconf browsing and publishing functions as helper methods.
.. code-block:: python
:linenos:
:emphasize-lines: 11-20
:caption: Excerpt from the Discovery Plugin showing the declaration of its exported helpers.
:name: sec-plugin-concepts-helpers-example-export
def __plugin_load__():
if not pybonjour:
# no pybonjour available, we can't use that
logging.getLogger("octoprint.plugins." + __name__).info("pybonjour is not installed, Zeroconf Discovery won't be available")
plugin = DiscoveryPlugin()
global __plugin_implementation__
__plugin_implementation__ = plugin
global __plugin_helpers__
__plugin_helpers__ = dict(
ssdp_browse=plugin.ssdp_browse
)
if pybonjour:
__plugin_helpers__.update(dict(
zeroconf_browse=plugin.zeroconf_browse,
zeroconf_register=plugin.zeroconf_register,
zeroconf_unregister=plugin.zeroconf_unregister
))
An example of how to use helpers can be found in the `Growl Plugin <https://github.com/OctoPrint/OctoPrint-Growl>`_.
Using :meth:`~octoprint.plugin.code.PluginManager.get_helpers` plugins can retrieve exported helper methods and call
them as (hopefully) documented.
.. code-block:: python
:linenos:
:emphasize-lines: 6-8,20
:caption: Excerpt from the Growl Plugin showing utilization of the helpers published by the Discovery Plugin.
:name: sec-plugin-concepts-helpers-example-usage
def on_after_startup(self):
host = self._settings.get(["hostname"])
port = self._settings.getInt(["port"])
password = self._settings.get(["password"])
helpers = self._plugin_manager.get_helpers("discovery", "zeroconf_browse")
if helpers and "zeroconf_browse" in helpers:
self.zeroconf_browse = helpers["zeroconf_browse"]
self.growl, _ = self._register_growl(host, port, password=password)
# ...
def on_api_get(self, request):
if not self.zeroconf_browse:
return flask.jsonify(dict(
browsing_enabled=False
))
browse_results = self.zeroconf_browse("_gntp._tcp", block=True)
growl_instances = [dict(name=v["name"], host=v["host"], port=v["port"]) for v in browse_results]
return flask.jsonify(dict(
browsing_enabled=True,
growl_instances=growl_instances
))
.. _sec-plugins-concepts-injectedproperties:
Injected Properties
-------------------
OctoPrint's plugin subsystem will inject a bunch of properties into each :ref:`mixin implementation <sec-plugin-concepts-mixins>`.
An overview of these properties follows.
``self._identifier``
The plugin's identifier.
``self._plugin_name``
The plugin's name, as taken from either the ``__plugin_name__`` control property or the package info.
``self._plugin_version``
The plugin's version, as taken from either the ``__plugin_version__`` control property or the package info.
``self._plugin_info``
The :class:`octoprint.plugin.core.PluginInfo` object associated with the plugin.
``self._basefolder``
The plugin's base folder where it's installed. Can be used to refer to files relative to the plugin's installation
location, e.g. included scripts, templates or assets.
``self._datafolder``
The plugin's additional data folder path. Can be used to store additional files needed for the plugin's operation (cache,
data files etc). Plugins should not access this property directly but instead utilize :func:`~octoprint.plugin.types.OctoPrintPlugin.get_plugin_data_folder`
which will make sure the path actually does exist and if not create it before returning it.
``self._logger``
A `python logger instance <https://docs.python.org/2/library/logging.html>`_ logging to the log target
``octoprint.plugin.<plugin identifier>``.
``self._settings``
The plugin's personalized settings manager, injected only into plugins that include the :class:`~octoprint.plugin.SettingsPlugin` mixin.
An instance of :class:`octoprint.plugin.PluginSettings`.
``self._plugin_manager``
OctoPrint's plugin manager object, an instance of :class:`octoprint.plugin.core.PluginManager`.
``self._printer_profile_manager``
OctoPrint's printer profile manager, an instance of :class:`octoprint.printer.profile.PrinterProfileManager`.
``self._event_bus``
OctoPrint's event bus, an instance of :class:`octoprint.events.EventManager`.
``self._analysis_queue``
OctoPrint's analysis queue for analyzing GCODEs or other files, an instance of :class:`octoprint.filemanager.analysis.AnalysisQueue`.
``self._slicing_manager``
OctoPrint's slicing manager, an instance of :class:`octoprint.slicing.SlicingManager`.
``self._file_manager``
OctoPrint's file manager, an instance of :class:`octoprint.filemanager.FileManager`.
``self._printer``
OctoPrint's printer management object, an instance of :class:`octoprint.printer.PrinterInterface`.
``self._app_session_manager``
OctoPrint's application session manager, an instance of :class:`octoprint.server.util.flask.AppSessionManager`.
.. seealso::
:class:`~octoprint.plugin.core.Plugin` and :class:`~octoprint.plugin.types.OctoPrintPlugin`
Class documentation also containing the properties shared among all mixing implementations.
:ref:`Available Mixins <sec-plugins-mixins>`
Some mixin types trigger the injection of additional properties.
.. _sec-plugins-concept-lifecycle:
Lifecycle
---------
.. image:: ../images/plugins_lifecycle.png
:align: center
:alt: The lifecycle of OctoPrint plugins.
-19
View File
@@ -1,19 +0,0 @@
.. _sec-plugins-developing:
******************
Developing Plugins
******************
.. todo::
A section on how to develop plugins yourself, including a tutorial creating an exemplary plugin as well as
a documentation of the plugin API, will be added in the near future.
.. _sec-plugins-developing-types:
Available plugin types
======================
.. automodule:: octoprint.plugin.types
:members:
:undoc-members:
+49
View File
@@ -0,0 +1,49 @@
.. _sec-plugins-distribution:
Distributing your plugin
========================
You can distribute a plugin with OctoPrint via two ways.
.. contents::
:local:
.. _sec-plugins-distribution-manual:
Manual file distribution
------------------------
You can have your users copy it to OctoPrint's plugin folder (normally located at ``~/.octoprint/plugins`` under Linux,
``%APPDATA%\OctoPrint\plugins`` on Windows and ... on Mac). In this case your plugin will be distributed directly
as a Python module (a single ``.py`` file containing all of your plugin's code directly and named
like your plugin) or a package (a folder named like your plugin + ``__init.py__`` contained within).
.. _sec-plugins-distribution-pip:
Proper packages installable via pip
-----------------------------------
You can have your users install it via ``pip`` and register it for the `entry point <https://pythonhosted.org/setuptools/setuptools.html#dynamic-discovery-of-services-and-plugins>`_ ``octoprint.plugin`` via
your plugin's ``setup.py``, this way it will be found automatically by OctoPrint upon initialization of the
plugin subsystem [#f1]_.
For an example of how the directory structure and related files would look like in this case, please take a
look at the `helloworld example from OctoPrint's example plugins <https://github.com/OctoPrint/Plugin-Examples/tree/master/helloworld>`_.
This variant is highly recommended for pretty much any plugin besides the most basic ones since it also allows
requirements management and pretty much any thing else that Python's setuptools provide to the developer.
.. seealso::
`OctoPrint Plugin Skeleton <https://github.com/OctoPrint/OctoPrint-PluginSkeleton>`_
A basic plugin skeleton providing you with all you need to get started with distributing your plugin as a proper
package. See the :ref:`Getting Started Guide <sec-plugins-gettingstarted>` for an
:ref:`example <sec-plugins-gettingstarted-growingup>` on how to use this.
.. rubric:: Footnotes
.. [#f1] The automatic registration will only work within the same Python installation (this also includes virtual
environments), so make sure to instruct your users to use the exact same Python installation for installing
the plugin that they also used for installing & running OctoPrint. For OctoPi this means using
``~/oprint/bin/pip`` for installing plugins instead of just ``pip``.
File diff suppressed because it is too large. Load diff
+546
View File
@@ -0,0 +1,546 @@
.. _sec-plugins-hooks:
Available plugin hooks
======================
.. note::
All of the hooks below take at least two parameters, ``*args`` and ``**kwargs``. Please make sure those are present.
They will act as placeholders if additional parameters are added to the hooks in the future and will allow
your plugin to stay compatible to OctoPrint without any necessary adjustments from you in these cases.
.. contents::
:local:
.. _sec-plugins-hook-accesscontrol-appkey:
octoprint.accesscontrol.appkey
------------------------------
.. py:function:: hook(*args, **kwargs)
By handling this hook plugins may register additional :ref:`App session key providers <sec-api-apps-sessionkey>`
within the system.
Overrides this to return your additional app information to be used for validating app session keys. You'll
need to return a list of 3-tuples of the format (id, version, public key).
The ``id`` should be the (unique) identifier of the app. Using a domain prefix might make sense here, e.g.
``org.octoprint.example.MyApp``.
``version`` should be a string specifying the version of the app for which the public key is valid. You can
provide the string ``any`` here, in which case the provided public key will be valid for all versions of the
app for which no specific public key is defined.
Finally, the public key is expected to be provided as a PKCS1 string without newlines.
:return: A list of 3-tuples as described above
:rtype: list
.. _sec-plugins-hook-comm-protocol-action:
octoprint.comm.protocol.action
------------------------------
.. py:function:: hook(comm_instance, line, action, *args, **kwargs)
React to a :ref:`action command <sec-features-action_commands>` received from the printer.
Hook handlers may use this to react to react to custom firmware messages. OctoPrint parses the received action
command ``line`` and provides the parsed ``action`` (so anything after ``// action:``) to the hook handler.
No returned value is expected.
**Example:**
Logs if the ``custom`` action (``// action:custom``) is received from the printer's firmware.
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/custom_action_command.py
:linenos:
:tab-width: 4
:caption: `custom_action_command.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/custom_action_command.py>`_
:param object comm_instance: The :class:`~octoprint.util.comm.MachineCom` instance which triggered the hook.
:param str line: The complete line as received from the printer, format ``// action:<command>``
:param str action: The parsed out action command, so for a ``line`` like ``// action:some_command`` this will be
``some_command``
.. _sec-plugins-hook-comm-protocol-gcode-phase:
octoprint.comm.protocol.gcode.<phase>
-------------------------------------
This describes actually four hooks:
* ``octoprint.comm.protocol.gcode.queuing``
* ``octoprint.comm.protocol.gcode.queued``
* ``octoprint.comm.protocol.gcode.sending``
* ``octoprint.comm.protocol.gcode.sent``
.. py:function:: hook(comm_instance, phase, cmd, cmd_type, gcode, *args, **kwargs)
Pre- and postprocess commands as they progress through the various phases of being sent to the printer. The phases
are the following:
* ``queuing``: This phase is triggered just before the command is added to the send queue of the communication layer. This
corresponds to the moment a command is being read from a file that is currently being printed. Handlers
may suppress or change commands or their command type here.
* ``queued``: This phase is triggered just after the command was added to the send queue of the communication layer.
No manipulation is possible here anymore (returned values will be ignored).
* ``sending``: This phase is triggered just before the command is actually being sent to the printer. Right afterwards
a line number will be assigned and the command will be sent. Handlers may suppress or change commands here. The
command type is not taken into account anymore.
* ``sent``: This phase is triggered just after the command was handed over to the serial connection to the printer.
No manipulation is possible here anymore (returned values will be ignored). A command that reaches the sent phase
must not necessarily have reached the printer yet and it might also still run into communication problems and a
resend might be triggered for it.
Hook handlers may use this to rewrite or completely suppress certain commands before they enter the send queue of
the communication layer or before they are actually sent over the serial port, or to react to the queuing or sending
of commands after the fact. The hook handler will be called with the processing ``phase``, the ``cmd`` to be sent to
the printer as well as the ``cmd_type`` parameter used for enqueuing (OctoPrint will make sure that the send queue
will never contain more than one line with the same ``cmd_type``) and the detected gcode command (if it is one).
Defining a ``cmd_type`` other than None will make sure OctoPrint takes care of only having one command of that type
in its sending queue. Predefined types are ``temperature_poll`` for temperature polling via ``M105`` and
``sd_status_poll`` for polling the SD printing status via ``M27``.
``phase`` will always match the ``<phase>`` part of the implemented hook (e.g. ``octoprint.comm.protocol.gcode.queued``
handlers will always be called with ``phase`` set to ``queued``). This parameter is provided so that plugins may
utilize the same hook for mulitple phases if required.
Handlers are expected to return one of the following result variants:
* ``None``: Don't change anything. Note that Python functions will also automatically return ``None`` if
an empty ``return`` statement is used or just nothing is returned explicitely from the handler. Hence, the following
examples are all falling into this category:
.. code-block:: python
def one(*args, **kwargs):
print("I return None explicitly")
return None
def two(*args, **kwargs):
print("I just return without any values")
return
def three(*args, **kwargs):
print("I don't explicitly return anything at all")
Handlers which do not wish to modify (or suppress) ``cmd`` or ``cmd_type`` at all should use this option.
* A string with the rewritten version of the ``cmd``, e.g. ``return "M110"``. To avoid situations which will be
difficult to debug should the returned command be later changed to ``None`` (with the intent to suppress the
command instead but actually causing ``cmd`` and ``cmd_type`` to just staying as-is), this variant should be
entirely avoided by handlers.
* A 1-tuple consisting of a rewritten version of the ``cmd``, e.g. ``return "M110",``, or ``None`` in order to
suppress the command, e.g. ``return None,``. Handlers which wish to rewrite the command or to suppress it completely
should use this option.
* A 2-tuple consisting of a rewritten version of the ``cmd`` and the ``cmd_type``, e.g. ``return "M105", "temperature_poll"``.
Handlers which wish to rewrite both the command and the command type should use this option.
**Example**
The following hook handler replaces all ``M107`` ("Fan Off", deprecated) with an ``M106 S0`` ("Fan On" with speed
parameter) upon queuing and logs all sent ``M106``.
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/rewrite_m107.py
:linenos:
:tab-width: 4
:caption: `rewrite_m107.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/rewrite_m107.py>`_
:param object comm_instance: The :class:`~octoprint.util.comm.MachineCom` instance which triggered the hook.
:param str phase: The current phase in the command progression, either ``queuing``, ``queued``, ``sending`` or
``sent``. Will always match the ``<phase>`` of the hook.
:param str cmd: The GCODE command for which the hook was triggered. This is the full command as taken either
from the currently streamed GCODE file or via other means (e.g. user input our status polling).
:param str cmd_type: Type of command, e.g. ``temperature_poll`` for temperature polling or ``sd_status_poll`` for SD
printing status polling.
:param str gcode: Parsed GCODE command, e.g. ``G0`` or ``M110``, may also be None if no known command could be parsed
:return: None, 1-tuple, 2-tuple or string, see the description above for details.
.. _sec-plugins-hook-comm-protocol-scripts:
octoprint.comm.protocol.scripts
-------------------------------
.. py:function:: hook(comm_instance, script_type, script_name, *args, **kwargs)
Return a prefix to prepend and a postfix to append 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.
If the hook handler has something to add to the specified script, it may return a 2-tuple, with the first entry
defining the prefix (what to *prepend* to the script in question) and the last entry defining the postfix (what to
*append* to the script in question). Both prefix and postfix can be None to signify that nothing should be prepended
respectively appended.
The returned entries may be either iterables of script lines or a string including newlines of the script lines (which
will be split by the caller if necessary).
**Example:**
Appends an ``M117 OctoPrint connected`` to the configured ``afterPrinterConnected`` GCODE script.
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/message_on_connect.py
:linenos:
:tab-width: 4
:caption: `message_on_connect.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/message_on_connect.py>`_
:param MachineCom comm_instance: The :class:`~octoprint.util.comm.MachineCom` instance which triggered the hook.
:param str script_type: The type of the script for which the hook was called, currently only "gcode" is supported here.
:param str script_name: The name of the script for which the hook was called.
:return: A 2-tuple in the form ``(prefix, postfix)`` or None
:rtype: tuple or None
.. _sec-plugins-hook-comm-transport-serial-factory:
octoprint.comm.transport.serial.factory
---------------------------------------
.. py:function:: hook(comm_instance, port, baudrate, read_timeout, *args, **kwargs)
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``.
If the hook handler needs to perform state switches (e.g. for autodetection) or other operations on the
:class:`~octoprint.util.comm.MachineCom` instance, it can use the supplied ``comm_instance`` to do so. Plugin
authors should keep in mind however that due to a pending change in the communication layer of
OctoPrint, that interface will change in the future. Authors are advised to follow OctoPrint's development
closely if directly utilizing :class:`~octoprint.util.comm.MachineCom` functionality.
A valid serial instance is expected to provide the following methods, analogue to PySerial's
`serial.Serial <https://pythonhosted.org//pyserial/pyserial_api.html#serial.Serial>`_:
readline(size=None, eol='\n')
Reads a line from the serial connection, compare `serial.Filelike.readline <https://pythonhosted.org//pyserial/pyserial_api.html#serial.FileLike.readline>`_.
write(data)
Writes data to the serial connection, compare `serial.Filelike.write <https://pythonhosted.org//pyserial/pyserial_api.html#serial.FileLike.write>`_.
close()
Closes the serial connection, compare `serial.Serial.close <https://pythonhosted.org//pyserial/pyserial_api.html#serial.Serial.close>`_.
Additionally setting the following attributes need to be supported if baudrate detection is supposed to work:
baudrate
An integer describing the baudrate to use for the serial connection, compare `serial.Serial.baudrate <https://pythonhosted.org//pyserial/pyserial_api.html#serial.Serial.baudrate>`_.
timeout
An integer describing the read timeout on the serial connection, compare `serial.Serial.timeout <https://pythonhosted.org//pyserial/pyserial_api.html#serial.Serial.timeout>`_.
**Example:**
Serial factory similar to the default one which performs auto detection of the serial port if ``port`` is ``None``
or ``AUTO``.
.. code-block:: python
:linenos:
def default(comm_instance, port, baudrate, connection_timeout):
if port is None or port == 'AUTO':
# no known port, try auto detection
comm_instance._changeState(comm_instance.STATE_DETECT_SERIAL)
serial_obj = comm_instance._detectPort(False)
if serial_obj is None:
comm_instance._log("Failed to autodetect serial port")
comm_instance._errorValue = 'Failed to autodetect serial port.'
comm_instance._changeState(comm_instance.STATE_ERROR)
eventManager().fire(Events.ERROR, {"error": comm_instance.getErrorString()})
return None
else:
# connect to regular serial port
comm_instance._log("Connecting to: %s" % port)
if baudrate == 0:
serial_obj = serial.Serial(str(port), 115200, timeout=connection_timeout, writeTimeout=10000, parity=serial.PARITY_ODD)
else:
serial_obj = serial.Serial(str(port), baudrate, timeout=connection_timeout, writeTimeout=10000, parity=serial.PARITY_ODD)
serial_obj.close()
serial_obj.parity = serial.PARITY_NONE
serial_obj.open()
return serial_obj
:param MachineCom comm_instance: The :class:`~octoprint.util.comm.MachineCom` instance which triggered the hook.
:param str port: The port for which to construct a serial instance. May be ``None`` or ``AUTO`` in which case port
auto detection is to be performed.
:param int baudrate: The baudrate for which to construct a serial instance. May be 0 in which case baudrate auto
detection is to be performed.
:param int read_timeout: The read timeout to set on the serial port.
:return: The constructed serial object ready for use, or ``None`` if the handler could not construct the object.
:rtype: A serial instance implementing implementing the methods ``readline(...)``, ``write(...)``, ``close()`` and
optionally ``baudrate`` and ``timeout`` attributes as described above.
.. _sec-plugins-hook-filemanager-extensiontree:
octoprint.filemanager.extension_tree
------------------------------------
.. py:function:: hook(*args, **kwargs)
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
``machinecode`` or ``model`` types.
**Example:**
The following handler would add a new file type "x3g" as accepted ``machinecode`` format, with extensions ``x3g``
and ``s3g``:
.. code-block:: python
:linenos:
def support_x3g_machinecode(*args, **kwargs):
return dict(
machinecode=dict(
x3g=["x3g", "s3g"]
)
)
.. note::
This will only add the supplied extensions to the extension tree, allowing the files to be uploaded and managed
through the file manager. Plugins will need to add further steps to ensure that the files will be processable
in the rest of the system (e.g. handling/preprocessing new machine code file types for printing etc)!
:return: The partial extension tree to merge with the full extension tree.
:rtype: dict
.. _sec-plugins-hook-filemanager-preprocessor:
octoprint.filemanager.preprocessor
----------------------------------
.. py:function:: hook(path, file_object, links=None, printer_profile=None, allow_overwrite=False, *args, **kwargs)
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
:attr:`~octoprint.filemanager.util.AbstractFileWrapper.filename`.
``file_object`` will be a subclass of :class:`~octoprint.filemanager.util.AbstractFileWrapper`. Handlers may
access the raw data of the file via :func:`~octoprint.filemanager.util.AbstractFileWrapper.stream`, e.g.
to wrap it further. Handlers which do not wish to handle the `file_object`
**Example**
The following plugin example strips all comments from uploaded/generated GCODE files ending on the name postfix ``_strip``.
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/strip_all_comments.py
:linenos:
:tab-width: 4
:caption: `strip_all_comments.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/strip_all_comments.py>`_
:param str path: The path on storage the `file_object` is to be stored
:param AbstractFileWrapper file_object: The :class:`~octoprint.filemanager.util.AbstractFileWrapper` instance
representing the file object to store.
:param dict links: The links that are going to be stored with the file.
:param dict printer_profile: The printer profile associated with the file.
:param boolean allow_overwrite: Whether to allow overwriting an existing file named the same or not.
:return: The `file_object` as passed in or None, or a replaced version to use instead for further processing.
:rtype: AbstractFileWrapper or None
.. _sec-plugins-hook-server-http-bodysize:
octoprint.server.http.bodysize
------------------------------
.. py:function:: hook(current_max_body_sizes, *args, **kwargs)
Allows extending the list of custom maximum body sizes on the web server per path and HTTP method with custom entries
from plugins.
Your plugin might need this if you want to allow uploading files larger than 100KB (the default maximum upload size
for anything but the ``/api/files`` endpoint).
``current_max_body_sizes`` will be a (read-only) list of the currently configured maximum body sizes, in case you
want to check from your plugin if you need to even add a new entry.
The hook must return a list of 3-tuples (the list's length can be 0). Each 3-tuple should have the HTTP method
against which to match as first, a regular expression for the path to match against and the maximum body size as
an integer as the third entry.
The path of the route will be prefixed by OctoPrint with ``/plugin/<plugin identifier>/`` (if the path already begins
with a ``/`` that will be stripped first).
**Example**
The following plugin example sets the maximum body size for ``POST`` requests against four custom URLs to 100, 200,
500 and 1024KB. To test its functionality try uploading files larger or smaller than an endpoint's configured maximum
size (as multipart request with the file upload residing in request parameter ``file``) and observe the behaviour.
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/increase_bodysize.py
:linenos:
:tab-width: 4
:caption: `increase_bodysize.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/increase_bodysize.py>`_
:param list current_max_body_sizes: read-only list of the currently configured maximum body sizes
:return: A list of 3-tuples with additional request specific maximum body sizes as defined above
:rtype: list
.. _sec-plugins-hook-server-http-routes:
octoprint.server.http.routes
----------------------------
.. py:function:: hook(server_routes, *args, **kwargs)
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
following the same path structure as regular downloads.
``server_routes`` will be a (read-only) list of the currently defined server routes, in case you want to check from
your plugin against that.
The hook must return a list of 3-tuples (the list's length can be 0). Each 3-tuple should have the path of the route
(a string defining its regular expression) as the first, the `RequestHandler <http://tornado.readthedocs.org/en/branch4.0/web.html#request-handlers>`_
class to use for the route as the second and a dictionary with keywords parameters for the defined request handler as
the third entry.
The path of the route will be prefixed by OctoPrint with ``/plugin/<plugin identifier>/`` (if the path already begins
with a ``/`` that will be stripped first).
.. note::
Static routes provided through this hook take precedence over routes defined through blueprints.
If your plugin also implements the :class:`~octoprint.plugin.BlueprintPlugin` mixin and has defined a route for a
view on that which matches one of the paths provided via its ``octoprint.server.http.routes`` hook handler, the
view of the blueprint will thus not be reachable since processing of the request will directly be handed over
to your defined handler class.
**Example**
The following example registers two new routes ``/plugin/add_tornado_route/download`` and ``/plugin/add_tornado_route/forward``
in the webserver which roughly replicate the functionality of ``/downloads/files/local`` and ``/downloads/camera/current``.
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/add_tornado_route.py
:linenos:
:tab-width: 4
:caption: `add_tornado_route.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/add_tornado_route.py>`_
.. seealso::
:class:`~octoprint.server.util.tornado.LargeResponseHandler`
Customized `tornado.web.StaticFileHandler <http://tornado.readthedocs.org/en/branch4.0/web.html#tornado.web.StaticFileHandler>`_
that allows delivery of the requested resource as attachment and access validation through an optional callback.
:class:`~octoprint.server.util.tornado.UrlForwardHandler`
`tornado.web.RequestHandler <http://tornado.readthedocs.org/en/branch4.0/web.html#request-handlers>`_ that proxies
requests to a preconfigured url and returns the response.
:param list server_routes: read-only list of the currently configured server routes
:return: a list of 3-tuples with additional routes as defined above
:rtype: list
.. _sec-plugins-hook-ui-web-templatetypes:
octoprint.ui.web.templatetypes
------------------------------
.. py:function:: hook(template_sorting, template_rules, *args, **kwargs)
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.
The first entry of the tuple must be the name of the template type and will be automatically prefixed with
``plugin_<identifier>_``.
The second entry must be a sorting specification that defines how OctoPrint should sort multiple templates injected
through plugins of this template type. The sorting specification should be a dict with the following possible
entries:
.. list-table::
:widths: 5 95
* - **Key**
- **Description**
* - key
- The sorting key within the template config to use for sorting the list of template injections. This may be
``None`` in which case no sorting will be taking place. Defaults to ``name``.
* - add
- Usually irrelevant for custom template types, only listed for the sake of completeness. The method of adding
the sorted list of template injections from plugins to the template injections from the
core. May be ``append`` to append the list, ``prepend`` to prepend the list, or ``custom_append`` or
``custom_prepend`` to append respectively prepend but going so after preprocessing the entries and order data
with custom functions (e.g. to inject additional entries such as the "Plugins" section header in the settings
dialog). For custom template types this defaults to ``append``.
* - custom_add_entries
- Usually irrelevant for custom template types, only listed for the sake of completeness. Custom preprocessor
for the entries provided through plugins, before they are added to the general template entries
context variable for the current template type.
* - custom_add_order
- Usually irrelevant for custom template types, only listed for the sake of completeness. Custom preprocessor
for the template order provided through plugins, before they are added to the general template order
context variable for the current template type.
The third entry must be a rule specification in form of a dict which tells OctoPrint how to process the template
configuration entries provided by :func:`~octoprint.plugin.TemplatePlugin.get_template_configs` by providing
transformation functions of various kinds:
.. list-table::
:widths: 5 95
* - **Key**
- **Description**
* - div
- Function that returns the id of the container for template content if not explicitely provided by the template
config, input parameter is the name of the plugin providing the currently processed template config. If not
provided this defaults to a lambda function of the form ``lambda x: "<plugin identifier>_<template type>_plugin_" + x``
with ``plugin identifier`` being the identifier of the plugin providing the additional template type.
* - template
- Function that returns the default template filename for a template type to attempt to include in case no
template name is explicitly provided by the template config, input parameter is the name of the plugin provifing
the current processed template config. If not provided this defaults to a lambda function of the form
``lambda x: x + "_plugin_<plugin identifier>_<template type>.jinja2"`` with ``plugin identifier`` being the
identifier of the plugin providing the additional template type.
* - to_entry
- Function to transform a template config to the data structure stored in the Jinja context for the injected
template. If not provided this defaults to a lambda function returning a 2-tuple of the ``name`` value of
the template config and the template config itself (``lambda data: (data["name"], data)``)
* - mandatory
- A list of keys that must be included in the template config for this template type. Template configs not containing
all of the keys in this list will be ignored. Defaults to an empty list.
OctoPrint will provide all template configs for custom template types in the Jinja rendering context in the same way
as it provides the template configs for core template types, through the ``templates`` context variable which is a
dict mapping from the template type name (``plugin_<plugin identifier>_<template type>`` for custom ones) to a dict
with ``entries`` and ``order`` values, the first containing a dict of all registered template configs, the latter
an ordered list of all registered template keys of the type in the order they should be rendered. Plugins should
iterate over the ``order`` list and then render each entry utilizing the template entry as provided for the key in
the ``entries`` dict (note that this entry will have the format specified through the ``to_entry`` section in the
template rule).
**Example**
The example consists of two plugins, one providing a custom template type and the other consuming it.
First the provider:
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/custom_template_provider/__init__.py
:linenos:
:tab-width: 4
:caption: `custom_template_provider/__init__.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/custom_template_provider/__init__.py>`_
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/custom_template_provider/templates/custom_template_provider_settings.jinja2
:linenos:
:tab-width: 4
:caption: `custom_template_provider/templates/custom_template_provider_settings.jinja2 <https://github.com/OctoPrint/Plugin-Examples/blob/master/custom_template_provider/templates/custom_template_provider_settings.jinja2>`_
Then the consumer:
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/custom_template_consumer/__init__.py
:linenos:
:tab-width: 4
:caption: `custom_template_consumer/__init__.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/custom_template_consumer/__init__.py>`_
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/custom_template_consumer/templates/custom_template_consumer_awesometemplate.jinja2
:linenos:
:tab-width: 4
:caption: `custom_template_consumer/templates/custom_template_consumer_awesometemplate.jinja2 <https://github.com/OctoPrint/Plugin-Examples/blob/master/custom_template_consumer/templates/custom_template_consumer_awesometemplate.jinja2>`_
:param dict template_rules: read-only dictionary of currently configured template rules
:param dict template_sorting: read-only dictionary of currentl configured template sorting specifications
:return: a list of 3-tuples (template type, rule, sorting spec)
:rtype: list
+9 -54
View File
@@ -1,60 +1,15 @@
.. _sec-plugins:
#####################
Plugins Documentation
#####################
Starting with OctoPrint 1.2.0, there's now a plugin system in place which allows to individually
extend OctoPrint's functionality.
Right now plugins can be used to extend OctoPrint's settings dialog, to execute specific tasks on server startup and
shutdown, to provide custom (API) endpoints with special functionality, to react on system events or to add support for
additional slicers. More plugin types are planned for the future.
.. _sec-plugins-installation:
Installing Plugins
==================
Plugins can be installed either by unpacking them into one of the configured plugin folders (regularly those are
``<octoprint-root>/plugins`` and ``~/.octoprint/plugins`` or by installing them as regular python modules via ``pip``.
Please refer to the documentation of the plugin for installations instructions.
The latter is the more common case since all currently published plugins not bundled with OctoPrint can and should be installed
this way.
For a plugin available on the Python Package Index (PyPi), the process is as simple as issuing a
.. code-block:: bash
pip install <plugin_name>
For plugins not available on PyPi, you'll have to give ``pip`` an URL from which to install the package (e.g. the URL to
a ZIP file of the current master branch of a Github repository hosting a plugin, or even a ``git+https`` URL), example:
.. code-block:: bash
pip install https://github.com/OctoPrint/OctoPrint-Growl/archive/master.zip
See `the pip install documentation <http://pip.readthedocs.org/en/latest/reference/pip_install.html>`_ for what URL
types are possible.
.. _sec-plugins-available:
Available Plugins
=================
Currently there's no such thing as a centralized plugin repository for available plugins.
Plugins may be found in the lists provided in `the OctoPrint wiki <https://github.com/foosel/OctoPrint/wiki#plugins>`_
and on the `OctoPrint organization Github page <https://github.com/OctoPrint>`_.
##################
Developing Plugins
==================
Please see the following sub topics for information on how to develop your own OctoPrint plugins.
##################
.. toctree::
:maxdepth: 2
:maxdepth: 3
developing.rst
gettingstarted.rst
concepts.rst
distributing.rst
mixins.rst
hooks.rst
viewmodels.rst
+93
View File
@@ -0,0 +1,93 @@
.. _sec-plugins-mixins:
Available plugin mixins
=======================
The following plugin mixins are currently available:
.. contents::
:local:
Please note that all plugin mixins inherit from :class:`~octoprint.plugin.core.Plugin` and
:class:`~octoprint.plugin.types.OctoPrintPlugin`, which also provide attributes of interest to plugin developers.
.. _sec-plugins-mixins-startupplugin:
StartupPlugin
-------------
.. autoclass:: octoprint.plugin.StartupPlugin
:members:
.. _sec-plugins-mixins-shutdownplugin:
ShutdownPlugin
--------------
.. autoclass:: octoprint.plugin.ShutdownPlugin
:members:
.. _sec-plugins-mixins-settingsplugin:
SettingsPlugin
--------------
.. autoclass:: octoprint.plugin.SettingsPlugin
:members:
.. _sec-plugins-mixins-assetplugin:
AssetPlugin
-----------
.. autoclass:: octoprint.plugin.AssetPlugin
:members:
.. _sec-plugins-mixins-templateplugin:
TemplatePlugin
--------------
.. autoclass:: octoprint.plugin.TemplatePlugin
:members:
.. _sec-plugins-mixins-simpleapiplugin:
SimpleApiPlugin
---------------
.. autoclass:: octoprint.plugin.SimpleApiPlugin
:members:
.. _sec-plugins-mixins-blueprintplugin:
BlueprintPlugin
---------------
.. autoclass:: octoprint.plugin.BlueprintPlugin
:members:
.. _sec-plugins-mixins-eventhandlerplugin:
EventHandlerPlugin
------------------
.. autoclass:: octoprint.plugin.EventHandlerPlugin
:members:
.. _sec-plugins-mixins-progressplugin:
ProgressPlugin
--------------
.. autoclass:: octoprint.plugin.ProgressPlugin
:members:
.. _sec-plugins-mixins-slicerplugin:
SlicerPlugin
------------
.. autoclass:: octoprint.plugin.SlicerPlugin
:members:
+224
View File
@@ -0,0 +1,224 @@
.. _sec-plugins-viewmodels:
Viewmodels
==========
.. contents::
:local:
When implementing frontend components, you'll sooner or later want to define your own `KnockoutJS viewmodels <http://knockoutjs.com/>`_
in order to provide custom functionality.
.. _sec-plugins-viewmodels-registering:
Registering custom viewmodels
-----------------------------
Register your viewmodel with OctoPrint's web app by pushing a 3-tuple consisting of your viewmodel's class, a list
of all required dependencies to be injected into the constructor and a list of all elements to bind the viewmodel to.
Example:
.. code-block:: javascript
$(function() {
function MyCustomViewModel(parameters) {
var self = this;
self.loginState = parameters[0]; // requested as first constructor parameter below
// more of your viewmodel's implementation
}
OCTOPRINT_VIEWMODELS.push([
MyCustomViewModel,
["loginStateViewModel"],
["#some_div", "#some_other_div"]
]);
})
.. note::
Each provided binding target may be either a string which will then be passed to jQuery's ``$(...)`` method to resolve
the target, or alternatively directly a jQuery element.
.. _sec-plugins-viewmodels-dependencies:
Dependencies
------------
OctoPrint will try to inject all viewmodel dependencies requested by your viewmodel. In order to do this it will
perform multiple passes iterating over all registered viewmodels and collecting the necessary depedencies prior to
construction. Circular depedencies (A dependens on B, B on C, C on A) naturally cannot be resolved and will cause an
error to be logged to the Javascript console.
OctoPrint's core currently comes with the following viewmodels that your plugin can request for injection:
appearanceViewModel
Viewmodel that holds the appearance settings (name, color and transparency flag).
connectionViewModel
Viewmodel for the connection sidebar entry.
controlViewModel
Viewmodel for the control tab.
gcodeFilesViewModel
Viewmodel for the files sidebar entry.
firstRunViewModel
Viewmodel for the first run dialog.
gcodeViewModel
Viewmodel for the gcode viewer tab.
logViewModel
Viewmodel for the logfile settings dialog.
loginStateViewModel
Viewmodel for the current loginstate of the user, very interesting for plugins that need to
evaluate the current login state or information about the current user, e.g. associated roles.
navigationViewModel
Viewmodel for the navigation bar.
printerProfilesViewModel
Viewmodel for the printer profiles settings dialog.
printerStateViewModel
Viewmodel for the current printer state, very intersting for plugins that need
to know information about the current print job, if the printer is connected, operational etc.
settingsViewModel
Viewmodel for the settings dialog, also holds all settings to be used by other viewmodels, hence
very interesting for plugins as well.
slicingViewModel
Viewmodel for the slicing dialog.
temperatureViewModel
Viewmodel for the temperature tab, also holds current temperature information which
might be interesting for plugins.
terminalViewModel
Viewmodel for the terminal tab, also holds terminal log entries.
timelapseViewModel
Viewmodel for the timelapse tab.
usersViewModel
Viewmodel for the user management in the settings dialog.
userSettingsViewModel
Viewmodel for settings associated with the currently logged in user, used for
the user settings dialog.
Additionally each plugin's viewmodel will be added to the viewmodel map used for resolving dependencies as well, using
the viewmodel's class name with a lower case first character as identifier (so "MyCustomViewModel" will be registered
for dependency injection as "myCustomViewModel").
.. _sec-plugins-viewmodels-callbacks:
Callbacks
---------
OctoPrint's web application will call several callbacks on all registered viewmodels, provided they implement them.
Those are listed below:
onStartup()
Called when the first initialization has been done: All viewmodels are constructed and hence their dependencies
resolved, no bindings have been done yet.
onBeforeBinding()
Called per viewmodel before attempting to bind it to its binding targets.
onAfterBinding()
Called per viewmodel after binding it to its binding targets.
onAllBound(allViewModels)
Called after all viewmodels have been bound, with the list of all viewmodels as the single parameter.
onStartupComplete()
Called after the startup of the web app has been completed.
onServerDisconnect()
Called if a disconnect from the server is detected.
onDataUpdaterReconnect()
Called when the connection to the server has been reestablished after a disconnect.
fromHistoryData(data)
Called when history data is received from the server. Usually that happens only after initial connect in order to
transmit the temperature and terminal log history to the connecting client. Called with the ``data`` as single parameter.
fromCurrentData(data)
Called when current printer status data is received from the server with the ``data`` as single parameter.
onSlicingProgress(slicer, modelPath, machineCodePath, progress)
Called on slicing progress, call rate is once per percentage point of the progress at maximum.
onEvent<EventName>(payload)
Called on firing of an event of type ``EventName``, e.g. ``onEventPrintDone``. See :ref:`the list of available events <sec-events-available_events>`
for the possible events and their payloads.
fromTimelapseData(data)
Called when timelapse configuration data is received from the server. Usually that happens after initial connect.
onDataUpdaterPluginMessage(plugin, message)
Called when a plugin message is pushed from the server with the identifier of the calling plugin as first
and the actual message as the second parameter. Note that the latter might be a full fledged object, depending
on the plugin sending the message. You can use this method to asynchronously push data from your plugin's server
component to it's frontend component.
onUserLoggedIn(user)
Called when a user gets logged into the web app, either passively (upon initial load of the page due to a valid
"Remember Me" cookie) or due to an active completion of the login dialog. The user data of the just logged in user
will be provided as only parameter.
onUserLoggedOut()
Called when a user gets logged out of the web app.
onTabChange(current, previous)
Called before the main tab view switches to a new tab, so `before` the new tab becomes visible. Called with the
current and previous tab's hash (e.g. ``#control``).
onAfterTabChange
Called after the main tab view switches to a new tab, so `after` the new tab becomes visible. Called with the
current and previous tab's hash (e.g. ``#control``).
getAdditionalControls
Your viewmodel may return additional custom control definitions for inclusion on the "Control" tab of OctoPrint's
interface. See :ref:`the custom control feature<sec-features-custom_controls>`.
onSettingsShown
Called when the settings dialog is shown.
onSettingsHidden
Called when the settings dialog is hidden.
onSettingsBeforeSave
Called just before the settings viewmodel is sent to the server. This is useful, for example, if your plugin
needs to compute persisted settings from a custom viewmodel.
onUserSettingsShown
Called when the user settings dialog is shown.
onUserSettingsHidden
Called when the user settings dialog is hidden.
In order to hook into any of those callbacks, just have your viewmodel define a function named accordingly, e.g.
to get called after all viewmodels have been bound during application startup, implement a function ``onAllBound``
on your viewmodel, taking a list of all bound viewmodels:
.. code-block:: javascript
$(function() {
function MyCustomViewModel(parameters) {
var self = this;
// ...
self.onAllBound = function(allViewModels) {
// do something with them
}
// ...
}
OCTOPRINT_VIEWMODELS.push([
MyCustomViewModel,
["loginStateViewModel"],
["#some_div", "#some_other_div"]
]);
})
.. seealso::
`OctoPrint's core viewmodels <https://github.com/foosel/OctoPrint/tree/devel/src/octoprint/static/js/app/viewmodels>`_
OctoPrint's own viewmodels use the same mechanisms for interacting with each other and the web application as
plugins. Their sourcecode is therefore a good point of reference on how to achieve certain things.
`KnockoutJS documentation <http://knockoutjs.com/documentation/introduction.html>`_
OctoPrint makes heavy use of KnockoutJS for building up its web app.
-2
View File
@@ -1,2 +0,0 @@
sphinxcontrib-httpdomain
sphinx_rtd_theme
+258
View File
@@ -0,0 +1,258 @@
# coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'The MIT License <http://opensource.org/licenses/MIT>'
__copyright__ = "Copyright (C) 2015 Gina Häußge - Released under terms of the MIT License"
from sphinx.directives.code import CodeBlock
import sphinx.highlighting
from sphinx.highlighting import PygmentsBridge
from sphinx.ext import doctest
from sphinx.util.texescape import tex_hl_escape_map_new
from docutils.nodes import General, FixedTextElement, literal_block, container
from docutils.parsers.rst import directives
from six import text_type
from pygments import highlight
from pygments.filters import VisibleWhitespaceFilter, ErrorToken
from pygments.lexers.python import PythonConsoleLexer
from pygments.util import ClassNotFound
def _merge_dict(a, b):
"""
Little helper to merge two dicts a and b on the fly.
"""
result = dict(a)
result.update(b)
return result
class literal_block_ext(General, FixedTextElement):
"""
Custom node which is basically the same as a :class:`literal_block`, just with whitespace support and introduced
in order to be able to have a custom visitor.
"""
@classmethod
def from_literal_block(cls, block):
"""
Factory method constructing an instance exactly copying all attributes over from ``block`` and settings a
custom ``tagname``.
"""
new = literal_block_ext()
for a in ("attributes", "basic_attributes", "child_text_separator", "children", "document", "known_attributes",
"line", "list_attributes", "local_attributes", "parent", "rawsource", "source"):
setattr(new, a, getattr(block, a))
new.tagname = "literal_block_ext"
return new
class CodeBlockExt(CodeBlock):
"""
This is basically an extension of a regular :class:`CodeBlock` directive which just supports an additional option
``whitespace`` which if present will enable (together with everything else in here) to render whitespace in
code blocks.
"""
option_spec = _merge_dict(CodeBlock.option_spec, dict(whitespace=directives.flag))
def run(self):
# get result from parent implementation
code_block = CodeBlock.run(self)
def find_and_wrap_literal_block(node):
"""
Recursive method to turn all literal blocks located within a node into :class:`literal_block_ext`.
"""
if isinstance(node, container):
# container node => handle all children
children = []
for child in node.children:
children.append(find_and_wrap_literal_block(child))
node.children = children
return node
elif isinstance(node, literal_block):
# literal block => replace it
return self._wrap_literal_block(node)
else:
# no idea what that is => leave it alone
return node
# replace all created literal_blocks with literal_block_ext instances
return map(find_and_wrap_literal_block, code_block)
def _wrap_literal_block(self, node):
literal = literal_block_ext.from_literal_block(node)
literal["whitespace"] = "whitespace" in self.options
return literal
class PygmentsBridgeExt(object):
"""
Wrapper for :class:`PygmentsBridge`, delegates everything to the wrapped ``bridge`` but :method:`highlight_block`,
which calls the parent implementation for lexer selection, then
"""
def __init__(self, bridge, whitespace):
self._bridge = bridge
self._whitespace = whitespace
def __getattr__(self, item):
return getattr(self._bridge, item)
def highlight_block(self, source, lang, opts=None, warn=None, force=False, **kwargs):
if not self._whitespace:
return self._bridge.highlight_block(source, lang, opts=opts, warn=warn, force=force, **kwargs)
# We are still here => we need to basically do everything the parent implementation does (and does so in a very
# unextensible way...), but inject the whitespace filter into the used lexer just before the highlighting run
# and remove it afterwards so the lexer can be safely reused.
#
# For this we define a context manager that will allow us to wrap a lexer and modify its filters on the fly to
# include the whitespace filter.
class whitespace(object):
def __init__(self, lexer):
self._lexer = lexer
self._orig_filters = lexer.filters
self._orig_tabsize = lexer.tabsize
def __enter__(self):
new_filters = list(self._orig_filters)
new_filters.append(VisibleWhitespaceFilter(spaces=True, tabs=True, tabsize=self._lexer.tabsize))
self._lexer.filters = new_filters
self._lexer.tabsize = 0
return self._lexer
def __exit__(self, type, value, traceback):
self._lexer.filters = self._orig_filters
self._lexer.tabsize = self._orig_tabsize
# Then a ton of copy-pasted code follows. Sadly, we need to do this since we have no way to inject ourselves
# into the highlighting call otherwise - lexer selection and actual call are tightly coupled in the original
# "highlight_block" method, with no means for external code to inject different functionality.
#
# Unless otherwise marked ("MODIFIED"), any code in this method after this line is copied verbatim from the
# implementation of sphinx.highlighting.PygmentsBridge, released under the Simplified BSD License, the copyright
# lies with the respective authors.
if not isinstance(source, text_type):
source = source.decode()
# find out which lexer to use
if lang in ('py', 'python'):
if source.startswith('>>>'):
# interactive session
lexer = sphinx.highlighting.lexers['pycon']
elif not force:
# maybe Python -- try parsing it
if self.try_parse(source):
lexer = sphinx.highlighting.lexers['python']
else:
lexer = sphinx.highlighting.lexers['none']
else:
lexer = sphinx.highlighting.lexers['python']
elif lang in ('python3', 'py3') and source.startswith('>>>'):
# for py3, recognize interactive sessions, but do not try parsing...
lexer = sphinx.highlighting.lexers['pycon3']
elif lang == 'guess':
try:
lexer = sphinx.highlighting.guess_lexer(source)
except Exception:
lexer = sphinx.highlighting.lexers['none']
else:
if lang in sphinx.highlighting.lexers:
lexer = sphinx.highlighting.lexers[lang]
else:
try:
lexer = sphinx.highlighting.lexers[lang] = sphinx.highlighting.get_lexer_by_name(lang, **opts or {})
except ClassNotFound:
if warn:
warn('Pygments lexer name %r is not known' % lang)
lexer = sphinx.highlighting.lexers['none']
else:
raise
else:
lexer.add_filter('raiseonerror')
if not isinstance(source, text_type):
source = source.decode()
# trim doctest options if wanted
if isinstance(lexer, PythonConsoleLexer) and self._bridge.trim_doctest_flags:
source = doctest.blankline_re.sub('', source)
source = doctest.doctestopt_re.sub('', source)
# highlight via Pygments
formatter = self._bridge.get_formatter(**kwargs)
try:
# MODIFIED: replaced by whitespace wrapped call
with whitespace(lexer) as l:
hlsource = highlight(source, l, formatter)
# /MODIFIED
except ErrorToken:
# this is most probably not the selected language,
# so let it pass unhighlighted
# MODIFIED: replaced by whitespace wrapped call
with whitespace(sphinx.highlighting.lexers["none"]) as l:
hlsource = highlight(source, l, formatter)
# /MODIFIED
if self._bridge.dest == 'html':
return hlsource
else:
if not isinstance(hlsource, text_type): # Py2 / Pygments < 1.6
hlsource = hlsource.decode()
return hlsource.translate(tex_hl_escape_map_new)
class whitespace_highlighter(object):
"""
Context manager for adapting the used highlighter on a translator for a given node's whitespace properties.
"""
def __init__(self, translator, node):
self.translator = translator
self.node = node
self._orig_highlighter = self.translator.highlighter
def __enter__(self):
whitespace = self.node["whitespace"] if "whitespace" in self.node else False
if whitespace:
self.translator.highlighter = PygmentsBridgeExt(self._orig_highlighter, whitespace)
return self.translator
def __exit__(self, exc_type, exc_val, exc_tb):
self.translator.highlighter = self._orig_highlighter
def visit_literal_block_ext(translator, node):
"""
When our custom code block is visited, we temporarily exchange the highlighter used in the translator, call the
visitor for regular literal blocks, then switch back again.
"""
with whitespace_highlighter(translator, node):
translator.visit_literal_block(node)
def depart_literal_block_ext(translator, node):
"""
Just call the depart function for regular literal blocks.
"""
with whitespace_highlighter(translator, node):
translator.depart_literal_block(node)
def setup(app):
# custom directive
app.add_directive("code-block-ext", CodeBlockExt)
# custom node type
handler = (visit_literal_block_ext, depart_literal_block_ext)
app.add_node(literal_block_ext, html=handler, latex=handler, text=handler)
return dict(version="0.1")
+56
View File
@@ -0,0 +1,56 @@
# coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'The MIT License <http://opensource.org/licenses/MIT>'
__copyright__ = "Copyright (C) 2015 Gina Häußge - Released under terms of the MIT License"
import codecs
import urllib2
from sphinx.directives import LiteralInclude, dedent_lines
cache = dict()
class OnlineIncludeDirective(LiteralInclude):
def read_with_encoding(self, filename, document, codec_info, encoding):
global cache
f = None
try:
if not self.arguments[0] in cache:
f = codecs.StreamReaderWriter(urllib2.urlopen(self.arguments[0]), codec_info[2],
codec_info[3], 'strict')
lines = f.readlines()
cache[self.arguments[0]] = lines
else:
lines = cache[self.arguments[0]]
lines = dedent_lines(lines, self.options.get('dedent'))
return lines
except (IOError, OSError, urllib2.URLError):
return [document.reporter.warning(
'Include file %r not found or reading it failed' % self.arguments[0],
line=self.lineno)]
except UnicodeError:
return [document.reporter.warning(
'Encoding %r used for reading included file %r seems to '
'be wrong, try giving an :encoding: option' %
(encoding, self.arguments[0]))]
finally:
if f is not None:
f.close()
def visit_onlineinclude(translator, node):
translator.visit_literal_block(node)
def depart_onlineinclude(translator, node):
translator.depart_literal_block(node)
def setup(app):
app.add_directive("onlineinclude", OnlineIncludeDirective)
handler = (visit_onlineinclude, depart_onlineinclude)
app.add_node(OnlineIncludeDirective, html=handler, latex=handler, text=handler)
-15
View File
@@ -1,15 +0,0 @@
flask==0.9
werkzeug==0.8.3
tornado==3.0.2
sockjs-tornado>=1.0.0
PyYAML==3.10
Flask-Login==0.2.2
Flask-Principal==0.3.5
netaddr>=0.7.10
mock>=1.0.1
nose>=1.3.0
watchdog
sarge
sphinxcontrib-httpdomain
sphinx_rtd_theme
-5
View File
@@ -1,5 +0,0 @@
mock>=1.0.1
nose>=1.3.0
sphinxcontrib-httpdomain
sphinx_rtd_theme
po2json
+10 -15
View File
@@ -1,15 +1,10 @@
flask==0.9
werkzeug==0.8.3
tornado==4.0.1
sockjs-tornado>=1.0.0
PyYAML==3.10
Flask-Login==0.2.2
Flask-Principal==0.3.5
Flask-Babel==0.9
pyserial
netaddr
watchdog
sarge
netifaces
pylru
rsa
###
# This file is only here to make sure that something like
#
# pip install -e .[develop]
#
# works as expected. Requirements can be found in setup.py in the
# variables INSTALL_REQUIRES and EXTRA_REQUIRES.
###
.
+4
View File
@@ -15,5 +15,9 @@ DAEMON_ARGS="--port=$PORT"
# Umask of files octoprint generates, Change this to 000 if running octoprint as its own, separate user
UMASK=022
# Process priority, 0 here will result in a priority 20 process.
# -2 ensures Octoprint has a slight priority over user processes.
NICELEVEL=-2
# Should we run at startup?
START=yes
+2 -1
View File
@@ -73,7 +73,8 @@ do_start()
if [ $RETVAL != 0 ]; then
start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile \
--exec $DAEMON --chuid $OCTOPRINT_USER --user $OCTOPRINT_USER --umask $UMASK -- $DAEMON_ARGS
--exec $DAEMON --chuid $OCTOPRINT_USER --user $OCTOPRINT_USER --umask $UMASK --nicelevel=$NICELEVEL \
-- $DAEMON_ARGS
RETVAL="$?"
fi
}
+11
View File
@@ -0,0 +1,11 @@
[metadata]
description-file = README.md
[versioneer]
VCS = git
style = pep440-post
versionfile_source = src/octoprint/_version.py
versionfile_build = octoprint/_version.py
tag_prefix =
parentdir_prefix =
lookupfile = .versioneer-lookup
+126 -215
View File
@@ -1,232 +1,124 @@
# coding=utf-8
#!/usr/bin/env python
# coding=utf-8
import versioneer
versioneer.VCS = 'git'
versioneer.versionfile_source = 'src/octoprint/_version.py'
versioneer.versionfile_build = 'octoprint/_version.py'
versioneer.tag_prefix = ''
versioneer.parentdir_prefix = ''
versioneer.lookupfile = '.versioneer-lookup'
from setuptools import setup, find_packages, Command
from setuptools import setup, find_packages
from distutils.command.build_py import build_py as _build_py
import os
import shutil
import glob
import versioneer
I18N_MAPPING_FILE = "babel.cfg"
I18N_DOMAIN = "messages"
I18N_INPUT_DIRS = "."
I18N_OUTPUT_DIR_PY = os.path.join("src", "octoprint", "translations")
I18N_OUTPUT_DIR_JS = os.path.join("src", "octoprint", "static", "js", "i18n")
I18N_POT_FILE = os.path.join(I18N_OUTPUT_DIR_PY, "messages.pot")
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "src"))
import octoprint_setuptools
def package_data_dirs(source, sub_folders):
dirs = []
#-----------------------------------------------------------------------------------------------------------------------
for d in sub_folders:
for dirname, _, files in os.walk(os.path.join(source, d)):
dirname = os.path.relpath(dirname, source)
for f in files:
dirs.append(os.path.join(dirname, f))
# Requirements for our application
INSTALL_REQUIRES = [
"flask>=0.9,<0.11",
"werkzeug>=0.8.3,<0.9",
"tornado>=4.0.1,<4.1",
"sockjs-tornado>=1.0.1,<1.1",
"PyYAML>=3.10,<3.11",
"Flask-Login>=0.2.2,<0.3",
"Flask-Principal>=0.3.5,<0.4",
"Flask-Babel>=0.9,<0.10",
"Flask-Assets>=0.10,<0.11",
"markdown>=2.6.4,<2.7",
"pyserial>=2.7,<2.8",
"netaddr>=0.7.17,<0.8",
"watchdog>=0.8.3,<0.9",
"sarge>=0.1.4,<0.2",
"netifaces>=0.10,<0.11",
"pylru>=1.0.9,<1.1",
"rsa>=3.2,<3.3",
"pkginfo>=1.2.1,<1.3",
"requests>=2.7.0,<2.8",
"semantic_version>=2.4.2,<2.5",
"psutil>=3.2.1,<3.3",
"awesome-slugify>=1.6.5,<1.7",
"feedparser>=5.2.1,<5.3"
]
return dirs
# Additional requirements for optional install options
EXTRA_REQUIRES = dict(
# Dependencies for developing OctoPrint
develop=[
# Testing dependencies
"mock>=1.0.1,<1.1",
"nose>=1.3.0,<1.4",
"ddt",
# Documentation dependencies
"sphinx>=1.3,<1.4",
"sphinxcontrib-httpdomain",
"sphinx_rtd_theme",
def _recursively_handle_files(directory, file_matcher, folder_handler=None, file_handler=None):
applied_handler = False
# PyPi upload related
"pypandoc"
],
for filename in os.listdir(directory):
path = os.path.join(directory, filename)
if file_handler is not None and file_matcher(filename):
file_handler(path)
applied_handler = True
elif os.path.isdir(path):
sub_applied_handler = _recursively_handle_files(path, file_matcher, folder_handler=folder_handler, file_handler=file_handler)
if sub_applied_handler:
applied_handler = True
if folder_handler is not None:
folder_handler(path, sub_applied_handler)
return applied_handler
class CleanCommand(Command):
description = "clean build artifacts"
user_options = []
boolean_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
# build folder
if os.path.exists('build'):
print "Deleting build directory"
shutil.rmtree('build')
# eggs
eggs = glob.glob('OctoPrint*.egg-info')
for egg in eggs:
print "Deleting %s directory" % egg
shutil.rmtree(egg)
# pyc files
def delete_folder_if_empty(path, applied_handler):
if not applied_handler:
return
if len(os.listdir(path)) == 0:
shutil.rmtree(path)
print "Deleted %s since it was empty" % path
def delete_file(path):
os.remove(path)
print "Deleted %s" % path
import fnmatch
_recursively_handle_files(
os.path.abspath("src"),
lambda name: fnmatch.fnmatch(name.lower(), "*.pyc"),
folder_handler=delete_folder_if_empty,
file_handler=delete_file
)
class NewTranslation(Command):
description = "create a new translation"
user_options = [
('locale=', 'l', 'locale for the new translation'),
# Dependencies for developing OctoPrint plugins
plugins=[
"cookiecutter>=1.4,<1.5"
]
boolean_options = []
)
def __init__(self, dist, **kw):
from babel.messages import frontend as babel
self.babel_init_messages = babel.init_catalog(dist)
Command.__init__(self, dist, **kw)
# Additional requirements for setup
SETUP_REQUIRES = []
def initialize_options(self):
self.locale = None
self.babel_init_messages.initialize_options()
# Dependency links for any of the aforementioned dependencies
DEPENDENCY_LINKS = []
def finalize_options(self):
self.babel_init_messages.locale = self.locale
self.babel_init_messages.input_file = I18N_POT_FILE
self.babel_init_messages.output_dir = I18N_OUTPUT_DIR_PY
self.babel_init_messages.finalize_options()
#-----------------------------------------------------------------------------------------------------------------------
# Anything below here is just command setup and general setup configuration
def run(self):
self.babel_init_messages.run()
def data_copy_build_py_factory(files, baseclass):
class data_copy_build_py(baseclass):
files = dict()
def run(self):
import shutil
if not self.dry_run:
for directory, files in self.__class__.files.items():
target_dir = os.path.join(self.build_lib, directory)
self.mkpath(target_dir)
class ExtractTranslation(Command):
description = "extract translations"
user_options = []
boolean_options = []
for entry in files:
if isinstance(entry, tuple):
if len(entry) != 2:
continue
source, dest = entry
else:
source = dest = entry
shutil.copy(source, os.path.join(target_dir, dest))
def __init__(self, dist, **kw):
from babel.messages import frontend as babel
self.babel_extract_messages = babel.extract_messages(dist)
Command.__init__(self, dist, **kw)
def initialize_options(self):
self.babel_extract_messages.initialize_options()
def finalize_options(self):
self.babel_extract_messages.mapping_file = I18N_MAPPING_FILE
self.babel_extract_messages.output_file = I18N_POT_FILE
self.babel_extract_messages.input_dirs = I18N_INPUT_DIRS
self.babel_extract_messages.msgid_bugs_address = "i18n@octoprint.org"
self.babel_extract_messages.copyright_holder = "The OctoPrint Project"
self.babel_extract_messages.finalize_options()
def run(self):
self.babel_extract_messages.run()
class RefreshTranslation(Command):
description = "refresh translations"
user_options = [
('locale=', 'l', 'locale for the translation to refresh'),
]
boolean_options = []
def __init__(self, dist, **kw):
from babel.messages import frontend as babel
self.babel_extract_messages = babel.extract_messages(dist)
self.babel_update_messages = babel.update_catalog(dist)
Command.__init__(self, dist, **kw)
def initialize_options(self):
self.locale = None
self.babel_extract_messages.initialize_options()
self.babel_update_messages.initialize_options()
def finalize_options(self):
self.babel_extract_messages.mapping_file = I18N_MAPPING_FILE
self.babel_extract_messages.output_file = I18N_POT_FILE
self.babel_extract_messages.input_dirs = I18N_INPUT_DIRS
self.babel_extract_messages.msgid_bugs_address = "i18n@octoprint.org"
self.babel_extract_messages.copyright_holder = "The OctoPrint Project"
self.babel_extract_messages.finalize_options()
self.babel_update_messages.input_file = I18N_MAPPING_FILE
self.babel_update_messages.output_dir = I18N_OUTPUT_DIR_PY
self.babel_update_messages.locale = self.locale
def run(self):
self.babel_extract_messages.run()
self.babel_update_messages.run()
class CompileTranslation(Command):
description = "compile translations"
user_options = []
boolean_options = []
def __init__(self, dist, **kw):
from babel.messages import frontend as babel
self.babel_compile_messages = babel.compile_catalog(dist)
Command.__init__(self, dist, **kw)
def initialize_options(self):
self.babel_compile_messages.initialize_options()
def finalize_options(self):
self.babel_compile_messages.directory = I18N_OUTPUT_DIR_PY
def run(self):
self.babel_compile_messages.run()
import po2json
for lang_code in os.listdir(I18N_OUTPUT_DIR_PY):
full_path = os.path.join(I18N_OUTPUT_DIR_PY, lang_code)
if os.path.isdir(full_path):
client_po_dir = os.path.join(full_path, "LC_MESSAGES")
po2json.update_js_file(
"%s/%s.po" % (client_po_dir, I18N_DOMAIN),
lang_code,
I18N_OUTPUT_DIR_JS,
I18N_DOMAIN
)
baseclass.run(self)
return type(data_copy_build_py)(data_copy_build_py.__name__,
(data_copy_build_py,),
dict(files=files))
def get_cmdclass():
cmdclass = versioneer.get_cmdclass()
cmdclass.update({
'clean': CleanCommand,
'babel_new': NewTranslation,
'babel_extract': ExtractTranslation,
'babel_refresh': RefreshTranslation,
'babel_compile': CompileTranslation
})
# add clean command
cmdclass.update(dict(clean=octoprint_setuptools.CleanCommand.for_options(source_folder="src", eggs=["OctoPrint*.egg-info"])))
# add translation commands
translation_dir = "translations"
pot_file = os.path.join(translation_dir, "messages.pot")
bundled_dir = os.path.join("src", "octoprint", "translations")
cmdclass.update(octoprint_setuptools.get_babel_commandclasses(pot_file=pot_file, output_dir=translation_dir, pack_name_prefix="OctoPrint-i18n-", pack_path_prefix="", bundled_dir=bundled_dir))
cmdclass["build_py"] = data_copy_build_py_factory({
"octoprint/templates/_data": [
"AUTHORS.md",
"CHANGELOG.md",
"SUPPORTERS.md",
"THIRDPARTYLICENSES.md",
]
}, cmdclass["build_py"] if "build_py" in cmdclass else _build_py)
return cmdclass
@@ -235,8 +127,22 @@ def params():
version = versioneer.get_version()
cmdclass = get_cmdclass()
description = "A responsive web interface for 3D printers"
description = "A snappy web interface for 3D printers"
long_description = open("README.md").read()
install_requires = INSTALL_REQUIRES
extras_require = EXTRA_REQUIRES
dependency_links = DEPENDENCY_LINKS
setup_requires = SETUP_REQUIRES
try:
import pypandoc
setup_requires += ["setuptools-markdown"]
long_description_markdown_filename = "README.md"
del pypandoc
except:
pass
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
@@ -262,12 +168,21 @@ def params():
license = "AGPLv3"
packages = find_packages(where="src")
package_dir = {"octoprint": "src/octoprint"}
package_data = {"octoprint": package_data_dirs('src/octoprint', ['static', 'templates', 'plugins'])}
package_dir = {
"": "src",
}
package_data = {
"octoprint": octoprint_setuptools.package_data_dirs('src/octoprint', ['static', 'templates', 'plugins', 'translations'])
}
include_package_data = True
zip_safe = False
install_requires = open("requirements.txt").read().split("\n")
if os.environ.get('READTHEDOCS', None) == 'True':
# we can't tell read the docs to please perform a pip install -e .[develop], so we help
# it a bit here by explicitly adding the development dependencies, which include our
# documentation dependencies
install_requires = install_requires + extras_require['develop']
entry_points = {
"console_scripts": [
@@ -275,10 +190,6 @@ def params():
]
}
#scripts = {
# "scripts/octoprint.init": "/etc/init.d/octoprint"
#}
return locals()
setup(**params())
+17 -2
View File
@@ -1,4 +1,6 @@
#!/usr/bin/env python
from __future__ import absolute_import
import sys
from octoprint.daemon import Daemon
from octoprint.server import Server
@@ -24,7 +26,14 @@ class Main(Daemon):
self._logConf = logConf
def run(self):
octoprint = Server(self._configfile, self._basedir, self._host, self._port, self._debug, self._allowRoot)
octoprint = Server(configfile=self._configfile,
basedir=self._basedir,
host=self._host,
port=self._port,
debug=self._debug,
allowRoot=self._allowRoot,
logConf=self._logConf,
octoprint_daemon=self)
octoprint.run()
def main():
@@ -77,7 +86,13 @@ def main():
elif "restart" == args.daemon:
daemon.restart()
else:
octoprint = Server(args.config, args.basedir, args.host, args.port, args.debug, args.allowRoot, args.logConf)
octoprint = Server(configfile=args.config,
basedir=args.basedir,
host=args.host,
port=args.port,
debug=args.debug,
allowRoot=args.allowRoot,
logConf=args.logConf)
octoprint.run()
if __name__ == "__main__":
+539 -157
View File
@@ -1,28 +1,81 @@
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (build by setup.py sdist) and build
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains the computed version number.
# This file is released into the public domain. Generated by
# versioneer-0.10 (https://github.com/warner/python-versioneer)
# these strings will be replaced by git during git-archive
git_refnames = "$Format:%d$"
git_full = "$Format:%H$"
# versioneer-0.15+dev (https://github.com/warner/python-versioneer)
"""Git implementation of _version.py."""
import errno
import os
import re
import subprocess
import sys
import errno
def get_keywords():
"""Get the keywords needed to look up the version information."""
# these strings will be replaced by git during git-archive.
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
git_refnames = "$Format:%d$"
git_full = "$Format:%H$"
keywords = {"refnames": git_refnames, "full": git_full}
return keywords
class VersioneerConfig:
"""Container for Versioneer configuration parameters."""
def get_config():
"""Create, populate and return the VersioneerConfig() object."""
# these strings are filled in when 'setup.py versioneer' creates
# _version.py
cfg = VersioneerConfig()
cfg.VCS = "git"
cfg.style = "pep440"
cfg.tag_prefix = ""
cfg.parentdir_prefix = ""
cfg.versionfile_source = "src/octoprint/_version.py"
cfg.lookupfile = None
cfg.verbose = False
return cfg
class NotThisMethod(Exception):
"""Exception raised if a method is not valid for the current scenario."""
LONG_VERSION_PY = {}
HANDLERS = {}
def register_vcs_handler(vcs, method): # decorator
"""Decorator to mark a method as the handler for a particular VCS."""
def decorate(f):
"""Store f in HANDLERS[vcs][method]."""
if vcs not in HANDLERS:
HANDLERS[vcs] = {}
HANDLERS[vcs][method] = f
return f
return decorate
def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False):
"""Call the given command(s)."""
assert isinstance(commands, list)
p = None
for c in commands:
try:
dispcmd = str([c] + args)
# remember shell=False, so use git.cmd on windows, not just git
p = subprocess.Popen([c] + args, cwd=cwd, stdout=subprocess.PIPE,
stderr=(subprocess.PIPE if hide_stderr
@@ -33,7 +86,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False):
if e.errno == errno.ENOENT:
continue
if verbose:
print("unable to run %s" % args[0])
print("unable to run %s" % dispcmd)
print(e)
return None
else:
@@ -41,59 +94,67 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False):
print("unable to find command, tried %s" % (commands,))
return None
stdout = p.communicate()[0].strip()
if sys.version >= '3':
if sys.version_info[0] >= 3:
stdout = stdout.decode()
if p.returncode != 0:
if verbose:
print("unable to run %s (error)" % args[0])
print("unable to run %s (error)" % dispcmd)
return None
return stdout
import sys
import re
import os.path
def versions_from_parentdir(parentdir_prefix, root, verbose):
"""Try to determine the version from the parent directory name.
def get_gits(root, verbose=False):
if not os.path.exists(os.path.join(root, ".git")):
Source tarballs conventionally unpack into a directory that includes
both the project name and a version string.
"""
dirname = os.path.basename(root)
if not dirname.startswith(parentdir_prefix):
if verbose:
print("no .git in %s" % root)
return None
GITS = ["git"]
if sys.platform == "win32":
GITS = ["git.cmd", "git.exe"]
return GITS
print("guessing rootdir is '%s', but '%s' doesn't start with "
"prefix '%s'" % (root, dirname, parentdir_prefix))
raise NotThisMethod("rootdir doesn't start with parentdir_prefix")
return {"version": dirname[len(parentdir_prefix):],
"full-revisionid": None,
"dirty": False, "error": None}
def get_expanded_variables(versionfile_abs):
@register_vcs_handler("git", "get_keywords")
def git_get_keywords(versionfile_abs):
"""Extract version information from the given file."""
# the code embedded in _version.py can just fetch the value of these
# variables. When used from setup.py, we don't want to import
# _version.py, so we do it with a regexp instead. This function is not
# used from _version.py.
variables = {}
# keywords. When used from setup.py, we don't want to import _version.py,
# so we do it with a regexp instead. This function is not used from
# _version.py.
keywords = {}
try:
f = open(versionfile_abs,"r")
f = open(versionfile_abs, "r")
for line in f.readlines():
if line.strip().startswith("git_refnames ="):
mo = re.search(r'=\s*"(.*)"', line)
if mo:
variables["refnames"] = mo.group(1)
keywords["refnames"] = mo.group(1)
if line.strip().startswith("git_full ="):
mo = re.search(r'=\s*"(.*)"', line)
if mo:
variables["full"] = mo.group(1)
keywords["full"] = mo.group(1)
f.close()
except EnvironmentError:
pass
return variables
return keywords
def versions_from_expanded_variables(variables, tag_prefix, verbose=False):
refnames = variables["refnames"].strip()
@register_vcs_handler("git", "keywords")
def git_versions_from_keywords(keywords, tag_prefix, verbose):
"""Get version information from git keywords."""
if not keywords:
raise NotThisMethod("no keywords at all, weird")
refnames = keywords["refnames"].strip()
if refnames.startswith("$Format"):
if verbose:
print("variables are unexpanded, not using")
return {} # unexpanded, so not in an unpacked git-archive tarball
print("keywords are unexpanded, not using")
raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
refs = set([r.strip() for r in refnames.strip("()").split(",")])
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
# just "foo-1.0". If we see a "tag: " prefix, prefer those.
@@ -110,6 +171,15 @@ def versions_from_expanded_variables(variables, tag_prefix, verbose=False):
tags = set([r for r in refs if re.search(r'\d', r)])
if verbose:
print("discarding '%s', no digits" % ",".join(refs-tags))
branches = [r for r in refs if not r.startswith(TAG)
and r != "HEAD" and not r.startswith("refs/")]
if verbose:
print("likely branches: %s" % ",".join(sorted(branches)))
branch = None
if branches:
branch = branches[0]
if verbose:
print("likely tags: %s" % ",".join(sorted(tags)))
for ref in sorted(tags):
@@ -118,161 +188,473 @@ def versions_from_expanded_variables(variables, tag_prefix, verbose=False):
r = ref[len(tag_prefix):]
if verbose:
print("picking %s" % r)
return { "version": r,
"full": variables["full"].strip() }
# no suitable tags, so we use the full revision id
result = {"version": r,
"full-revisionid": keywords["full"].strip(),
"dirty": False, "error": None}
if branch is not None:
result["branch"] = branch
return result
# no suitable tags, so version is "0+unknown", but full hex is still there
if verbose:
print("no suitable tags, using full revision id")
return { "version": variables["full"].strip(),
"full": variables["full"].strip() }
print("no suitable tags, using unknown + full revision id")
return {"version": "0+unknown",
"full-revisionid": keywords["full"].strip(),
"dirty": False, "error": "no suitable tags"}
def versions_from_lookup(lookup, root, verbose=False):
GITS = get_gits(root, verbose=verbose)
if GITS is None:
return {}
stdout = run_command(GITS, ["rev-parse", "--abbrev-ref", "HEAD"],
cwd=root)
if stdout is None:
return {}
@register_vcs_handler("git", "pieces_from_vcs")
def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
"""Get version from 'git describe' in the root of the source tree.
current_branch = stdout.strip()
for matcher, tag, ref_commit in lookup:
if matcher.match(current_branch):
if tag is None or ref_commit is None:
return {}
stdout = run_command(GITS, ["rev-list", "%s..HEAD" % ref_commit, "--count"], cwd=root)
if stdout is None:
return {}
num_commits = stdout.strip()
stdout =run_command(GITS, ["rev-parse", "--short", "HEAD"], cwd=root)
if stdout is None:
return {}
short_hash = stdout.strip()
stdout = run_command(GITS, ["describe", "--tags", "--dirty", "--always"], cwd=root)
if stdout is None:
return {}
dirty = stdout.strip().endswith("-dirty")
stdout = run_command(GITS, ["rev-parse", "HEAD"], cwd=root)
if stdout is None:
return {}
full = stdout.strip()
version = "%s-%s-g%s" % (tag, num_commits, short_hash)
if dirty:
version += "-dirty"
full += "-dirty"
return {"version": version, "full": full, "branch": current_branch}
return {}
def versions_from_vcs(tag_prefix, root, verbose=False):
# this runs 'git' from the root of the source tree. This only gets called
# if the git-archive 'subst' variables were *not* expanded, and
# _version.py hasn't already been rewritten with a short version string,
# meaning we're inside a checked out source tree.
GITS = get_gits(root, verbose=verbose)
if GITS is None:
return {}
stdout = run_command(GITS, ["describe", "--tags", "--dirty", "--always"],
cwd=root)
if stdout is None:
return {}
if not stdout.startswith(tag_prefix):
This only gets called if the git-archive 'subst' keywords were *not*
expanded, and _version.py hasn't already been rewritten with a short
version string, meaning we're inside a checked out source tree.
"""
if not os.path.exists(os.path.join(root, ".git")):
if verbose:
print("tag '%s' doesn't start with prefix '%s'" % (stdout, tag_prefix))
return {}
tag = stdout[len(tag_prefix):]
stdout = run_command(GITS, ["rev-parse", "HEAD"], cwd=root)
if stdout is None:
return {}
full = stdout.strip()
if tag.endswith("-dirty"):
full += "-dirty"
print("no .git in %s" % root)
raise NotThisMethod("no .git directory")
GITS = ["git"]
if sys.platform == "win32":
GITS = ["git.cmd", "git.exe"]
# if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]
# if there isn't one, this yields HEX[-dirty] (no NUM)
describe_out = run_command(GITS, ["describe", "--tags", "--dirty",
"--always", "--long",
"--match", "%s*" % tag_prefix],
cwd=root)
# --long was added in git-1.5.5
if describe_out is None:
raise NotThisMethod("'git describe' failed")
describe_out = describe_out.strip()
full_out = run_command(GITS, ["rev-parse", "HEAD"], cwd=root)
if full_out is None:
raise NotThisMethod("'git rev-parse' failed")
full_out = full_out.strip()
pieces = {}
pieces["long"] = full_out
pieces["short"] = full_out[:7] # maybe improved later
pieces["error"] = None
# parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty]
# TAG might have hyphens.
git_describe = describe_out
# look for -dirty suffix
dirty = git_describe.endswith("-dirty")
pieces["dirty"] = dirty
if dirty:
git_describe = git_describe[:git_describe.rindex("-dirty")]
# figure out our branch
abbrev_ref_out = run_command(GITS,
["rev-parse", "--abbrev-ref", "HEAD"],
cwd=root)
if abbrev_ref_out is not None:
pieces["branch"] = abbrev_ref_out.strip()
# now we have TAG-NUM-gHEX or HEX
if "-" in git_describe:
# TAG-NUM-gHEX
mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe)
if not mo:
# unparseable. Maybe git-describe is misbehaving?
pieces["error"] = ("unable to parse git-describe output: '%s'"
% describe_out)
return pieces
# tag
full_tag = mo.group(1)
if not full_tag.startswith(tag_prefix):
if verbose:
fmt = "tag '%s' doesn't start with prefix '%s'"
print(fmt % (full_tag, tag_prefix))
pieces["error"] = ("tag '%s' doesn't start with prefix '%s'"
% (full_tag, tag_prefix))
return pieces
pieces["closest-tag"] = full_tag[len(tag_prefix):]
# distance: number of commits since tag
pieces["distance"] = int(mo.group(2))
# commit: short hex revision ID
pieces["short"] = mo.group(3)
stdout = run_command(GITS, ["rev-parse", "--abbrev-ref", "HEAD"],
cwd=root)
if stdout is None:
branch = None
else:
branch = stdout.strip()
return {"version": tag, "full": full, "branch": branch}
# HEX: no tags
pieces["closest-tag"] = None
count_out = run_command(GITS, ["rev-list", "HEAD", "--count"],
cwd=root)
pieces["distance"] = int(count_out) # total number of commits
return pieces
def versions_from_parentdir(parentdir_prefix, root, verbose=False):
# Source tarballs conventionally unpack into a directory that includes
# both the project name and a version string.
dirname = os.path.basename(root)
if not dirname.startswith(parentdir_prefix):
if verbose:
print("guessing rootdir is '%s', but '%s' doesn't start with prefix '%s'" %
(root, dirname, parentdir_prefix))
return None
return {"version": dirname[len(parentdir_prefix):], "full": "", "branch": ""}
@register_vcs_handler("git", "parse_lookup_file")
def git_parse_lookup_file(path):
"""Parse a versioneer lookup file.
tag_prefix = ""
parentdir_prefix = ""
versionfile_source = "src/octoprint/_version.py"
lookupfile = ".versioneer-lookup"
def parse_lookup_file(root, lookup_path=None):
if not lookup_path:
lookup_path = lookupfile
if not lookup_path:
return []
path = os.path.join(root, lookup_path)
This file allows definition of branch specific data like virtual tags or
custom styles to use for version rendering.
"""
if not os.path.exists(path):
return []
import re
lookup = []
with open(os.path.join(root, lookup_path), "r") as f:
with open(path, "r") as f:
for line in f:
if '#' in line:
line = line[:line.rindex('#')]
line = line[:line.rindex("#")]
line = line.strip()
if not line:
continue
try:
split_line = line.split()
if len(split_line) == 3:
pattern, tag, ref_commit = split_line
lookup.append([re.compile(pattern), tag, ref_commit])
elif len(split_line) >= 1:
lookup.append([re.compile(split_line[0]), None, None])
split_line = map(lambda x: x.strip(), line.split())
if not len(split_line):
continue
matcher = re.compile(split_line[0])
if len(split_line) == 1:
entry = [matcher, None, None, None]
elif len(split_line) == 2:
render = split_line[1]
entry = [matcher, render, None, None]
elif len(split_line) == 3:
tag, ref_commit = split_line[1:]
entry = [matcher, None, tag, ref_commit]
elif len(split_line) == 4:
tag, ref_commit, render = split_line[1:]
entry = [matcher, render, tag, ref_commit]
else:
continue
lookup.append(entry)
except:
break
return lookup
def get_versions(default={"version": "unknown", "full": "", "branch": "unknown"}, lookup_path=None, verbose=False):
@register_vcs_handler("git", "pieces_from_lookup")
def git_pieces_from_lookup(lookup, root, verbose, run_command=run_command):
"""Extract version information based on provided lookup data."""
GITS = ["git"]
if sys.platform == "win32":
GITS = ["git.cmd", "git.exe"]
stdout = run_command(GITS, ["rev-parse", "--abbrev-ref", "HEAD"],
cwd=root)
if stdout is None:
raise NotThisMethod("git rev-parse --abbrev-ref HEAD failed")
current_branch = stdout.strip()
for matcher, render, tag, ref_commit in lookup:
if matcher.match(current_branch):
if tag is None or ref_commit is None:
raise NotThisMethod("tag or ref_commit is unset for "
"this branch")
stdout = run_command(GITS,
["rev-list", "%s..HEAD" % ref_commit,
"--count"],
cwd=root)
if stdout is None:
raise NotThisMethod("git rev-list %s..HEAD "
"--count failed" % ref_commit)
try:
num_commits = int(stdout.strip())
except ValueError:
raise NotThisMethod("git rev-list %s..HEAD --count didn't "
"return a valid number" % ref_commit)
stdout = run_command(GITS,
["rev-parse", "--short", "HEAD"],
cwd=root)
if stdout is None:
raise NotThisMethod("git describe rev-parse "
"--short HEAD failed")
short_hash = stdout.strip()
stdout = run_command(GITS,
["describe", "--tags",
"--dirty", "--always"],
cwd=root)
if stdout is None:
raise NotThisMethod("git describe --tags --dirty "
"--always failed")
dirty = stdout.strip().endswith("-dirty")
stdout = run_command(GITS, ["rev-parse", "HEAD"], cwd=root)
if stdout is None:
raise NotThisMethod("git rev-parse HEAD failed")
full = stdout.strip()
return {
"long": full,
"short": short_hash,
"dirty": dirty,
"branch": current_branch,
"closest-tag": tag,
"distance": num_commits,
"error": None,
"render": render
}
raise NotThisMethod("no matching lookup definition found")
def plus_or_dot(pieces):
"""Return a + if we don't already have one, else return a ."""
if "+" in pieces.get("closest-tag", ""):
return "."
return "+"
def render_pep440(pieces):
"""Build up version string, with post-release "local version identifier".
Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you
get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty
Exceptions:
1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty]
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"] or pieces["dirty"]:
rendered += plus_or_dot(pieces)
rendered += "%d.g%s" % (pieces["distance"], pieces["short"])
if pieces["dirty"]:
rendered += ".dirty"
else:
# exception #1
rendered = "0+untagged.%d.g%s" % (pieces["distance"],
pieces["short"])
if pieces["dirty"]:
rendered += ".dirty"
return rendered
def render_pep440_pre(pieces):
"""TAG[.post.devDISTANCE] -- No -dirty.
Exceptions:
1: no tags. 0.post.devDISTANCE
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"]:
rendered += ".post.dev%d" % pieces["distance"]
else:
# exception #1
rendered = "0.post.dev%d" % pieces["distance"]
return rendered
def render_pep440_post(pieces):
"""TAG[.postDISTANCE[.dev0]+gHEX] .
The ".dev0" means dirty. Note that .dev0 sorts backwards
(a dirty tree will appear "older" than the corresponding clean one),
but you shouldn't be releasing software with -dirty anyways.
Exceptions:
1: no tags. 0.postDISTANCE[.dev0]
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"] or pieces["dirty"]:
rendered += ".post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
rendered += plus_or_dot(pieces)
rendered += "g%s" % pieces["short"]
else:
# exception #1
rendered = "0.post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
rendered += "+g%s" % pieces["short"]
return rendered
def render_pep440_dev(pieces):
"""TAG[.devDISTANCE]+gHEX[.dirty] .
Exceptions:
1: no tags. 0.devDISTANCE+gHEX[.dirty]
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"]:
rendered += ".dev%d" % pieces["distance"]
rendered += plus_or_dot(pieces)
else:
# exception #1
rendered = "0.dev%d" % pieces["distance"]
rendered += "+"
rendered += "g%s" % pieces["short"]
if pieces["dirty"]:
rendered += ".dirty"
return rendered
def render_pep440_old(pieces):
"""TAG[.postDISTANCE[.dev0]] .
The ".dev0" means dirty.
Eexceptions:
1: no tags. 0.postDISTANCE[.dev0]
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"] or pieces["dirty"]:
rendered += ".post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
else:
# exception #1
rendered = "0.post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
return rendered
def render_git_describe(pieces):
"""TAG[-DISTANCE-gHEX][-dirty].
Like 'git describe --tags --dirty --always'.
Exceptions:
1: no tags. HEX[-dirty] (note: no 'g' prefix)
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"]:
rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
else:
# exception #1
rendered = pieces["short"]
if pieces["dirty"]:
rendered += "-dirty"
return rendered
def render_git_describe_long(pieces):
"""TAG-DISTANCE-gHEX[-dirty].
Like 'git describe --tags --dirty --always -long'.
The distance/hash is unconditional.
Exceptions:
1: no tags. HEX[-dirty] (note: no 'g' prefix)
"""
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
else:
# exception #1
rendered = pieces["short"]
if pieces["dirty"]:
rendered += "-dirty"
return rendered
def render(pieces, style):
"""Render the given version pieces into the requested style."""
if pieces["error"]:
return {"version": "unknown",
"full-revisionid": pieces.get("long"),
"dirty": None,
"error": pieces["error"]}
if "render" in pieces and pieces["render"] is not None:
style = pieces["render"]
if not style or style == "default":
style = "pep440" # the default
if style == "pep440":
rendered = render_pep440(pieces)
elif style == "pep440-pre":
rendered = render_pep440_pre(pieces)
elif style == "pep440-post":
rendered = render_pep440_post(pieces)
elif style == "pep440-old":
rendered = render_pep440_old(pieces)
elif style == "pep440-dev":
rendered = render_pep440_dev(pieces)
elif style == "git-describe":
rendered = render_git_describe(pieces)
elif style == "git-describe-long":
rendered = render_git_describe_long(pieces)
else:
raise ValueError("unknown style '%s'" % style)
result = {"version": rendered, "full-revisionid": pieces["long"],
"dirty": pieces["dirty"], "error": None}
if "branch" in pieces and pieces["branch"] is not None:
result["branch"] = pieces["branch"]
return result
def get_versions():
"""Get version information or return default if unable to do so."""
# I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have
# __file__, we can work backwards from there to the root. Some
# py2exe/bbfreeze/non-CPython implementations don't do __file__, in which
# case we can only use expanded variables.
# case we can only use expanded keywords.
variables = { "refnames": git_refnames, "full": git_full }
ver = versions_from_expanded_variables(variables, tag_prefix, verbose)
if ver:
return ver
cfg = get_config()
verbose = cfg.verbose
try:
root = os.path.abspath(__file__)
return git_versions_from_keywords(get_keywords(), cfg.tag_prefix,
verbose)
except NotThisMethod:
pass
try:
root = os.path.realpath(__file__)
# versionfile_source is the relative path from the top of the source
# tree (where the .git directory might live) to this file. Invert
# this to find the root from __file__.
for i in range(len(versionfile_source.split("/"))):
for i in cfg.versionfile_source.split('/'):
root = os.path.dirname(root)
except NameError:
return default
return {"version": "0+unknown", "full-revisionid": None,
"dirty": None,
"error": "unable to find root of source tree"}
lookup = parse_lookup_file(root, lookup_path=lookup_path)
return (versions_from_lookup(lookup, root, verbose)
or versions_from_vcs(tag_prefix, root, verbose)
or versions_from_parentdir(parentdir_prefix, root, verbose)
or default)
lookupfile = cfg.lookupfile if cfg.lookupfile is not None else ".versioneer-lookup"
lookuppath = os.path.join(root, lookupfile)
if os.path.exists(lookuppath):
try:
lookup_data = git_parse_lookup_file(lookuppath)
pieces = git_pieces_from_lookup(lookup_data, root, verbose)
return render(pieces, cfg.style)
except NotThisMethod:
pass
try:
pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose)
return render(pieces, cfg.style)
except NotThisMethod:
pass
try:
if cfg.parentdir_prefix:
return versions_from_parentdir(cfg.parentdir_prefix, root, verbose)
except NotThisMethod:
pass
return {"version": "0+unknown", "full-revisionid": None,
"dirty": None,
"error": "unable to compute version"}
+30 -28
View File
@@ -4,7 +4,7 @@ Generic linux daemon base class for python 3.x
Originally from http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/#c35
"""
import sys, os, time, atexit, signal
import sys, os, time, signal
class Daemon:
"""A generic daemon class.
@@ -12,35 +12,35 @@ class Daemon:
Usage: subclass the daemon class and override the run() method."""
def __init__(self, pidfile): self.pidfile = pidfile
def daemonize(self):
"""Deamonize class. UNIX double fork mechanism."""
try:
pid = os.fork()
try:
pid = os.fork()
if pid > 0:
# exit first parent
sys.exit(0)
except OSError as err:
sys.exit(0)
except OSError as err:
sys.stderr.write('fork #1 failed: {0}\n'.format(err))
sys.exit(1)
# decouple from parent environment
os.chdir('/')
os.setsid()
os.chdir('/')
os.setsid()
os.umask(002)
# do second fork
try:
pid = os.fork()
try:
pid = os.fork()
if pid > 0:
# exit from second parent
sys.exit(0)
except OSError as err:
sys.exit(0)
except OSError as err:
sys.stderr.write('fork #2 failed: {0}\n'.format(err))
sys.exit(1)
sys.exit(1)
# redirect standard file descriptors
sys.stdout.flush()
sys.stderr.flush()
@@ -51,16 +51,14 @@ class Daemon:
os.dup2(si.fileno(), sys.stdin.fileno())
os.dup2(so.fileno(), sys.stdout.fileno())
os.dup2(se.fileno(), sys.stderr.fileno())
# write pidfile
atexit.register(self.delpid)
# write pidfile
pid = str(os.getpid())
with open(self.pidfile,'w+') as f:
f.write(pid + '\n')
def delpid(self):
os.remove(self.pidfile)
def terminated(self):
self.remove_pidfile()
def start(self):
"""Start the daemon."""
@@ -72,13 +70,13 @@ class Daemon:
pid = int(pf.read().strip())
except IOError:
pid = None
if pid:
message = "pidfile {0} already exist. " + \
"Daemon already running?\n"
sys.stderr.write(message.format(self.pidfile))
sys.exit(1)
# Start the daemon
self.daemonize()
self.run()
@@ -92,14 +90,14 @@ class Daemon:
pid = int(pf.read().strip())
except IOError:
pid = None
if not pid:
message = "pidfile {0} does not exist. " + \
"Daemon not running?\n"
sys.stderr.write(message.format(self.pidfile))
return # not an error in a restart
# Try killing the daemon process
# Try killing the daemon process
try:
while 1:
os.kill(pid, signal.SIGTERM)
@@ -120,7 +118,11 @@ class Daemon:
def run(self):
"""You should override this method when you subclass Daemon.
It will be called after the process has been daemonized by
It will be called after the process has been daemonized by
start() or restart()."""
def remove_pidfile(self):
"""Removes the pidfile."""
if os.path.isfile(self.pidfile):
os.remove(self.pidfile)
+52 -32
View File
@@ -42,6 +42,7 @@ class Events(object):
UPDATED_FILES = "UpdatedFiles"
METADATA_ANALYSIS_STARTED = "MetadataAnalysisStarted"
METADATA_ANALYSIS_FINISHED = "MetadataAnalysisFinished"
METADATA_STATISTICS_UPDATED = "MetadataStatisticsUpdated"
# SD Upload
TRANSFER_STARTED = "TransferStarted"
@@ -62,15 +63,20 @@ class Events(object):
HOME = "Home"
Z_CHANGE = "ZChange"
WAITING = "Waiting"
DWELL = "Dwelling"
COOLING = "Cooling"
ALERT = "Alert"
CONVEYOR = "Conveyor"
EJECT = "Eject"
E_STOP = "EStop"
REGISTERED_MESSAGE_RECEIVED = "RegisteredMessageReceived"
# Timelapse
CAPTURE_START = "CaptureStart"
CAPTURE_DONE = "CaptureDone"
CAPTURE_FAILED = "CaptureFailed"
POSTROLL_START = "PostRollStart"
POSTROLL_END = "PostRollEnd"
MOVIE_RENDERING = "MovieRendering"
MOVIE_DONE = "MovieDone"
MOVIE_FAILED = "MovieFailed"
@@ -80,6 +86,14 @@ class Events(object):
SLICING_DONE = "SlicingDone"
SLICING_FAILED = "SlicingFailed"
SLICING_CANCELLED = "SlicingCancelled"
SLICING_PROFILE_ADDED = "SlicingProfileAdded"
SLICING_PROFILE_MODIFIED = "SlicingProfileModified"
SLICING_PROFILE_DELETED = "SlicingProfileDeleted"
# Printer Profiles
PRINTER_PROFILE_ADDED = "PrinterProfileAdded"
PRINTER_PROFILE_MODIFIED = "PrinterProfileModified"
PRINTER_PROFILE_DELETED = "PrinterProfileDeleted"
# Settings
SETTINGS_UPDATED = "SettingsUpdated"
@@ -101,28 +115,31 @@ class EventManager(object):
self._registeredListeners = collections.defaultdict(list)
self._logger = logging.getLogger(__name__)
self._queue = Queue.PriorityQueue()
self._queue = Queue.Queue()
self._worker = threading.Thread(target=self._work)
self._worker.daemon = True
self._worker.start()
def _work(self):
while True:
(event, payload) = self._queue.get(True)
try:
while True:
event, payload = self._queue.get(True)
eventListeners = self._registeredListeners[event]
self._logger.debug("Firing event: %s (Payload: %r)" % (event, payload))
eventListeners = self._registeredListeners[event]
self._logger.debug("Firing event: %s (Payload: %r)" % (event, payload))
for listener in eventListeners:
self._logger.debug("Sending action to %r" % listener)
try:
listener(event, payload)
except:
self._logger.exception("Got an exception while sending event %s (Payload: %r) to %s" % (event, payload, listener))
for listener in eventListeners:
self._logger.debug("Sending action to %r" % listener)
try:
listener(event, payload)
except:
self._logger.exception("Got an exception while sending event %s (Payload: %r) to %s" % (event, payload, listener))
octoprint.plugin.call_plugin(octoprint.plugin.types.EventHandlerPlugin,
"on_event",
args=[event, payload])
octoprint.plugin.call_plugin(octoprint.plugin.types.EventHandlerPlugin,
"on_event",
args=[event, payload])
except:
self._logger.exception("Ooops, the event bus worker loop crashed")
def fire(self, event, payload=None):
"""
@@ -135,7 +152,7 @@ class EventManager(object):
payload being a payload object specific to the event.
"""
self._queue.put((event, payload), 0)
self._queue.put((event, payload))
if event == Events.UPDATED_FILES and "type" in payload and payload["type"] == "printables":
# when sending UpdatedFiles with type "printables", also send another event with deprecated type "gcode"
@@ -143,8 +160,7 @@ class EventManager(object):
import copy
legacy_payload = copy.deepcopy(payload)
legacy_payload["type"] = "gcode"
self._queue.put((event, legacy_payload), 0)
self._queue.put((event, legacy_payload))
def subscribe(self, event, callback):
"""
@@ -248,10 +264,11 @@ class CommandTrigger(GenericEventListener):
event = subscription["event"]
command = subscription["command"]
commandType = subscription["type"]
debug = subscription["debug"] if "debug" in subscription else False
if not event in self._subscriptions.keys():
self._subscriptions[event] = []
self._subscriptions[event].append((command, commandType))
self._subscriptions[event].append((command, commandType, debug))
if not event in eventsToSubscribe:
eventsToSubscribe.append(event)
@@ -269,7 +286,7 @@ class CommandTrigger(GenericEventListener):
if not event in self._subscriptions:
return
for command, commandType in self._subscriptions[event]:
for command, commandType, debug in self._subscriptions[event]:
try:
if isinstance(command, (tuple, list, set)):
processedCommand = []
@@ -277,19 +294,23 @@ class CommandTrigger(GenericEventListener):
processedCommand.append(self._processCommand(c, payload))
else:
processedCommand = self._processCommand(command, payload)
self.executeCommand(processedCommand, commandType)
self.executeCommand(processedCommand, commandType, debug=debug)
except KeyError, e:
self._logger.warn("There was an error processing one or more placeholders in the following command: %s" % command)
def executeCommand(self, command, commandType):
def executeCommand(self, command, commandType, debug=False):
if commandType == "system":
self._executeSystemCommand(command)
self._executeSystemCommand(command, debug=debug)
elif commandType == "gcode":
self._executeGcodeCommand(command)
self._executeGcodeCommand(command, debug=debug)
def _executeSystemCommand(self, command):
def _executeSystemCommand(self, command, debug=False):
def commandExecutioner(command):
self._logger.info("Executing system command: %s" % command)
if debug:
self._logger.info("Executing system command: %s" % command)
# we run this with shell=True since we have to trust whatever
# our admin configured as command and since we want to allow
# shell-alike handling here...
subprocess.Popen(command, shell=True)
try:
@@ -299,17 +320,16 @@ class CommandTrigger(GenericEventListener):
else:
commandExecutioner(command)
except subprocess.CalledProcessError, e:
self._logger.warn("Command failed with return code %i: %s" % (e.returncode, e.message))
except Exception, ex:
self._logger.warn("Command failed with return code %i: %s" % (e.returncode, str(e)))
except:
self._logger.exception("Command failed")
def _executeGcodeCommand(self, command):
def _executeGcodeCommand(self, command, debug=False):
commands = [command]
if isinstance(command, (list, tuple, set)):
self.logger.debug("Executing GCode commands: %r" % command)
commands = list(command)
else:
self._logger.debug("Executing GCode command: %s" % command)
if debug:
self._logger.info("Executing GCode commands: %r" % command)
self._printer.commands(commands)
def _processCommand(self, command, payload):
@@ -335,7 +355,7 @@ class CommandTrigger(GenericEventListener):
"__now": datetime.datetime.now().isoformat()
}
currentData = self._printer.getCurrentData()
currentData = self._printer.get_current_data()
if "currentZ" in currentData.keys() and currentData["currentZ"] is not None:
params["__currentZ"] = str(currentData["currentZ"])
+213 -72
View File
@@ -8,26 +8,51 @@ __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms
import logging
import os
import octoprint.plugin
import octoprint.util
from octoprint.events import eventManager, Events
from .destinations import FileDestinations
from .analysis import QueueEntry, AnalysisQueue
from .storage import LocalFileStorage
from .util import AbstractFileWrapper, StreamWrapper, DiskFileWrapper
from collections import namedtuple
ContentTypeMapping = namedtuple("ContentTypeMapping", "extensions, content_type")
ContentTypeDetector = namedtuple("ContentTypeDetector", "extensions, detector")
extensions = dict(
# extensions for 3d model files
model=dict(
stl=["stl"]
),
# extensions for printable machine code
machinecode=dict(
gcode=["gcode", "gco", "g"]
)
)
def full_extension_tree():
result = dict(
# extensions for 3d model files
model=dict(
stl=ContentTypeMapping(["stl"], "application/sla")
),
# extensions for printable machine code
machinecode=dict(
gcode=ContentTypeMapping(["gcode", "gco", "g"], "text/plain")
)
)
extension_tree_hooks = octoprint.plugin.plugin_manager().get_hooks("octoprint.filemanager.extension_tree")
for name, hook in extension_tree_hooks.items():
try:
hook_result = hook()
if hook_result is None or not isinstance(hook_result, dict):
continue
result = octoprint.util.dict_merge(result, hook_result)
except:
logging.getLogger(__name__).exception("Exception while retrieving additional extension tree entries from hook {name}".format(name=name))
return result
def get_extensions(type, subtree=None):
if not subtree:
subtree = extensions
subtree = full_extension_tree()
for key, value in subtree.items():
if key == type:
@@ -41,25 +66,31 @@ def get_extensions(type, subtree=None):
def get_all_extensions(subtree=None):
if not subtree:
subtree = extensions
subtree = full_extension_tree()
result = []
if isinstance(subtree, dict):
for key, value in subtree.items():
if isinstance(value, dict):
result += get_all_extensions(value)
elif isinstance(value, (ContentTypeMapping, ContentTypeDetector)):
result += value.extensions
elif isinstance(value, (list, tuple)):
result += value
elif isinstance(subtree, (ContentTypeMapping, ContentTypeDetector)):
result = subtree.extensions
elif isinstance(subtree, (list, tuple)):
result = subtree
return result
def get_path_for_extension(extension, subtree=None):
if not subtree:
subtree = extensions
subtree = full_extension_tree()
for key, value in subtree.items():
if isinstance(value, (list, tuple)) and extension in value:
if isinstance(value, (ContentTypeMapping, ContentTypeDetector)) and extension in value.extensions:
return [key]
elif isinstance(value, (list, tuple)) and extension in value:
return [key]
elif isinstance(value, dict):
path = get_path_for_extension(extension, subtree=value)
@@ -68,11 +99,26 @@ def get_path_for_extension(extension, subtree=None):
return None
all_extensions = get_all_extensions()
def get_content_type_mapping_for_extension(extension, subtree=None):
if not subtree:
subtree = full_extension_tree()
for key, value in subtree.items():
content_extension_matches = isinstance(value, (ContentTypeMapping, ContentTypeDetector)) and extension in value. extensions
list_extension_matches = isinstance(value, (list, tuple)) and extension in value
if content_extension_matches or list_extension_matches:
return value
elif isinstance(value, dict):
result = get_content_type_mapping_for_extension(extension, subtree=value)
if result is not None:
return result
return None
def valid_extension(extension, type=None):
if not type:
return extension in all_extensions
return extension in get_all_extensions()
else:
extensions = get_extensions(type)
if extensions:
@@ -88,6 +134,19 @@ def get_file_type(filename):
extension = extension[1:].lower()
return get_path_for_extension(extension)
def get_mime_type(filename):
_, extension = os.path.splitext(filename)
extension = extension[1:].lower()
mapping = get_content_type_mapping_for_extension(extension)
if mapping:
if isinstance(mapping, ContentTypeMapping) and mapping.content_type is not None:
return mapping.content_type
elif isinstance(mapping, ContentTypeDetector) and callable(mapping.detector):
result = mapping.detector(filename)
if result is not None:
return result
return "application/octet-stream"
class NoSuchStorage(Exception):
pass
@@ -113,23 +172,49 @@ class FileManager(object):
self._slicing_progress_callbacks = []
self._last_slicing_progress = None
for storage_type, storage_manager in self._storage_managers.items():
self._determine_analysis_backlog(storage_type, storage_manager)
self._progress_plugins = []
self._preprocessor_hooks = dict()
import octoprint.settings
self._recovery_file = os.path.join(octoprint.settings.settings().getBaseFolder("data"), "print_recovery_data.yaml")
def initialize(self):
self.reload_plugins()
def worker():
self._logger.info("Adding backlog items from all storage types to analysis queue...".format(**locals()))
for storage_type, storage_manager in self._storage_managers.items():
self._determine_analysis_backlog(storage_type, storage_manager)
import threading
thread = threading.Thread(target=worker)
thread.daemon = True
thread.start()
def reload_plugins(self):
self._progress_plugins = octoprint.plugin.plugin_manager().get_implementations(octoprint.plugin.ProgressPlugin)
self._preprocessor_hooks = octoprint.plugin.plugin_manager().get_hooks("octoprint.filemanager.preprocessor")
def register_slicingprogress_callback(self, callback):
self._slicing_progress_callbacks.append(callback)
def unregister_slicingprogress_callback(self, callback):
self._slicing_progress_callbacks.remove(callback)
try:
self._slicing_progress_callbacks.remove(callback)
except ValueError:
# callback was not registered
pass
def _determine_analysis_backlog(self, storage_type, storage_manager):
self._logger.info("Adding backlog items from {storage_type} to analysis queue".format(**locals()))
counter = 0
for entry, path, printer_profile in storage_manager.analysis_backlog:
file_type = get_file_type(path)[-1]
# we'll use the default printer profile for the backlog since we don't know better
queue_entry = QueueEntry(entry, file_type, storage_type, path, self._printer_profile_manager.get_default())
self._analysis_queue.enqueue(queue_entry, high_priority=False)
if self._analysis_queue.enqueue(queue_entry, high_priority=False):
counter += 1
self._logger.info("Added {counter} items from storage type \"{storage_type}\" to analysis queue".format(**locals()))
def add_storage(self, storage_type, storage_manager):
self._storage_managers[storage_type] = storage_manager
@@ -154,9 +239,9 @@ class FileManager(object):
def slice(self, slicer_name, source_location, source_path, dest_location, dest_path,
position=None, profile=None, printer_profile_id=None, overrides=None, callback=None, callback_args=None):
absolute_source_path = self.get_absolute_path(source_location, source_path)
absolute_source_path = self.path_on_disk(source_location, source_path)
def stlProcessed(source_location, source_path, tmp_path, dest_location, dest_path, start_time, printer_profile_id, callback, callback_args, _error=None, _cancelled=False):
def stlProcessed(source_location, source_path, tmp_path, dest_location, dest_path, start_time, printer_profile_id, callback, callback_args, _error=None, _cancelled=False, _analysis=None):
try:
if _error:
eventManager().fire(Events.SLICING_FAILED, {"stl": source_path, "gcode": dest_path, "reason": _error})
@@ -166,25 +251,15 @@ class FileManager(object):
source_meta = self.get_metadata(source_location, source_path)
hash = source_meta["hash"]
class Wrapper(object):
def __init__(self, stl_name, temp_path, hash):
self.stl_name = stl_name
self.temp_path = temp_path
self.hash = hash
def save(self, absolute_dest_path):
with open(absolute_dest_path, "w") as d:
d.write(";Generated from {stl_name} {hash}\r".format(**vars(self)))
with open(tmp_path, "r") as s:
import shutil
shutil.copyfileobj(s, d)
import io
links = [("model", dict(name=source_path))]
_, stl_name = self.split_path(source_location, source_path)
file_obj = Wrapper(stl_name, temp_path, hash)
file_obj = StreamWrapper(os.path.basename(dest_path),
io.BytesIO(u";Generated from {stl_name} {hash}\n".format(**locals()).encode("ascii", "replace")),
io.FileIO(tmp_path, "rb"))
printer_profile = self._printer_profile_manager.get(printer_profile_id)
self.add_file(dest_location, dest_path, file_obj, links=links, allow_overwrite=True, printer_profile=printer_profile)
self.add_file(dest_location, dest_path, file_obj, links=links, allow_overwrite=True, printer_profile=printer_profile, analysis=_analysis)
end_time = time.time()
eventManager().fire(Events.SLICING_DONE, {"stl": source_path, "gcode": dest_path, "time": end_time - start_time})
@@ -209,7 +284,7 @@ class FileManager(object):
import time
start_time = time.time()
eventManager().fire(Events.SLICING_STARTED, {"stl": source_path, "gcode": dest_path, "progressAvailable": slicer.get_slicer_properties()["progress_report"] if slicer else False})
eventManager().fire(Events.SLICING_STARTED, {"stl": source_path, "gcode": dest_path, "progressAvailable": slicer.get_slicer_properties().get("progress_report", False) if slicer else False})
import tempfile
f = tempfile.NamedTemporaryFile(suffix=".gco", delete=False)
@@ -228,32 +303,42 @@ class FileManager(object):
self._slicing_jobs[dest_job_key] = self._slicing_jobs[source_job_key] = (slicer_name, absolute_source_path, temp_path)
args = (source_location, source_path, temp_path, dest_location, dest_path, start_time, printer_profile_id, callback, callback_args)
return self._slicing_manager.slice(
slicer_name,
absolute_source_path,
temp_path,
profile,
stlProcessed,
position=position,
callback_args=args,
overrides=overrides,
printer_profile_id=printer_profile_id,
on_progress=self.on_slicing_progress,
on_progress_args=(slicer_name, source_location, source_path, dest_location, dest_path))
self._slicing_manager.slice(slicer_name,
absolute_source_path,
temp_path,
profile,
stlProcessed,
position=position,
callback_args=args,
overrides=overrides,
printer_profile_id=printer_profile_id,
on_progress=self.on_slicing_progress,
on_progress_args=(slicer_name, source_location, source_path, dest_location, dest_path))
def on_slicing_progress(self, slicer, source_location, source_path, dest_location, dest_path, _progress=None):
if not _progress:
return
progress_int = int(_progress * 100)
if self._last_slicing_progress == progress_int:
return
else:
if self._last_slicing_progress != progress_int:
self._last_slicing_progress = progress_int
for callback in self._slicing_progress_callbacks:
try: callback.sendSlicingProgress(slicer, source_location, source_path, dest_location, dest_path, progress_int)
except: self._logger.exception("Exception while pushing slicing progress")
if progress_int:
def call_plugins(slicer, source_location, source_path, dest_location, dest_path, progress):
for plugin in self._progress_plugins:
try:
plugin.on_slicing_progress(slicer, source_location, source_path, dest_location, dest_path, progress)
except:
self._logger.exception("Exception while sending slicing progress to plugin %s" % plugin._identifier)
import threading
thread = threading.Thread(target=call_plugins, args=(slicer, source_location, source_path, dest_location, dest_path, progress_int))
thread.daemon = False
thread.start()
for callback in self._slicing_progress_callbacks:
try: callback.sendSlicingProgress(slicer, source_location, source_path, dest_location, dest_path, progress_int)
except: self._logger.exception("Exception while pushing slicing progress")
def get_busy_files(self):
return self._slicing_jobs.keys()
@@ -272,17 +357,29 @@ class FileManager(object):
result[dst] = self._storage_managers[dst].list_files(path=path, filter=filter, recursive=recursive)
return result
def add_file(self, destination, path, file_object, links=None, allow_overwrite=False, printer_profile=None):
def add_file(self, destination, path, file_object, links=None, allow_overwrite=False, printer_profile=None, analysis=None):
if printer_profile is None:
printer_profile = self._printer_profile_manager.get_current_or_default()
file_path = self._storage(destination).add_file(path, file_object, links=links, printer_profile=printer_profile, allow_overwrite=allow_overwrite)
absolute_path = self._storage(destination).get_absolute_path(file_path)
for hook in self._preprocessor_hooks.values():
try:
hook_file_object = hook(path, file_object, links=links, printer_profile=printer_profile, allow_overwrite=allow_overwrite)
except:
self._logger.exception("Error when calling preprocessor hook {}, ignoring".format(hook))
continue
file_type = get_file_type(absolute_path)
if file_type:
queue_entry = QueueEntry(file_path, file_type[-1], destination, absolute_path, printer_profile)
self._analysis_queue.enqueue(queue_entry, high_priority=True)
if hook_file_object is not None:
file_object = hook_file_object
file_path = self._storage(destination).add_file(path, file_object, links=links, printer_profile=printer_profile, allow_overwrite=allow_overwrite)
absolute_path = self._storage(destination).path_on_disk(file_path)
if analysis is None:
file_type = get_file_type(absolute_path)
if file_type:
queue_entry = QueueEntry(file_path, file_type[-1], destination, absolute_path, printer_profile)
self._analysis_queue.enqueue(queue_entry, high_priority=True)
else:
self._add_analysis_result(destination, path, analysis)
eventManager().fire(Events.UPDATED_FILES, dict(type="printables"))
return file_path
@@ -309,21 +406,62 @@ class FileManager(object):
def remove_link(self, destination, path, rel, data):
self._storage(destination).remove_link(path, rel, data)
def log_print(self, destination, path, timestamp, print_time, success):
def log_print(self, destination, path, timestamp, print_time, success, printer_profile):
try:
self._storage(destination).add_history(path, dict(timestamp=timestamp, printTime=print_time, success=success))
if success:
self._storage(destination).add_history(path, dict(timestamp=timestamp, printTime=print_time, success=success, printerProfile=printer_profile))
else:
self._storage(destination).add_history(path, dict(timestamp=timestamp, success=success, printerProfile=printer_profile))
eventManager().fire(Events.METADATA_STATISTICS_UPDATED, dict(storage=destination, path=path))
except NoSuchStorage:
# if there's no storage configured where to log the print, we'll just not log it
pass
def save_recovery_data(self, origin, path, pos):
import time
import yaml
from octoprint.util import atomic_write
data = dict(origin=origin,
path=self.path_in_storage(origin, path),
pos=pos,
date=time.time())
try:
with atomic_write(self._recovery_file, max_permissions=0o666) as f:
yaml.safe_dump(data, stream=f, default_flow_style=False, indent=" ", allow_unicode=True)
except:
self._logger.exception("Could not write recovery data to file {}".format(self._recovery_file))
def delete_recovery_data(self):
if not os.path.isfile(self._recovery_file):
return
try:
os.remove(self._recovery_file)
except:
self._logger.exception("Error deleting recovery data file {}".format(self._recovery_file))
def get_recovery_data(self):
if not os.path.isfile(self._recovery_file):
return None
import yaml
try:
with open(self._recovery_file) as f:
data = yaml.safe_load(f)
return data
except:
self._logger.exception("Could not read recovery data from file {}".format(self._recovery_file))
self.delete_recovery_data()
def set_additional_metadata(self, destination, path, key, data, overwrite=False, merge=False):
self._storage(destination).set_additional_metadata(path, key, data, overwrite=overwrite, merge=merge)
def remove_additional_metadata(self, destination, path, key):
self._storage(destination).remove_additional_metadata(path, key)
def get_absolute_path(self, destination, path):
return self._storage(destination).get_absolute_path(path)
def path_on_disk(self, destination, path):
return self._storage(destination).path_on_disk(path)
def sanitize(self, destination, path):
return self._storage(destination).sanitize(path)
@@ -340,18 +478,21 @@ class FileManager(object):
def join_path(self, destination, *path):
return self._storage(destination).join_path(*path)
def rel_path(self, destination, path):
return self._storage(destination).rel_path(path)
def path_in_storage(self, destination, path):
return self._storage(destination).path_in_storage(path)
def _storage(self, destination):
if not destination in self._storage_managers:
raise NoSuchStorage("No storage configured for destination {destination}".format(**locals()))
return self._storage_managers[destination]
def _on_analysis_finished(self, entry, result):
if not entry.location in self._storage_managers:
def _add_analysis_result(self, destination, path, result):
if not destination in self._storage_managers:
return
storage_manager = self._storage_managers[entry.location]
storage_manager.set_additional_metadata(entry.path, "analysis", result)
storage_manager = self._storage_managers[destination]
storage_manager.set_additional_metadata(path, "analysis", result)
def _on_analysis_finished(self, entry, result):
self._add_analysis_result(entry.location, entry.path, result)
+124 -11
View File
@@ -11,6 +11,7 @@ import Queue as queue
import os
import threading
import collections
import time
from octoprint.events import Events, eventManager
@@ -18,11 +19,40 @@ import octoprint.util.gcodeInterpreter as gcodeInterpreter
class QueueEntry(collections.namedtuple("QueueEntry", "path, type, location, absolute_path, printer_profile")):
"""
A :class:`QueueEntry` for processing through the :class:`AnalysisQueue`. Wraps the entry's properties necessary
for processing.
Arguments:
path (str): Storage location specific path to the file to analyze.
type (str): Type of file to analyze, necessary to map to the correct :class:`AbstractAnalysisQueue` sub class.
At the moment, only ``gcode`` is supported here.
location (str): Location the file is located on.
absolute_path (str): Absolute path on disk through which to access the file.
printer_profile (PrinterProfile): :class:`PrinterProfile` which to use for analysis.
"""
def __str__(self):
return "{location}:{path}".format(location=self.location, path=self.path)
class AnalysisQueue(object):
"""
OctoPrint's :class:`AnalysisQueue` can manage various :class:`AbstractAnalysisQueue` implementations, mapped
by their machine code type.
At the moment, only the analysis of GCODE files for 3D printing is supported, through :class:`GcodeAnalysisQueue`.
By invoking :meth:`register_finish_callback` it is possible to register oneself as a callback to be invoked each
time the analysis of a queue entry finishes. The call parameters will be the finished queue entry as the first
and the analysis result as the second parameter. It is also possible to remove the registration again by invoking
:meth:`unregister_finish_callback`.
:meth:`enqueue` allows enqueuing :class:`QueueEntry` instances to analyze. If the :attr:`QueueEntry.type` is unknown
(no specific child class of :class:`AbstractAnalysisQueue` is registered for it), nothing will happen. Otherwise the
entry will be enqueued with the type specific analysis queue.
"""
def __init__(self):
self._logger = logging.getLogger(__name__)
self._callbacks = []
@@ -38,9 +68,10 @@ class AnalysisQueue(object):
def enqueue(self, entry, high_priority=False):
if not entry.type in self._queues:
return
return False
self._queues[entry.type].enqueue(entry, high_priority=high_priority)
return True
def pause(self):
for queue in self._queues.values():
@@ -56,6 +87,24 @@ class AnalysisQueue(object):
eventManager().fire(Events.METADATA_ANALYSIS_FINISHED, {"file": entry.path, "result": result})
class AbstractAnalysisQueue(object):
"""
The :class:`AbstractAnalysisQueue` is the parent class of all specific analysis queues such as the
:class:`GcodeAnalysisQueue`. It offers methods to enqueue new entries to analyze and pausing and resuming analysis
processing.
Arguments:
finished_callback (callable): Callback that will be called upon finishing analysis of an entry in the queue.
The callback will be called with the analyzed entry as the first argument and the analysis result as
returned from the queue implementation as the second parameter.
.. automethod:: _do_analysis
.. automethod:: _do_abort
"""
LOW_PRIO = 0
HIGH_PRIO = 100
def __init__(self, finished_callback):
self._logger = logging.getLogger(__name__)
@@ -75,16 +124,32 @@ class AbstractAnalysisQueue(object):
self._worker.start()
def enqueue(self, entry, high_priority=False):
"""
Enqueues an ``entry`` for analysis by the queue.
If ``high_priority`` is True (defaults to False), the entry will be prioritized and hence processed before
other entries in the queue with normal priority.
Arguments:
entry (QueueEntry): The :class:`QueueEntry` to analyze.
high_priority (boolean): Whether to process the provided entry with high priority (True) or not
(False, default)
"""
if high_priority:
self._logger.debug("Adding entry {entry} to analysis queue with high priority".format(entry=entry))
prio = 0
prio = self.__class__.HIGH_PRIO
else:
self._logger.debug("Adding entry {entry} to analysis queue with low priority".format(entry=entry))
prio = 100
prio = self.__class__.LOW_PRIO
self._queue.put((prio, entry))
def pause(self):
"""
Pauses processing of the queue, e.g. when a print is active.
"""
self._logger.debug("Pausing analysis")
self._active.clear()
if self._current is not None:
@@ -92,6 +157,10 @@ class AbstractAnalysisQueue(object):
self._do_abort()
def resume(self):
"""
Resumes processing of the queue, e.g. when a print has finished.
"""
self._logger.debug("Resuming analyzer")
self._active.set()
@@ -109,13 +178,15 @@ class AbstractAnalysisQueue(object):
self._active.wait()
try:
self._analyze(entry)
self._analyze(entry, high_priority=(priority == self.__class__.HIGH_PRIO))
self._queue.task_done()
except gcodeInterpreter.AnalysisAborted:
aborted = entry
self._logger.debug("Running analysis of entry {entry} aborted".format(**locals()))
else:
time.sleep(1.0)
def _analyze(self, entry):
def _analyze(self, entry, high_priority=False):
path = entry.absolute_path
if path is None or not os.path.exists(path):
return
@@ -124,28 +195,70 @@ class AbstractAnalysisQueue(object):
self._current_progress = 0
try:
self._logger.debug("Starting analysis of {entry}".format(**locals()))
self._logger.info("Starting analysis of {entry}".format(**locals()))
eventManager().fire(Events.METADATA_ANALYSIS_STARTED, {"file": entry.path, "type": entry.type})
result = self._do_analysis()
try:
result = self._do_analysis(high_priority=high_priority)
except TypeError:
result = self._do_analysis()
self._logger.debug("Analysis of entry {entry} finished, notifying callback".format(**locals()))
self._finished_callback(self._current, result)
finally:
self._current = None
self._current_progress = None
def _do_analysis(self):
def _do_analysis(self, high_priority=False):
"""
Performs the actual analysis of the current entry which can be accessed via ``self._current``. Needs to be
overridden by sub classes.
Arguments:
high_priority (bool): Whether the current entry has high priority or not.
Returns:
object: The result of the analysis which will be forwarded to the ``finished_callback`` provided during
construction.
"""
return None
def _do_abort(self):
"""
Aborts analysis of the current entry. Needs to be overridden by sub classes.
"""
pass
class GcodeAnalysisQueue(AbstractAnalysisQueue):
"""
A queue to analyze GCODE files. Analysis results are :class:`dict` instances structured as follows:
def _do_analysis(self):
.. list-table::
:widths: 25 70
- * **Key**
* **Description**
- * ``estimatedPrintTime``
* Estimated time the file take to print, in minutes
- * ``filament``
* Substructure describing estimated filament usage. Keys are ``tool0`` for the first extruder, ``tool1`` for
the second and so on. For each tool extruded length and volume (based on diameter) are provided.
- * ``filament.toolX.length``
* The extruded length in mm
- * ``filament.toolX.volume``
* The extruded volume in cm³
"""
def _do_analysis(self, high_priority=False):
try:
def throttle():
time.sleep(0.01)
throttle_callback = throttle
if high_priority:
throttle_callback = None
self._gcode = gcodeInterpreter.gcode()
self._gcode.load(self._current.absolute_path, self._current.printer_profile)
self._gcode.load(self._current.absolute_path, self._current.printer_profile, throttle=throttle_callback)
result = dict()
if self._gcode.totalMoveTimeMinute:
@@ -163,4 +276,4 @@ class GcodeAnalysisQueue(AbstractAnalysisQueue):
def _do_abort(self):
if self._gcode:
self._gcode.abort()
self._gcode.abort()
File diff suppressed because it is too large. Load diff
+241
View File
@@ -0,0 +1,241 @@
# coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License"
import io
from octoprint.util import atomic_write
class AbstractFileWrapper(object):
"""
Wrapper for file representations to save to storages.
Arguments:
filename (str): The file's name
"""
def __init__(self, filename):
self.filename = filename
def save(self, path):
"""
Saves the file's content to the given absolute path.
Arguments:
path (str): The absolute path to where to save the file
"""
raise NotImplementedError()
def stream(self):
"""
Returns a Python stream object (subclass of io.IOBase) representing the file's contents.
Returns:
io.IOBase: The file's contents as a stream.
"""
raise NotImplementedError()
class DiskFileWrapper(AbstractFileWrapper):
"""
An implementation of :class:`.AbstractFileWrapper` that wraps an actual file on disk. The `save` implementations
will either copy the file to the new path (preserving file attributes) or -- if `move` is `True` (the default) --
move the file.
Arguments:
filename (str): The file's name
path (str): The file's absolute path
move (boolean): Whether to move the file upon saving (True, default) or copying.
"""
def __init__(self, filename, path, move=True):
AbstractFileWrapper.__init__(self, filename)
self.path = path
self.move = move
def save(self, path):
import shutil
if self.move:
shutil.move(self.path, path)
else:
shutil.copy2(self.path, path)
def stream(self):
return io.open(self.path, "rb")
class StreamWrapper(AbstractFileWrapper):
"""
A wrapper allowing processing of one or more consecutive streams.
Arguments:
*streams (io.IOBase): One or more streams to process one after another to save to storage.
"""
def __init__(self, filename, *streams):
if not len(streams) > 0:
raise ValueError("Need at least one stream to wrap")
AbstractFileWrapper.__init__(self, filename)
self.streams = streams
def save(self, path):
"""
Will dump the contents of all streams provided during construction into the target file, in the order they were
provided.
"""
import shutil
with atomic_write(path, "wb") as dest:
with self.stream() as source:
shutil.copyfileobj(source, dest)
def stream(self):
"""
If more than one stream was provided to the constructor, will return a :class:`.MultiStream` wrapping all
provided streams in the order they were provided, else the first and only stream is returned directly.
"""
if len(self.streams) > 1:
return MultiStream(*self.streams)
else:
return self.streams[0]
class MultiStream(io.RawIOBase):
"""
A stream implementation which when read reads from multiple streams, one after the other, basically concatenating
their contents in the order they are provided to the constructor.
Arguments:
*streams (io.IOBase): One or more streams to concatenate.
"""
def __init__(self, *streams):
io.RawIOBase.__init__(self)
self.streams = streams
self.current_stream = 0
def read(self, n=-1):
if n == 0:
return b''
if len(self.streams) == 0:
return b''
while self.current_stream < len(self.streams):
stream = self.streams[self.current_stream]
result = stream.read(n)
if result is None or len(result) != 0:
return result
else:
self.current_stream += 1
return b''
def readinto(self, b):
n = len(b)
read = self.read(n)
b[:len(read)] = read
return len(read)
def close(self):
for stream in self.streams:
try:
stream.close()
except:
pass
def readable(self, *args, **kwargs):
return True
def seekable(self, *args, **kwargs):
return False
def writable(self, *args, **kwargs):
return False
class LineProcessorStream(io.RawIOBase):
"""
While reading from this stream the provided `input_stream` is read line by line, calling the (overridable) method
:meth:`.process_line` for each read line.
Sub classes can thus modify the contents of the `input_stream` in line, while it is being read.
Arguments:
input_stream (io.IOBase): The stream to process on the fly.
"""
def __init__(self, input_stream):
io.RawIOBase.__init__(self)
self.input_stream = io.BufferedReader(input_stream)
self.leftover = None
def read(self, n=-1):
if n == 0:
return b''
result = b''
while len(result) < n or n == -1:
bytes_left = (n - len(result)) if n != -1 else -1
if self.leftover is not None:
if bytes_left != -1 and bytes_left < len(self.leftover):
result += self.leftover[:bytes_left]
self.leftover = self.leftover[bytes_left:]
break
else:
result += self.leftover
self.leftover = None
processed_line = None
while processed_line is None:
line = self.input_stream.readline()
if not line:
break
processed_line = self.process_line(line)
if processed_line is None:
break
bytes_left = (n - len(result)) if n != -1 else -1
if bytes_left != -1 and bytes_left < len(processed_line):
result += processed_line[:bytes_left]
self.leftover = processed_line[bytes_left:]
break
else:
result += processed_line
return result
def readinto(self, b):
n = len(b)
read = self.read(n)
b[:len(read)] = read
return len(read)
def process_line(self, line):
"""
Called from the `read` Method of this stream with each line read from `self.input_stream`.
By returning ``None`` the line will not be returned from the read stream, effectively being stripped from the
wrapper `input_stream`.
Arguments:
line (str): The line as read from `self.input_stream`
Returns:
str or None: The processed version of the line (might also be multiple lines), or None if the line is to be
stripped from the processed stream.
"""
return line
def close(self):
self.input_stream.close()
def readable(self, *args, **kwargs):
return True
def seekable(self, *args, **kwargs):
return False
def writable(self, *args, **kwargs):
return False
+4
View File
@@ -0,0 +1,4 @@
# coding=utf-8
from __future__ import absolute_import
from . import handlers
+83
View File
@@ -0,0 +1,83 @@
# coding=utf-8
from __future__ import absolute_import
import logging.handlers
import os
import re
import time
class CleaningTimedRotatingFileHandler(logging.handlers.TimedRotatingFileHandler):
def __init__(self, *args, **kwargs):
logging.handlers.TimedRotatingFileHandler.__init__(self, *args, **kwargs)
# clean up old files on handler start
if self.backupCount > 0:
for s in self.getFilesToDelete():
os.remove(s)
class SerialLogHandler(logging.handlers.RotatingFileHandler):
_do_rollover = False
_suffix_template = "%Y-%m-%d_%H-%M-%S"
_file_pattern = re.compile(r"^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}$")
@classmethod
def on_open_connection(cls):
cls._do_rollover = True
def __init__(self, *args, **kwargs):
logging.handlers.RotatingFileHandler.__init__(self, *args, **kwargs)
self.cleanupFiles()
def emit(self, record):
logging.handlers.RotatingFileHandler.emit(self, record)
def shouldRollover(self, record):
return self.__class__._do_rollover
def getFilesToDelete(self):
"""
Determine the files to delete when rolling over.
"""
dirName, baseName = os.path.split(self.baseFilename)
fileNames = os.listdir(dirName)
result = []
prefix = baseName + "."
plen = len(prefix)
for fileName in fileNames:
if fileName[:plen] == prefix:
suffix = fileName[plen:]
if self.__class__._file_pattern.match(suffix):
result.append(os.path.join(dirName, fileName))
result.sort()
if len(result) < self.backupCount:
result = []
else:
result = result[:len(result) - self.backupCount]
return result
def cleanupFiles(self):
if self.backupCount > 0:
for path in self.getFilesToDelete():
os.remove(path)
def doRollover(self):
self.__class__._do_rollover = False
if self.stream:
self.stream.close()
self.stream = None
if os.path.exists(self.baseFilename):
# figure out creation date/time to use for file suffix
t = time.localtime(os.stat(self.baseFilename).st_mtime)
dfn = self.baseFilename + "." + time.strftime(self.__class__._suffix_template, t)
if os.path.exists(dfn):
os.remove(dfn)
os.rename(self.baseFilename, dfn)
self.cleanupFiles()
if not self.delay:
self.stream = self._open()
+432 -60
View File
@@ -1,4 +1,18 @@
# coding=utf-8
"""
This module represents OctoPrint's plugin subsystem. This includes management and helper methods as well as the
registered plugin types.
.. autofunction:: plugin_manager
.. autofunction:: plugin_settings
.. autofunction:: call_plugin
.. autoclass:: PluginSettings
:members:
"""
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
@@ -6,20 +20,78 @@ __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agp
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import os
import logging
from octoprint.settings import settings
from octoprint.plugin.core import (PluginInfo, PluginManager, Plugin)
from octoprint.plugin.types import *
from octoprint.util import deprecated
# singleton
_instance = None
def plugin_manager(init=False, plugin_folders=None, plugin_types=None, plugin_entry_points=None, plugin_disabled_list=None):
def _validate_plugin(phase, plugin_info):
if phase == "after_load":
if plugin_info.implementation is not None and isinstance(plugin_info.implementation, AppPlugin):
# transform app plugin into hook
import warnings
warnings.warn("{name} uses deprecated plugin mixin AppPlugin, use octoprint.accesscontrol.appkey hook instead".format(name=plugin_info.key), DeprecationWarning)
hooks = plugin_info.hooks
if not "octoprint.accesscontrol.appkey" in hooks:
hooks["octoprint.accesscontrol.appkey"] = plugin_info.implementation.get_additional_apps
setattr(plugin_info.instance, PluginInfo.attr_hooks, hooks)
def plugin_manager(init=False, plugin_folders=None, plugin_types=None, plugin_entry_points=None, plugin_disabled_list=None,
plugin_restart_needing_hooks=None, plugin_obsolete_hooks=None, plugin_validators=None):
"""
Factory method for initially constructing and consecutively retrieving the :class:`~octoprint.plugin.core.PluginManager`
singleton.
Arguments:
init (boolean): A flag indicating whether this is the initial call to construct the singleton (True) or not
(False, default). If this is set to True and the plugin manager has already been initialized, a :class:`ValueError`
will be raised. The same will happen if the plugin manager has not yet been initialized and this is set to
False.
plugin_folders (list): A list of folders (as strings containing the absolute path to them) in which to look for
potential plugin modules. If not provided this defaults to the configured ``plugins`` base folder and
``src/plugins`` within OctoPrint's code base.
plugin_types (list): A list of recognized plugin types for which to look for provided implementations. If not
provided this defaults to the plugin types found in :mod:`octoprint.plugin.types` without
:class:`~octoprint.plugin.OctoPrintPlugin`.
plugin_entry_points (list): A list of entry points pointing to modules which to load as plugins. If not provided
this defaults to the entry point ``octoprint.plugin``.
plugin_disabled_list (list): A list of plugin identifiers that are currently disabled. If not provided this
defaults to all plugins for which ``enabled`` is set to ``False`` in the settings.
plugin_restart_needing_hooks (list): A list of hook namespaces which cause a plugin to need a restart in order
be enabled/disabled. Does not have to contain full hook identifiers, will be matched with startswith similar
to logging handlers
plugin_obsolete_hooks (list): A list of hooks that have been declared obsolete. Plugins implementing them will
not be enabled since they might depend on functionality that is no longer available.
plugin_validators (list): A list of additional plugin validators through which to process each plugin.
Returns:
PluginManager: A fully initialized :class:`~octoprint.plugin.core.PluginManager` instance to be used for plugin
management tasks.
Raises:
ValueError: ``init`` was True although the plugin manager was already initialized, or it was False although
the plugin manager was not yet initialized.
"""
global _instance
if _instance is None:
if _instance is not None:
if init:
raise ValueError("Plugin Manager already initialized")
else:
if init:
if plugin_folders is None:
plugin_folders = (settings().getBaseFolder("plugins"), os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "plugins")))
plugin_folders = (
settings().getBaseFolder("plugins"),
(os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "plugins")), True)
)
if plugin_types is None:
plugin_types = [StartupPlugin,
ShutdownPlugin,
@@ -30,27 +102,94 @@ def plugin_manager(init=False, plugin_folders=None, plugin_types=None, plugin_en
BlueprintPlugin,
EventHandlerPlugin,
SlicerPlugin,
AppPlugin]
AppPlugin,
ProgressPlugin]
if plugin_entry_points is None:
plugin_entry_points = "octoprint.plugin"
if plugin_disabled_list is None:
all_plugin_settings = settings().get(["plugins"])
plugin_disabled_list = []
for key in all_plugin_settings:
if "enabled" in all_plugin_settings[key] and not all_plugin_settings[key]:
plugin_disabled_list.append(key)
plugin_disabled_list = settings().get(["plugins", "_disabled"])
if plugin_restart_needing_hooks is None:
plugin_restart_needing_hooks = [
"octoprint.server.http"
]
if plugin_obsolete_hooks is None:
plugin_obsolete_hooks = [
"octoprint.comm.protocol.gcode"
]
if plugin_validators is None:
plugin_validators = [
_validate_plugin
]
_instance = PluginManager(plugin_folders, plugin_types, plugin_entry_points, plugin_disabled_list=plugin_disabled_list)
_instance = PluginManager(plugin_folders,
plugin_types,
plugin_entry_points,
logging_prefix="octoprint.plugins.",
plugin_disabled_list=plugin_disabled_list,
plugin_restart_needing_hooks=plugin_restart_needing_hooks,
plugin_obsolete_hooks=plugin_obsolete_hooks,
plugin_validators=plugin_validators)
else:
raise ValueError("Plugin Manager not initialized yet")
return _instance
def plugin_settings(plugin_key, defaults=None):
return PluginSettings(settings(), plugin_key, defaults=defaults)
def plugin_settings(plugin_key, defaults=None, get_preprocessors=None, set_preprocessors=None):
"""
Factory method for creating a :class:`PluginSettings` instance.
Arguments:
plugin_key (string): The plugin identifier for which to create the settings instance.
defaults (dict): The default settings for the plugin.
get_preprocessors (dict): The getter preprocessors for the plugin.
set_preprocessors (dict): The setter preprocessors for the plugin.
Returns:
PluginSettings: A fully initialized :class:`PluginSettings` instance to be used to access the plugin's
settings
"""
return PluginSettings(settings(), plugin_key, defaults=defaults, get_preprocessors=get_preprocessors, set_preprocessors=set_preprocessors)
def call_plugin(types, method, args=None, kwargs=None, callback=None):
def call_plugin(types, method, args=None, kwargs=None, callback=None, error_callback=None):
"""
Helper method to invoke the indicated ``method`` on all registered plugin implementations implementing the
indicated ``types``. Allows providing method arguments and registering callbacks to call in case of success
and/or failure of each call which can be used to return individual results to the calling code.
Example:
.. sourcecode:: python
def my_success_callback(name, plugin, result):
print("{name} was called successfully and returned {result!r}".format(**locals()))
def my_error_callback(name, plugin, exc):
print("{name} raised an exception: {exc!s}".format(**locals()))
octoprint.plugin.call_plugin(
[octoprint.plugin.StartupPlugin],
"on_startup",
args=(my_host, my_port),
callback=my_success_callback,
error_callback=my_error_callback
)
Arguments:
types (list): A list of plugin implementation types to match against.
method (string): Name of the method to call on all matching implementations.
args (tuple): A tuple containing the arguments to supply to the called ``method``. Optional.
kwargs (dict): A dictionary containing the keyword arguments to supply to the called ``method``. Optional.
callback (function): A callback to invoke after an implementation has been called successfully. Will be called
with the three arguments ``name``, ``plugin`` and ``result``. ``name`` will be the plugin identifier,
``plugin`` the plugin implementation instance itself and ``result`` the result returned from the
``method`` invocation.
error_callback (function): A callback to invoke after the call of an implementation resulted in an exception.
Will be called with the three arguments ``name``, ``plugin`` and ``exc``. ``name`` will be the plugin
identifier, ``plugin`` the plugin implementation instance itself and ``exc`` the caught exception.
"""
if not isinstance(types, (list, tuple)):
types = [types]
if args is None:
@@ -59,15 +198,82 @@ def call_plugin(types, method, args=None, kwargs=None, callback=None):
kwargs = dict()
plugins = plugin_manager().get_implementations(*types)
for name, plugin in plugins.items():
for plugin in plugins:
if hasattr(plugin, method):
result = getattr(plugin, method)(*args, **kwargs)
if callback:
callback(name, plugin, result)
try:
result = getattr(plugin, method)(*args, **kwargs)
if callback:
callback(plugin._identifier, plugin, result)
except Exception as exc:
logging.getLogger(__name__).exception("Error while calling plugin %s" % plugin._identifier)
if error_callback:
error_callback(plugin._identifier, plugin, exc)
class PluginSettings(object):
def __init__(self, settings, plugin_key, defaults=None):
"""
The :class:`PluginSettings` class is the interface for plugins to their own or globally defined settings.
It provides a couple of convenience methods for directly accessing plugin settings via the regular
:class:`octoprint.settings.Settings` interfaces as well as means to access plugin specific folder locations.
All getter and setter methods will ensure that plugin settings are stored in their correct location within the
settings structure by modifying the supplied paths accordingly.
Arguments:
settings (Settings): The :class:`~octoprint.settings.Settings` instance on which to operate.
plugin_key (str): The plugin identifier of the plugin for which to create this instance.
defaults (dict): The plugin's defaults settings, will be used to determine valid paths within the plugin's
settings structure
.. method:: get(path, merged=False, asdict=False)
Retrieves a raw value from the settings for ``path``, optionally merging the raw value with the default settings
if ``merged`` is set to True.
:param path: The path for which to retrieve the value.
:type path: list, tuple
:param boolean merged: Whether to merge the returned result with the default settings (True) or not (False,
default).
:returns: The retrieved settings value.
:rtype: object
.. method:: get_int(path)
Like :func:`get` but tries to convert the retrieved value to ``int``.
.. method:: get_float(path)
Like :func:`get` but tries to convert the retrieved value to ``float``.
.. method:: get_boolean(path)
Like :func:`get` but tries to convert the retrieved value to ``boolean``.
.. method:: set(path, value, force=False)
Sets the raw value on the settings for ``path``.
:param path: The path for which to retrieve the value.
:type path: list, tuple
:param object value: The value to set.
:param boolean force: If set to True, the modified configuration will even be written back to disk if
the value didn't change.
.. method:: set_int(path, value, force=False)
Like :func:`set` but ensures the value is an ``int`` through attempted conversion before setting it.
.. method:: set_float(path, value, force=False)
Like :func:`set` but ensures the value is an ``float`` through attempted conversion before setting it.
.. method:: set_boolean(path, value, force=False)
Like :func:`set` but ensures the value is an ``boolean`` through attempted conversion before setting it.
"""
def __init__(self, settings, plugin_key, defaults=None, get_preprocessors=None, set_preprocessors=None):
self.settings = settings
self.plugin_key = plugin_key
@@ -75,77 +281,243 @@ class PluginSettings(object):
defaults = dict()
self.defaults = dict(plugins=dict())
self.defaults["plugins"][plugin_key] = defaults
self.defaults["plugins"][plugin_key]["_config_version"] = None
def prefix_path(path):
return ['plugins', self.plugin_key] + path
if get_preprocessors is None:
get_preprocessors = dict()
self.get_preprocessors = dict(plugins=dict())
self.get_preprocessors["plugins"][plugin_key] = get_preprocessors
if set_preprocessors is None:
set_preprocessors = dict()
self.set_preprocessors = dict(plugins=dict())
self.set_preprocessors["plugins"][plugin_key] = set_preprocessors
def prefix_path_in_args(args, index=0):
result = []
if index == 0:
result.append(prefix_path(args[0]))
result.append(self._prefix_path(args[0]))
result.extend(args[1:])
else:
args_before = args[:index - 1]
args_after = args[index + 1:]
result.extend(args_before)
result.append(prefix_path(args[index]))
result.append(self._prefix_path(args[index]))
result.extend(args_after)
return result
def add_defaults_to_kwargs(kwargs):
kwargs.update(dict(defaults=self.defaults))
def add_getter_kwargs(kwargs):
if not "defaults" in kwargs:
kwargs.update(defaults=self.defaults)
if not "preprocessors" in kwargs:
kwargs.update(preprocessors=self.get_preprocessors)
return kwargs
self.access_methods = {
'get': (lambda args: prefix_path_in_args(args), lambda kwargs: add_defaults_to_kwargs(kwargs)),
'getInt': (lambda args,: prefix_path_in_args(args), lambda kwargs: add_defaults_to_kwargs(kwargs)),
'getFloat': (lambda args,: prefix_path_in_args(args), lambda kwargs: add_defaults_to_kwargs(kwargs)),
'getBoolean': (lambda args,: prefix_path_in_args(args), lambda kwargs: add_defaults_to_kwargs(kwargs)),
'set': (lambda args: prefix_path_in_args(args), lambda kwargs: add_defaults_to_kwargs(kwargs)),
'setInt': (lambda args: prefix_path_in_args(args), lambda kwargs: add_defaults_to_kwargs(kwargs)),
'setFloat': (lambda args: prefix_path_in_args(args), lambda kwargs: add_defaults_to_kwargs(kwargs)),
'setBoolean': (lambda args: prefix_path_in_args(args), lambda kwargs: add_defaults_to_kwargs(kwargs))
}
def add_setter_kwargs(kwargs):
if not "defaults" in kwargs:
kwargs.update(defaults=self.defaults)
if not "preprocessors" in kwargs:
kwargs.update(preprocessors=self.set_preprocessors)
return kwargs
def globalGet(self, path):
return self.settings.get(path)
self.access_methods = dict(
has =("has", prefix_path_in_args, add_getter_kwargs),
get =("get", prefix_path_in_args, add_getter_kwargs),
get_int =("getInt", prefix_path_in_args, add_getter_kwargs),
get_float =("getFloat", prefix_path_in_args, add_getter_kwargs),
get_boolean=("getBoolean", prefix_path_in_args, add_getter_kwargs),
set =("set", prefix_path_in_args, add_setter_kwargs),
set_int =("setInt", prefix_path_in_args, add_setter_kwargs),
set_float =("setFloat", prefix_path_in_args, add_setter_kwargs),
set_boolean=("setBoolean", prefix_path_in_args, add_setter_kwargs),
remove =("remove", prefix_path_in_args, lambda x: x)
)
self.deprecated_access_methods = dict(
getInt ="get_int",
getFloat ="get_float",
getBoolean="get_boolean",
setInt ="set_int",
setFloat ="set_float",
setBoolean="set_boolean"
)
def globalGetInt(self, path):
return self.settings.getInt(path)
def _prefix_path(self, path=None):
if path is None:
path = list()
return ['plugins', self.plugin_key] + path
def globalGetFloat(self, path):
return self.settings.getFloat(path)
def global_has(self, path, **kwargs):
return self.settings.has(path, **kwargs)
def globalGetBoolean(self, path):
return self.settings.getBoolean(path)
def global_remove(self, path, **kwargs):
return self.settings.remove(path, **kwargs)
def globalSet(self, path, value):
self.settings.set(path, value)
def global_get(self, path, **kwargs):
"""
Getter for retrieving settings not managed by the plugin itself from the core settings structure. Use this
to access global settings outside of your plugin.
def globalSetInt(self, path, value):
self.settings.setInt(path, value)
Directly forwards to :func:`octoprint.settings.Settings.get`.
"""
return self.settings.get(path, **kwargs)
def globalSetFloat(self, path, value):
self.settings.setFloat(path, value)
def global_get_int(self, path, **kwargs):
"""
Like :func:`global_get` but directly forwards to :func:`octoprint.settings.Settings.getInt`.
"""
return self.settings.getInt(path, **kwargs)
def globalSetBoolean(self, path, value):
self.settings.setBoolean(path, value)
def global_get_float(self, path, **kwargs):
"""
Like :func:`global_get` but directly forwards to :func:`octoprint.settings.Settings.getFloat`.
"""
return self.settings.getFloat(path, **kwargs)
def globalGetBaseFolder(self, folder_type):
return self.settings.getBaseFolder(folder_type)
def global_get_boolean(self, path, **kwargs):
"""
Like :func:`global_get` but directly orwards to :func:`octoprint.settings.Settings.getBoolean`.
"""
return self.settings.getBoolean(path, **kwargs)
def getPluginLogfilePath(self, postfix=None):
def global_set(self, path, value, **kwargs):
"""
Setter for modifying settings not managed by the plugin itself on the core settings structure. Use this
to modify global settings outside of your plugin.
Directly forwards to :func:`octoprint.settings.Settings.set`.
"""
self.settings.set(path, value, **kwargs)
def global_set_int(self, path, value, **kwargs):
"""
Like :func:`global_set` but directly forwards to :func:`octoprint.settings.Settings.setInt`.
"""
self.settings.setInt(path, value, **kwargs)
def global_set_float(self, path, value, **kwargs):
"""
Like :func:`global_set` but directly forwards to :func:`octoprint.settings.Settings.setFloat`.
"""
self.settings.setFloat(path, value, **kwargs)
def global_set_boolean(self, path, value, **kwargs):
"""
Like :func:`global_set` but directly forwards to :func:`octoprint.settings.Settings.setBoolean`.
"""
self.settings.setBoolean(path, value, **kwargs)
def global_get_basefolder(self, folder_type, **kwargs):
"""
Retrieves a globally defined basefolder of the given ``folder_type``. Directly forwards to
:func:`octoprint.settings.Settings.getBaseFolder`.
"""
return self.settings.getBaseFolder(folder_type, **kwargs)
def get_plugin_logfile_path(self, postfix=None):
"""
Retrieves the path to a logfile specifically for the plugin. If ``postfix`` is not supplied, the logfile
will be named ``plugin_<plugin identifier>.log`` and located within the configured ``logs`` folder. If a
postfix is supplied, the name will be ``plugin_<plugin identifier>_<postfix>.log`` at the same location.
Plugins may use this for specific logging tasks. For example, a :class:`~octoprint.plugin.SlicingPlugin` might
want to create a log file for logging the output of the slicing engine itself if some debug flag is set.
Arguments:
postfix (str): Postfix of the logfile for which to create the path. If set, the file name of the log file
will be ``plugin_<plugin identifier>_<postfix>.log``, if not it will be
``plugin_<plugin identifier>.log``.
Returns:
str: Absolute path to the log file, directly usable by the plugin.
"""
filename = "plugin_" + self.plugin_key
if postfix is not None:
filename += "_" + postfix
filename += ".log"
return os.path.join(self.settings.getBaseFolder("logs"), filename)
def __getattr__(self, item):
if item in self.access_methods and hasattr(self.settings, item) and callable(getattr(self.settings, item)):
orig_item = getattr(self.settings, item)
args_mapper, kwargs_mapper = self.access_methods[item]
@deprecated("PluginSettings.get_plugin_data_folder has been replaced by OctoPrintPlugin.get_plugin_data_folder",
includedoc="Replaced by :func:`~octoprint.plugin.types.OctoPrintPlugin.get_plugin_data_folder`",
since="1.2.0")
def get_plugin_data_folder(self):
path = os.path.join(self.settings.getBaseFolder("data"), self.plugin_key)
if not os.path.isdir(path):
os.makedirs(path)
return path
return lambda *args, **kwargs: orig_item(*args_mapper(args), **kwargs_mapper(kwargs))
else:
return getattr(self.settings, item)
def get_all_data(self, **kwargs):
merged = kwargs.get("merged", True)
asdict = kwargs.get("asdict", True)
defaults = kwargs.get("defaults", self.defaults)
preprocessors = kwargs.get("preprocessors", self.get_preprocessors)
kwargs.update(dict(
merged=merged,
asdict=asdict,
defaults=defaults,
preprocessors=preprocessors
))
return self.settings.get(self._prefix_path(), **kwargs)
def clean_all_data(self):
self.settings.remove(self._prefix_path())
def __getattr__(self, item):
all_access_methods = self.access_methods.keys() + self.deprecated_access_methods.keys()
if item in all_access_methods:
decorator = None
if item in self.deprecated_access_methods:
new = self.deprecated_access_methods[item]
decorator = deprecated("{old} has been renamed to {new}".format(old=item, new=new), stacklevel=2)
item = new
settings_name, args_mapper, kwargs_mapper = self.access_methods[item]
if hasattr(self.settings, settings_name) and callable(getattr(self.settings, settings_name)):
orig_func = getattr(self.settings, settings_name)
if decorator is not None:
orig_func = decorator(orig_func)
def _func(*args, **kwargs):
return orig_func(*args_mapper(args), **kwargs_mapper(kwargs))
_func.__name__ = item
_func.__doc__ = orig_func.__doc__ if "__doc__" in dir(orig_func) else None
return _func
return getattr(self.settings, item)
##~~ deprecated methods follow
# TODO: Remove with release of 1.3.0
globalGet = deprecated("globalGet has been renamed to global_get",
includedoc="Replaced by :func:`global_get`",
since="1.2.0-dev-546")(global_get)
globalGetInt = deprecated("globalGetInt has been renamed to global_get_int",
includedoc="Replaced by :func:`global_get_int`",
since="1.2.0-dev-546")(global_get_int)
globalGetFloat = deprecated("globalGetFloat has been renamed to global_get_float",
includedoc="Replaced by :func:`global_get_float`",
since="1.2.0-dev-546")(global_get_float)
globalGetBoolean = deprecated("globalGetBoolean has been renamed to global_get_boolean",
includedoc="Replaced by :func:`global_get_boolean`",
since="1.2.0-dev-546")(global_get_boolean)
globalSet = deprecated("globalSet has been renamed to global_set",
includedoc="Replaced by :func:`global_set`",
since="1.2.0-dev-546")(global_set)
globalSetInt = deprecated("globalSetInt has been renamed to global_set_int",
includedoc="Replaced by :func:`global_set_int`",
since="1.2.0-dev-546")(global_set_int)
globalSetFloat = deprecated("globalSetFloat has been renamed to global_set_float",
includedoc="Replaced by :func:`global_set_float`",
since="1.2.0-dev-546")(global_set_float)
globalSetBoolean = deprecated("globalSetBoolean has been renamed to global_set_boolean",
includedoc="Replaced by :func:`global_set_boolean`",
since="1.2.0-dev-546")(global_set_boolean)
globalGetBaseFolder = deprecated("globalGetBaseFolder has been renamed to global_get_basefolder",
includedoc="Replaced by :func:`global_get_basefolder`",
since="1.2.0-dev-546")(global_get_basefolder)
getPluginLogfilePath = deprecated("getPluginLogfilePath has been renamed to get_plugin_logfile_path",
includedoc="Replaced by :func:`get_plugin_logfile_path`",
since="1.2.0-dev-546")(get_plugin_logfile_path)
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,356 @@
# coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2016 The OctoPrint Project - Released under terms of the AGPLv3 License"
import octoprint.plugin
import calendar
import codecs
import os
import re
import time
import threading
import feedparser
import flask
from octoprint.server import admin_permission
from octoprint.server.util.flask import restricted_access
from flask.ext.babel import gettext
class AnnouncementPlugin(octoprint.plugin.AssetPlugin,
octoprint.plugin.SettingsPlugin,
octoprint.plugin.BlueprintPlugin,
octoprint.plugin.StartupPlugin,
octoprint.plugin.TemplatePlugin):
def __init__(self):
self._cached_channel_configs = None
self._cached_channel_configs_mutex = threading.RLock()
from slugify import Slugify
self._slugify = Slugify()
self._slugify.safe_chars = "-_."
# StartupPlugin
def on_after_startup(self):
self._fetch_all_channels()
# SettingsPlugin
def get_settings_defaults(self):
return dict(channels=dict(_important=dict(name="Important OctoPrint Announcements",
priority=1,
type="rss",
url="http://octoprint.org/feeds/important.xml",
read_until=1449446400),
_news=dict(name="OctoPrint News",
priority=2,
type="rss",
url="http://octoprint.org/feeds/news.xml"),
_releases=dict(name="OctoPrint Release Announcements",
priority=2,
type="rss",
url="http://octoprint.org/feeds/releases.xml"),
_spotlight=dict(name="OctoPrint Community Spotlights",
priority=2,
type="rss",
url="http://octoprint.org/feeds/spotlight.xml"),
_octopi=dict(name="OctoPi Announcements",
priority=2,
type="rss",
url="http://octoprint.org/feeds/octopi.xml"),
_plugins=dict(name="New Plugins in the Repository",
priority=2,
type="rss",
url="http://plugins.octoprint.org/feed.xml")),
enabled_channels=[],
forced_channels=["_important"],
ttl=6*60,
display_limit=3,
summary_limit=300)
# AssetPlugin
def get_assets(self):
return dict(js=["js/announcements.js"],
less=["less/announcements.less"],
css=["css/announcements.css"])
# Template Plugin
def get_template_configs(self):
return [
dict(type="settings", name=gettext("Announcements"), template="announcements_settings.jinja2", custom_bindings=True),
dict(type="navbar", template="announcements_navbar.jinja2", styles=["display: none"], data_bind="visible: loginState.isAdmin")
]
# Blueprint Plugin
@octoprint.plugin.BlueprintPlugin.route("/channels", methods=["GET"])
@restricted_access
@admin_permission.require(403)
def get_channel_data(self):
from octoprint.settings import valid_boolean_trues
result = dict()
force = "force" in flask.request.values and flask.request.values["force"] in valid_boolean_trues
channel_data = self._fetch_all_channels(force=force)
channel_configs = self._get_channel_configs(force=force)
enabled = self._settings.get(["enabled_channels"])
forced = self._settings.get(["forced_channels"])
for key, data in channel_configs.items():
read_until = channel_configs[key].get("read_until", None)
entries = sorted(self._to_internal_feed(channel_data.get(key, []), read_until=read_until), key=lambda e: e["published"], reverse=True)
unread = len(filter(lambda e: not e["read"], entries))
if read_until is None and entries:
last = entries[0]["published"]
self._mark_read_until(key, last)
result[key] = dict(channel=data["name"],
url=data["url"],
priority=data.get("priority", 2),
enabled=key in enabled or key in forced,
forced=key in forced,
data=entries,
unread=unread)
return flask.jsonify(result)
@octoprint.plugin.BlueprintPlugin.route("/channels/<channel>", methods=["POST"])
@restricted_access
@admin_permission.require(403)
def channel_command(self, channel):
from octoprint.server.util.flask import get_json_command_from_request
from octoprint.server import NO_CONTENT
valid_commands = dict(read=["until"],
toggle=[])
command, data, response = get_json_command_from_request(flask.request, valid_commands=valid_commands)
if response is not None:
return response
if command == "read":
until = data["until"]
self._mark_read_until(channel, until)
elif command == "toggle":
self._toggle(channel)
return NO_CONTENT
# Internal Tools
def _mark_read_until(self, channel, until):
"""Set read_until timestamp of a channel."""
current_read_until = None
channel_data = self._settings.get(["channels", channel], merged=True)
if channel_data:
current_read_until = channel_data.get("read_until", None)
defaults = dict(plugins=dict(announcements=dict(channels=dict())))
defaults["plugins"]["announcements"]["channels"][channel] = dict(read_until=current_read_until)
with self._cached_channel_configs_mutex:
self._settings.set(["channels", channel, "read_until"], until, defaults=defaults)
self._settings.save()
self._cached_channel_configs = None
def _toggle(self, channel):
"""Toggle enable/disabled state of a channel."""
enabled_channels = list(self._settings.get(["enabled_channels"]))
if channel in enabled_channels:
enabled_channels.remove(channel)
else:
enabled_channels.append(channel)
self._settings.set(["enabled_channels"], enabled_channels)
self._settings.save()
def _get_channel_configs(self, force=False):
"""Retrieve all channel configs with sanitized keys."""
with self._cached_channel_configs_mutex:
if self._cached_channel_configs is None or force:
configs = self._settings.get(["channels"], merged=True)
result = dict()
for key, config in configs.items():
if "url" not in config or "name" not in config:
# strip invalid entries
continue
result[self._slugify(key)] = config
self._cached_channel_configs = result
return self._cached_channel_configs
def _get_channel_config(self, key, force=False):
"""Retrieve specific channel config for channel."""
safe_key = self._slugify(key)
return self._get_channel_configs(force=force).get(safe_key)
def _fetch_all_channels(self, force=False):
"""Fetch all channel feeds from cache or network."""
channels = self._get_channel_configs(force=force)
enabled = self._settings.get(["enabled_channels"])
forced = self._settings.get(["forced_channels"])
all_channels = dict()
for key, config in channels.items():
if not key in enabled and not key in forced:
continue
if not "url" in config:
continue
data = self._get_channel_data(key, config, force=force)
if data is not None:
all_channels[key] = data
return all_channels
def _get_channel_data(self, key, config, force=False):
"""Fetch individual channel feed from cache/network."""
data = None
if not force:
# we may use the cache, see if we have something in there
data = self._get_channel_data_from_cache(key, config)
if data is None:
# cache not allowed or empty, fetch from network
data = self._get_channel_data_from_network(key, config)
return data
def _get_channel_data_from_cache(self, key, config):
"""Fetch channel feed from cache."""
channel_path = self._get_channel_cache_path(key)
if os.path.exists(channel_path):
if "ttl" in config and isinstance(config["ttl"], int):
ttl = config["ttl"]
else:
ttl = self._settings.get_int(["ttl"])
ttl *= 60
now = time.time()
if os.stat(channel_path).st_mtime + ttl > now:
d = feedparser.parse(channel_path)
self._logger.debug(u"Loaded channel {} from cache at {}".format(key, channel_path))
return d
return None
def _get_channel_data_from_network(self, key, config):
"""Fetch channel feed from network."""
import requests
url = config["url"]
try:
start = time.time()
r = requests.get(url)
self._logger.info(u"Loaded channel {} from {} in {:.2}s".format(key, config["url"], time.time() - start))
except Exception as e:
self._logger.exception(
u"Could not fetch channel {} from {}: {}".format(key, config["url"], str(e)))
return None
response = r.text
channel_path = self._get_channel_cache_path(key)
with codecs.open(channel_path, mode="w", encoding="utf-8") as f:
f.write(response)
return feedparser.parse(response)
def _to_internal_feed(self, feed, read_until=None):
"""Convert feed to internal data structure."""
result = []
if "entries" in feed:
for entry in feed["entries"]:
internal_entry = self._to_internal_entry(entry, read_until=read_until)
if internal_entry:
result.append(internal_entry)
return result
def _to_internal_entry(self, entry, read_until=None):
"""Convert feed entries to internal data structure."""
published = calendar.timegm(entry["published_parsed"])
read = True
if read_until is not None:
read = published <= read_until
return dict(title=entry["title"],
title_without_tags=_strip_tags(entry["title"]),
summary=entry["summary"],
summary_without_images=_strip_images(entry["summary"]),
published=published,
link=entry["link"],
read=read)
def _get_channel_cache_path(self, key):
"""Retrieve cache path for channel key."""
safe_key = self._slugify(key)
return os.path.join(self.get_plugin_data_folder(), "{}.cache".format(safe_key))
_image_tag_re = re.compile(r'<img.*?/?>')
def _strip_images(text):
return _image_tag_re.sub('', text)
def _strip_tags(text):
"""
>>> _strip_tags(u"<a href='test.html'>Hello world</a>&lt;img src='foo.jpg'&gt;")
u"Hello world&lt;img src='foo.jpg'&gt;"
>>> _strip_tags(u"&#62; &#x3E; Foo")
u'&#62; &#x3E; Foo'
"""
from HTMLParser import HTMLParser
class TagStripper(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
self._fed = []
def handle_data(self, data):
self._fed.append(data)
def handle_entityref(self, ref):
self._fed.append("&{};".format(ref))
def handle_charref(self, ref):
self._fed.append("&#{};".format(ref))
def get_data(self):
return "".join(self._fed)
tag_stripper = TagStripper()
tag_stripper.feed(text)
return tag_stripper.get_data()
__plugin_name__ = "Announcement Plugin"
__plugin_implementation__ = AnnouncementPlugin()
@@ -0,0 +1 @@
table td.settings_plugin_announcements_channels_name,table th.settings_plugin_announcements_channels_name{text-overflow:ellipsis;text-align:left}table td.settings_plugin_announcements_channels_actions,table th.settings_plugin_announcements_channels_actions{text-align:center;width:80px}table td.settings_plugin_announcements_channels_actions a,table th.settings_plugin_announcements_channels_actions a{text-decoration:none;color:#000}table td.settings_plugin_announcements_channels_actions a.disabled,table th.settings_plugin_announcements_channels_actions a.disabled{color:#ccc;cursor:default}#plugin_announcements_dialog .unread{font-weight:700}#plugin_announcements_dialog article{padding-right:20px}#plugin_announcements_dialog article.read{opacity:.5}#plugin_announcements_dialog article.read:hover{opacity:1}#plugin_announcements_dialog article .actions{background-color:#f5f5f5;border-radius:2px;padding:2px 5px;margin-top:5px}#plugin_announcements_dialog article .actions .markread{float:right}#plugin_announcements_dialog article .actions a{color:#000}
@@ -0,0 +1,304 @@
$(function() {
function AnnouncementsViewModel(parameters) {
var self = this;
self.loginState = parameters[0];
self.settings = parameters[1];
self.channels = new ItemListHelper(
"plugin.announcements.channels",
{
"channel": function (a, b) {
// sorts ascending
if (a["channel"].toLocaleLowerCase() < b["channel"].toLocaleLowerCase()) return -1;
if (a["channel"].toLocaleLowerCase() > b["channel"].toLocaleLowerCase()) return 1;
return 0;
}
},
{
},
"name",
[],
[],
5
);
self.unread = ko.observable();
self.hiddenChannels = [];
self.channelNotifications = {};
self.announcementDialog = undefined;
self.announcementDialogContent = undefined;
self.announcementDialogTabs = undefined;
self.setupTabLink = function(item) {
$("a[data-toggle='tab']", item).on("show", self.resetContentScroll);
};
self.resetContentScroll = function() {
self.announcementDialogContent.scrollTop(0);
};
self.toggleButtonCss = function(data) {
var icon = data.enabled ? "icon-circle" : "icon-circle-blank";
var disabled = (self.enableToggle(data)) ? "" : " disabled";
return icon + disabled;
};
self.toggleButtonTitle = function(data) {
return data.forced ? gettext("Cannot be toggled") : (data.enabled ? gettext("Disable Channel") : gettext("Enable Channel"));
};
self.enableToggle = function(data) {
return !data.forced;
};
self.markRead = function(channel, until) {
if (!self.loginState.isAdmin()) return;
var url = PLUGIN_BASEURL + "announcements/channels/" + channel;
var payload = {
command: "read",
until: until
};
$.ajax({
url: url,
type: "POST",
dataType: "json",
data: JSON.stringify(payload),
contentType: "application/json; charset=UTF-8",
success: function() {
self.retrieveData()
}
})
};
self.toggleChannel = function(channel) {
if (!self.loginState.isAdmin()) return;
var url = PLUGIN_BASEURL + "announcements/channels/" + channel;
var payload = {
command: "toggle"
};
$.ajax({
url: url,
type: "POST",
dataType: "json",
data: JSON.stringify(payload),
contentType: "application/json; charset=UTF-8",
success: function() {
self.retrieveData()
}
})
};
self.refreshAnnouncements = function() {
self.retrieveData(true);
};
self.retrieveData = function(force) {
if (!self.loginState.isAdmin()) return;
var url = PLUGIN_BASEURL + "announcements/channels";
if (force) {
url += "?force=true";
}
$.ajax({
url: url,
type: "GET",
dataType: "json",
success: function(data) {
self.fromResponse(data);
}
});
};
self.fromResponse = function(data) {
var currentTab = $("li.active a", self.announcementDialogTabs).attr("href");
var unread = 0;
var channels = [];
_.each(data, function(value, key) {
value.key = key;
value.last = value.data.length ? value.data[0].published : undefined;
value.count = value.data.length;
unread += value.unread;
channels.push(value);
});
self.channels.updateItems(channels);
self.unread(unread);
self.displayAnnouncements(channels);
self.selectTab(currentTab);
};
self.showAnnouncementDialog = function(channel) {
self.announcementDialogContent.scrollTop(0);
if (!self.announcementDialog.hasClass("in")) {
self.announcementDialog.modal({
minHeight: function() { return Math.max($.fn.modal.defaults.maxHeight() - 80, 250); }
}).css({
width: 'auto',
'margin-left': function() { return -($(this).width() /2); }
});
}
var tab = undefined;
if (channel) {
tab = "#plugin_announcements_dialog_channel_" + channel;
}
self.selectTab(tab);
return false;
};
self.selectTab = function(tab) {
if (tab != undefined) {
if (!_.startsWith(tab, "#")) {
tab = "#" + tab;
}
$('a[href="' + tab + '"]', self.announcementDialogTabs).tab("show");
} else {
$('a:first', self.announcementDialogTabs).tab("show");
}
};
self.displayAnnouncements = function(channels) {
var displayLimit = self.settings.settings.plugins.announcements.display_limit();
var maxLength = self.settings.settings.plugins.announcements.summary_limit();
var cutAfterNewline = function(text) {
text = text.trim();
var firstNewlinePos = text.indexOf("\n");
if (firstNewlinePos > 0) {
text = text.substr(0, firstNewlinePos).trim();
}
return text;
};
var stripParagraphs = function(text) {
if (_.startsWith(text, "<p>")) {
text = text.substr("<p>".length);
}
if (_.endsWith(text, "</p>")) {
text = text.substr(0, text.length - "</p>".length);
}
return text.replace(/<\/p>\s*<p>/ig, "<br>");
};
_.each(channels, function(value) {
var key = value.key;
var channel = value.channel;
var priority = value.priority;
var items = value.data;
if ($.inArray(key, self.hiddenChannels) > -1) {
// channel currently ignored
return;
}
var newItems = _.filter(items, function(entry) { return !entry.read; });
if (newItems.length == 0) {
// no new items at all, we don't display anything for this channel
return;
}
var displayedItems;
if (newItems.length > displayLimit) {
displayedItems = newItems.slice(0, displayLimit);
} else {
displayedItems = newItems;
}
var rest = newItems.length - displayedItems.length;
var text = "<ul>";
_.each(displayedItems, function(item) {
var limitedSummary = stripParagraphs(item.summary_without_images.trim());
if (limitedSummary.length > maxLength) {
limitedSummary = limitedSummary.substr(0, maxLength);
limitedSummary = limitedSummary.substr(0, Math.min(limitedSummary.length, limitedSummary.lastIndexOf(" ")));
limitedSummary += "...";
}
text += "<li><a href='" + item.link + "' target='_blank' rel='noreferrer noopener'>" + cutAfterNewline(item.title) + "</a><br><small>" + formatTimeAgo(item.published) + "</small><p>" + limitedSummary + "</p></li>";
});
text += "</ul>";
if (rest) {
text += gettext(_.sprintf("... and %(rest)d more.", {rest: rest}));
}
var options = {
title: channel,
text: text,
hide: false,
confirm: {
confirm: true,
buttons: [{
text: gettext("Later"),
click: function(notice) {
self.hiddenChannels.push(key);
notice.remove();
}
}, {
text: gettext("Mark read"),
click: function(notice) {
self.markRead(key, value.last);
notice.remove();
}
}, {
text: gettext("Read..."),
addClass: "btn-primary",
click: function(notice) {
self.showAnnouncementDialog(key);
self.markRead(key, value.last);
notice.remove();
}
}]
},
buttons: {
sticker: false,
closer: false
}
};
if (priority == 1) {
options.type = "error";
}
if (self.channelNotifications[key]) {
self.channelNotifications[key].remove();
}
self.channelNotifications[key] = new PNotify(options);
});
};
self.onUserLoggedIn = function() {
self.retrieveData();
};
self.onStartup = function() {
self.announcementDialog = $("#plugin_announcements_dialog");
self.announcementDialogContent = $("#plugin_announcements_dialog_content");
self.announcementDialogTabs = $("#plugin_announcements_dialog_tabs");
}
}
// view model class, parameters for constructor, container to bind to
ADDITIONAL_VIEWMODELS.push([
AnnouncementsViewModel,
["loginStateViewModel", "settingsViewModel"],
["#plugin_announcements_dialog", "#settings_plugin_announcements", "#navbar_plugin_announcements"]
]);
});
@@ -0,0 +1,56 @@
table {
th, td {
&.settings_plugin_announcements_channels_name {
text-overflow: ellipsis;
text-align: left;
}
&.settings_plugin_announcements_channels_actions {
text-align: center;
width: 80px;
a {
text-decoration: none;
color: #000;
&.disabled {
color: #ccc;
cursor: default;
}
}
}
}
}
#plugin_announcements_dialog {
.unread {
font-weight: bold;
}
article {
padding-right: 20px;
&.read {
opacity: 0.5;
}
&.read:hover {
opacity: 1;
}
.actions {
background-color: #f5f5f5;
border-radius: 2px;
padding: 2px 5px;
margin-top: 5px;
.markread {
float: right;
}
a {
color: black;
}
}
}
}
@@ -0,0 +1,45 @@
<div id="plugin_announcements_dialog" class="modal hide fade large" tabindex="-1" role="dialog" aria-labelledby="announcements_dialog_label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h3 id="announcements_dialog_label">{{ _('Announcements') }}</h3>
</div>
<div class="modal-body">
<div class="full-sized-box">
<div class="tabbable row-fluid">
<div class="span3 scrollable" id="plugin_announcements_dialog_menu">
<ul class="nav nav-list" id="plugin_announcements_dialog_tabs">
<!-- ko foreach: {data: channels.items, afterAdd: setupTabLink} -->
<!-- ko if: $data.enabled || $data.forced -->
<li>
<a data-toggle="tab" target="_blank" data-bind="text: $data.channel + ' (' + $data.unread + '/' + $data.count + ')', attr: {href: '#plugin_announcements_dialog_channel_' + $data.key}, css: {unread: $data.unread}"></a>
</li>
<!-- /ko -->
<!-- /ko -->
</ul>
</div>
<div class="tab-content span9 scrollable" id="plugin_announcements_dialog_content">
<!-- ko foreach: channels.items -->
<!-- ko if: $data.enabled || $data.forced -->
<div class="tab-pane" data-bind="attr: {id: 'plugin_announcements_dialog_channel_' + $data.key}">
<!-- ko foreach: $data.data -->
<article data-bind="css: {read: $data.read}">
<hr data-bind="visible: $index() > 0">
<h3><a data-bind="text: $data.title, attr: {href: $data.link}" target="_blank" rel="noreferrer noopener"></a> <small data-bind="text: formatTimeAgo($data.published), attr: {title: formatDate($data.published)}"></small></h3>
<div class="content" data-bind="html: $data.summary"></div>
<div class="actions">
<span class="articlelink"><small><a data-bind="text: $data.link, attr: {href: $data.link}" target="_blank" rel="noreferrer noopener"></a></small></span>
<span class="markread"><small><a href="javascript:void(0)" data-bind="click: function() { $root.markRead($parent.key, $data.published) }"><i class="icon-eye-open"></i> {{ _('Mark as last read') }}</a></small></span>
</div>
</article>
<!-- /ko -->
</div>
<!-- /ko -->
<!-- /ko -->
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-block" data-dismiss="modal" aria-hidden="true">{{ _('Close') }}</button>
</div>
</div>
@@ -0,0 +1,3 @@
<a id="navbar_show_announcements" class="pull-right" href="javascript:void(0)" data-bind="click: function() { showAnnouncementDialog(); }" title="{{ _('Announcements') }}">
<i data-bind="css: {'icon-bell': !unread(), 'icon-bell-alt': unread()}"></i>
</a>
Loaded 100 of 324 files, more files were not shown because too many files have changed in this diff. Show more