Commit graph

2256 commits

Author SHA1 Message Date
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
0b551f6b7e Some more documentation 2016-09-22 22:21:52 +02:00
Gina Häußge
8e8853c9c3 Lots of documentation updates + some related code fixes 2016-09-22 16:27:06 +02:00
Gina Häußge
6f029d6bf4 Docs and minor fixes for printer profile API 2016-09-21 12:05:17 +02:00
Gina Häußge
fc891ac651 Make sure volume.depth for circular beds is forced to width
Both width and depth should be the diameter. Adjusted docs
accordingly to reflect this too.
2016-09-21 10:45:40 +02:00
Gina Häußge
24322f9204 Refactored printer profile editor
It's now spread across multiple pages, with explanations
added where the data will be used.
2016-09-21 10:11:38 +02:00
Gina Häußge
133377c424 Also allow None for lastmodified and etag value 2016-09-20 15:09:47 +02:00
Gina Häußge
234cb501e7 Also accept int values for check_lastmodified 2016-09-20 14:32:19 +02:00
Gina Häußge
85e23c976b Sane defaults for empty printer profile fields 2016-09-19 14:35:04 +02:00
Gina Häußge
d017e507aa Directly determine file download URL in js client
We don't need an extra round trip here
2016-09-16 18:36:09 +02:00
Gina Häußge
53c0ad0889 Fixed unit tests for octoprint.timelapse 2016-09-16 18:35:30 +02:00
Gina Häußge
d2ed80baca Merge branch 'dev/apiCaching' into devel
# Conflicts:
#	src/octoprint/filemanager/storage.py
#	src/octoprint/static/js/app/viewmodels/files.js
2016-09-16 17:11:14 +02:00
clemniem
74fd5e8956 Fixed KeyError in events.py that prevented a command associated with the ClientOpened event from execution.
The if-statement checked against currentData["job"] is not None, although it was not None even if there was no job.
2016-09-16 16:21:28 +02:00
Gina Häußge
650e1971d4 Merge branch 'maintenance' into devel
# Conflicts:
#	CHANGELOG.md
#	src/octoprint/static/js/app/viewmodels/usersettings.js
2016-09-16 14:11:43 +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
Mathias Rangel Wulff
b794a4672f Correct check for undefined variable
The code was comparing the result of `typeof` with a variable named `undefined`.

As typeof returns a string it should compare to `'undefined'`.
2016-09-12 09:43:46 +00: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
b6fbbb353a Merge branch 'maintenance' into devel
# Conflicts:
#	CHANGELOG.md
#	src/octoprint/filemanager/storage.py
#	src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2
2016-09-09 12:31:29 +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
64d484bd09 Merge branch 'maintenance' into devel
# Conflicts:
#	src/octoprint/server/__init__.py
#	src/octoprint/util/jinja.py
2016-09-07 17:22:37 +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
976be675e5 Declare cache_key before trying to access it 2016-09-07 11:59:43 +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
Mike New
9bed3dcf8b fixed printer depth not saving or loading properly in the printer profile 2016-09-02 22:14:57 -07:00
Gina Häußge
f936c24da4 Changed wording on previous/next layer buttons & reordered 2016-09-01 15:12:22 +02:00
Gina Häußge
257cfe9dd9 Debug logging of render duration for / view 2016-09-01 13:20:05 +02:00
Gina Häußge
854eef7d00 Gracefully handle errors when reading webassets 2016-09-01 13:19:31 +02:00
Gina Häußge
37a39e82e2 path_in_location needs to use sanitized entry 2016-09-01 13:17:09 +02:00
Gina Häußge
c552c614b2 Fix upload highlight in folders & keep folder on files refresh 2016-09-01 13:16:33 +02:00
Gina Häußge
6f48ca68e2 Fixed a merge error, _execute returns three values in 1.3.0, not two 2016-09-01 10:29:29 +02:00
Gina Häußge
eb4be89d39 Renamed GcodeFileViewModel to FileViewModel
(Let's be realistic here)

Introduced new "additionalNames" property on viewmodel declaration
to allow for registering alternative lookup names for a view model.

The freshly renamed FileViewModel now resolves as both "filesViewModel"
 and "gcodeFilesViewModel", making the renaming backwards compatible

 Documented all that stuff (and some more)
2016-09-01 10:17:18 +02:00
Gina Häußge
2a33aef617 Refs weren't propery set on file API 2016-08-31 17:57:17 +02:00
Gina Häußge
e42ef3d070 Small fixes on the layer buttons
Removed unnecessary (and broken) call to event.preventDefault,
moved styles to less/css and also made sure to disable the buttons
not currently usable.
2016-08-31 17:20:23 +02:00
Gina Häußge
d2b0387994 Be sure that opts.url == urlToCall 2016-08-31 15:51:15 +02:00
Gina Häußge
20607dfab0 Work around a race condition(?) causing issues on startup
See lengthy comment inside main.js added in this commit.
2016-08-31 15:50:33 +02:00
Gina Häußge
9e1f82d977 Don't modify the list in the cache, make a copy 2016-08-31 11:49:53 +02:00
Gina Häußge
5c9ed254ff Fix a missing parameter 2016-08-31 11:11:47 +02:00
Gina Häußge
c32d9a33ee Make sure to include the sd files in the ETag calculation as well 2016-08-31 11:11:18 +02:00
Gina Häußge
bccc706329 First throw at caching of API methods
Most caching is left to the client, by utilizing ETag and Last-Modified headers.

Where it was easily achievable, an additional server side miniature cache of intermediary
results was introduced (e.g. for the files). The regular cached decorator was not used
since it targets caching full responses, and the responses in question already contained
client request specific data. Caching "one step earlier" allows better usage of the cache here.

Also introduced a dependency on the scandir module, to get a bit of a performance boost
on os.walk and os.listdir (which have been replaced with scandir.walk and scandir.listdir
respectively). See https://github.com/benhoyt/scandir#background on why that made
sense.
2016-08-30 19:02:30 +02:00
Gina Häußge
e00de7145f Fixed some indentation 2016-08-30 18:05:22 +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
a13e12bb5e More work on JS Client documentation 2016-08-26 17:47:38 +02:00
Gina Häußge
12bc85694b Small optimizations on copy and move commands 2016-08-26 17:47:28 +02:00
Gina Häußge
efca776102 Merge branch 'maintenance' into devel
Conflicts:
	src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2
	src/octoprint/plugins/softwareupdate/updaters/update_script.py
2016-08-26 14:24:13 +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
4fe944eb85 Actually trigger the beforePrintStarted script on print start
Missing trigger caused by 5bf5e336ec
2016-08-25 09:56:20 +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
2e27e640cd Better yet, mirror actual active login 2016-08-24 16:27:23 +02:00
Gina Häußge
1d8dea4d1b Fully mirror regular passive_login for auto login 2016-08-24 16:23:41 +02:00
Gina Häußge
9165c9475d Docs for about dialog panels through the TemplatePlugin mixin 2016-08-19 13:57:58 +02:00
Gina Häußge
27ada38855 Update of docs for preemptive cache methods on UiPlugin + method rename 2016-08-19 13:49:32 +02:00
Gina Häußge
5b0bc8c3a8 Some text changed for the first and last page on the first run wizard 2016-08-19 13:36:31 +02:00
Gina Häußge
98b57650d9 Add first run wizard dialog for default printer profile 2016-08-19 11:42:06 +02:00
Gina Häußge
d2f8b957bc Modularize printer profile manager UI components 2016-08-19 11:41:29 +02:00
Gina Häußge
dedffe3514 Allow tracking if printer profiles where modified
Needed for a first time setup wizard to configure default
printer profile.
2016-08-19 11:39:25 +02:00
Gina Häußge
650cfac1cf Removed semi-finished CuraEngine 15.06+ implementation
We'll need to turn that into a separate plugin and while at it also
move away from the generalized slicing profile format.

That's more a topic for after 1.3.0 however, so for now, just
clean this up.
2016-08-19 09:57:19 +02:00
Gina Häußge
aaeb2ef4db Forgot to call the default_view if no plugin felt responsible 2016-08-19 09:00:38 +02:00
Gina Häußge
b435ecf9e8 Slightly modified logging for preemptive cache execution 2016-08-18 16:46:51 +02:00
Gina Häußge
066907391a Only cache responses with status codes >= 200 and < 400 2016-08-18 16:46:18 +02:00
Gina Häußge
3a79805b6f g.locale might be None 2016-08-18 16:45:21 +02:00
Gina Häußge
5a38e9a412 X-Force-View, not X-Forced-View 2016-08-18 16:44:44 +02:00
Gina Häußge
f93212b06d Merge branch 'maintenance' into devel
Conflicts:
	src/octoprint/server/__init__.py
	src/octoprint/server/util/flask.py
	src/octoprint/server/views.py
2016-08-18 16:17:54 +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
95a449530e Force view via request headers instead of temporary flag
The flag approach is not thread safe.
2016-08-18 15:56:27 +02:00
Gina Häußge
d92df9c698 Merge branch 'maintenance' into devel
Conflicts:
	src/octoprint/server/util/flask.py
	src/octoprint/server/views.py
	src/octoprint/settings.py
2016-08-18 15:48:31 +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
f43381ce30 Merge branch 'maintenance' into devel
Conflicts:
	src/octoprint/filemanager/__init__.py
2016-08-18 12:28:13 +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
7cc3403a41 Info logging for preemptively caching plugins 2016-08-18 08:34:43 +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
00923427cb Really do force a plugin view during preemptive caching
We don't need to check if the plugin will handle the UI, we just force
it to handle it.
2016-08-16 14:04:45 +02:00
Gina Häußge
79c95aa3b4 Merge branch 'maintenance' into devel
Conflicts:
	src/octoprint/filemanager/storage.py
	src/octoprint/templates/sidebar/state.jinja2
2016-08-16 09:34:49 +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
edf83e4984 Merge branch 'vanilla_devel' of https://github.com/mrbeam/OctoPrint into pr/mrbeam/vanilla_devel
Conflicts:
	src/octoprint/static/less/octoprint.less
2016-08-15 09:40:21 +02:00
Teja
963bb77d89 added transform without vendor prefix. Didn't work in Chromium 52.x anymore. 2016-08-04 09:58:07 +02:00
Gina Häußge
039412183c Merge branch 'maintenance' into devel
Conflicts:
	CHANGELOG.md
2016-07-30 09:57:31 +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
e6d88a124d Merge branch 'maintenance' into devel 2016-07-28 15:21:06 +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
aae01fe81b Merge branch 'maintenance' into devel
Conflicts:
	CHANGELOG.md
	docs/api/fileops.rst
	src/octoprint/plugins/virtual_printer/virtual.py
	src/octoprint/server/api/files.py
	src/octoprint/static/css/octoprint.css
	src/octoprint/static/js/app/dataupdater.js
	src/octoprint/static/js/app/main.js
	src/octoprint/static/js/app/viewmodels/files.js
	src/octoprint/static/js/app/viewmodels/settings.js
	src/octoprint/templates/sidebar/state.jinja2
	src/octoprint/util/comm.py
2016-07-28 15:00:23 +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
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
cba742a94f Fix some more left-overs of py2<->py3 PRs
Related to #1411, #1414 and #1415
2016-07-15 12:46:53 +02:00
Gina Häußge
dc874d98ac Merge branch 'dev/python3E' of https://github.com/ByReaL/OctoPrint into pr/ByReaL/dev/python3E
Conflicts:
	src/octoprint/server/__init__.py
	src/octoprint/users.py
	src/octoprint/util/jinja.py
2016-07-15 12:32:24 +02:00
Gina Häußge
47b7acdfbc Merge branch 'dev/python3A' of https://github.com/ByReaL/OctoPrint into pr/ByReaL/dev/python3A
Conflicts:
	src/octoprint/plugins/virtual_printer/virtual.py
	src/octoprint/printer/standard.py
2016-07-15 12:28:19 +02:00
Gina Häußge
e961234458 Explicitly use floor division where necessary 2016-07-15 11:42:01 +02:00
Gina Häußge
76a04cbe9d Merge branch 'dev/python3B' of https://github.com/ByReaL/OctoPrint into pr/ByReaL/dev/python3B 2016-07-15 11:28:55 +02:00
Gina Häußge
3cb045380e Merge pull request #1414 from ByReaL/dev/python3D
python3: os.umask(002) to os.umask(0o002)
2016-07-15 11:14:11 +02:00
Gina Häußge
31d56c11c1 Merge pull request #1413 from ByReaL/dev/python3C
python3: xrange got removed from python 3
2016-07-15 11:13:54 +02:00
MirceaDan
a48241d45e python3: iterators, bytes and next
iteritems got removed items is to be used for python 2 and 3
compatibility , it returns a view in python 3 and must be casted to a
list if the list is needed.

bytes form builtins

using builtin function next is the compatible way between python 2 and 3
2016-07-15 01:43:31 -07:00
MirceaDan
bf320a8c43 python3: os.umask(002) to os.umask(0o002)
os.umask(0o002) is the python 2/3 way
2016-07-15 01:18:11 -07:00
MirceaDan
3dae8d90d7 python3: xrange got removed from python 3
python3 range is = python2 xrange
to make python 2 range = with python3 range i used teh future package
and did
from builtins import range
2016-07-15 00:56:45 -07:00
MirceaDan
c33a9f9aa2 from __future__ import absolute_import, division, print_function
changed the behavior to import division and print to be consistent
across all app and similar with python 3.x
2016-07-15 00:16:58 -07:00
MirceaDan
149cc8c7c5 python 3 changes exceptions, queue and asesrtEqual
1) import Queue is now lower caps

2) exceptions
except KeyError as e:

3) assertEquals is deprecated but assertEqual does exactly same thing
2016-07-14 23:53:39 -07:00
Gina Häußge
28814db207 Merge branch 'maintenance' into devel
Conflicts:
	setup.py
	src/octoprint/plugins/virtual_printer/virtual.py
	src/octoprint/printer/standard.py
2016-07-14 19:47:38 +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
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
9cd47bc5e2 Merge branch 'maintenance' into devel 2016-07-13 13:11:08 +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
27227e271d Don't try to calculate min/max for empty bounding box 2016-07-13 12:50:16 +02:00
Gina Häußge
99ec1efda7 Merge branch 'fix/serialRxBufferHandling' into devel
Conflicts:
	src/octoprint/plugins/virtual_printer/virtual.py
2016-07-12 17:54:07 +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
a33338684e Merge branch 'fix/slicingDocs' into devel 2016-07-12 11:52:59 +02: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
9b6b4a9228 Have path set for SD files and strip leading / 2016-07-08 15:45:13 +02:00
Gina Häußge
42e54f0fbc Fix missing path attribute for sd files on API 2016-07-08 15:44:37 +02:00
Gina Häußge
7909672f51 Fix wrong location assignment for selected file 2016-07-08 15:43:48 +02:00
Gina Häußge
5bf5e336ec Extend payload in various events
Added name and path various event print job events and
the upload event, deprecated the file property.

Had to move event triggering of the print job events to
the printer implementation, since the file manager
is not available in the comm layer. Added new callbacks
to the PrinterInterface to allow for that to be possible.
2016-07-08 12:54:58 +02:00
Gina Häußge
3a4902367b New event placeholders for path & origin 2016-07-08 12:52:40 +02:00
Gina Häußge
0fd510a51f Less scary message on config.yaml parsing error 2016-07-08 12:35:46 +02:00
Gina Häußge
55ed4211f9 Fix highlighting of selected file in file list in frontend 2016-07-08 11:14:40 +02:00
Gina Häußge
db2c3bf10b Have frontend's printer state also track file path
Also display it on mouse over on the selected file's name.
2016-07-08 11:13:14 +02:00
Gina Häußge
d91c6256b4 Have GCODE viewer use file path instead of name
That way it should also work for GCODE files contained in folders.
2016-07-08 10:57:33 +02:00
Gina Häußge
dfb8f51238 Extend payload in MetadataAnalysis events
Added name, path and origin, deprecated file property.
2016-07-08 10:50:13 +02:00
Gina Häußge
2e8d104864 Fix resource URLs for files in folders 2016-07-08 10:42:50 +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
0015d844a8 Merge branch 'improve/templateErrorResilience' into devel
Conflicts:
	src/octoprint/server/__init__.py
2016-07-06 15:12:19 +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
5802c11689 Fixed a bug (variable not yet defined) 2016-07-06 14:06:38 +02:00
Gina Häußge
07dc0499d0 Merge branch 'gcode_arc_rendering' of https://github.com/eyck/OctoPrint into pr/eyck/gcode_arc_rendering 2016-07-06 13:38:54 +02:00
Gina Häußge
a2cd46899c Merge branch 'improve/intermediaryUrlsAndTimeouts' into devel
Conflicts:
	AUTHORS.md
	src/octoprint/plugins/virtual_printer/virtual.py
2016-07-06 13:32:03 +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
9fca41c76c Merge branch 'maintenance' into devel 2016-07-05 14:53:54 +02:00
Gina Häußge
8c80e3ac4a Scalar3D => Vector3D 2016-07-05 14:53:16 +02:00
Gina Häußge
66792da5bc MinMax3D type for tracking printing area & include dimensions in analysis 2016-07-05 14:40:00 +02:00
Gina Häußge
5a9852e7b8 Merge branch 'maintenance' into devel
Conflicts:
	src/octoprint/util/gcodeInterpreter.py
2016-07-05 14:37:17 +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