Commit graph

2558 commits

Author SHA1 Message Date
Gina Häußge
bba9d6cc18 Use proper timeouts for requests + better error handling
Default behaviour apparently is blocking, we never want that!

Also make error responses actually raise an exception.
2017-04-12 13:50:52 +02:00
BillyBlaze
6465175e09 Improve terminal performance by adding FastForEach
Move the AutoScroll function to an animation frame to prevent layout thrashing and to keep it in sync with fastForEach
Remove the <br> tag from the terminal and use display: block; on span tags to prevent increasing DOM nodes and faster processing of the terminal
2017-04-12 08:17:34 +00:00
Gina Häußge
fe585e7115 Do not repeatedly apply any set offsets in the gcode interpreter
They would accumulate and cause wrong calculations

Solves #1863
2017-04-12 09:38:53 +02:00
Gina Häußge
ef01560199 If file hash doesn't match on adding a file, kill all metadata 2017-04-10 17:31:00 +02:00
Gina Häußge
1666a1f607 Removed "minify" option for assets and some redundancy 2017-04-10 16:28:04 +02:00
Gina Häußge
4109b2f6c2 Announcements: Unit tests for the converters 2017-04-10 13:57:21 +02:00
Gina Häußge
9f32e91e05 Turned lazyload into jquery plugin, used for announcements
On call of the lazyload plugin, all matched img elements will be
checked if they have a data-src attribute. If so, their src attribute
will be replaced with the contents of the data-src attribute
(effectively loading the image) and the data-src attribute will be
removed (so that multiple calls don't call multiple processing).
2017-04-10 11:54:03 +02:00
Gina Häußge
7c8f148fa8 Announcements: Don't load imgs until reader is opened
Closes #1858
2017-04-10 11:21:18 +02:00
Gina Häußge
d1c6381792 Intermediary page: Offer "reload now" once server is up but not cached 2017-04-10 10:45:16 +02:00
Gina Häußge
a477268beb More logging for preemptive cache 2017-04-10 10:43:46 +02:00
Gina Häußge
346f818707 PGMR: More general flexibility for os compat check
* Don't restrict the list of compatibility values to check against
    to only those we have mapped, also support unmapped more exotic
    ones.

  * Allow 1:1 check against sys.platform values (with startswith).
    Combined with the above that allows very granular compatibility
    modelling ("freebsd11", "freebsd12") if required.

  * Instead of only whitelisting ("linux", "freebsd") now also black
    listing is possible ("!windows").

    A detected os must match all provided whitelist elements (if the
    whitelist is empty that is considered always the case) and none of
    the backlist elements (if the blacklist is empty that is also
    considered always the case).

See the included unit tests for examples of how this works.
2017-04-07 09:18:37 +02:00
Gina Häußge
956d9581c5 PMGR: Add freebsd os compatibility flag 2017-04-07 09:16:26 +02:00
Gina Häußge
41e9d96815 Use pip instead of python setup.py develop in CLI for plugin install
Apparently python setup.py develop tries to re-install all scripts
provided by plugins (maybe only under Windows?). Since that includes
OctoPrint's own executable, things will explode with an access denied
error there. Switching over to pip install -e . fixes that, and also
is more conform with the install approach the plugin will take in
production anyhow.
2017-04-07 09:15:05 +02:00
Gina Häußge
09d1025dfc Use blacklisting instead of whitelisting for checking daemon support
Just to be on the safe side... This is _exactly_ the same behaviour
as it was under 1.2.x again.
2017-04-06 10:02:48 +02:00
Gina Häußge
163fd83bf5 PGMR: Detect necessity to reinstall
So far using the "... from URL" or "... from an uploaded archive"
mechanism for installing a plugin would fail without further
information if the plugin to be installed was already installed.

The plugin manager will now detect this situation by parsing the
corresponding message from the pip output and trigger a reinstall
instantly.

A message about this will be logged to octoprint.log and the install
output.

Additionally the error handling for installation errors has been
slightly improved (install output no longer says "Done!" but "Error!"
with the reason as provided by the server) and the "could not install
plugin from URL unknown" issue should also be solved.
2017-04-04 15:18:37 +02:00
Gina Häußge
e109bf0ca6 Fix: Make Printer.is_ready behave as advertised 2017-04-03 18:48:45 +02:00
Gina Häußge
8cbf5a74b3 Fix analysis backlog calculation for specific path on storage
We need to convert the provided path into a local storage one first,
otherwise the following scandir calls will fall on their faces.
2017-04-03 17:18:26 +02:00
Gina Häußge
b24851ca05 New events: FileAdded, FileRemoved, FolderAdded, FolderRemoved
Closes #1092
2017-04-03 15:50:23 +02:00
Gina Häußge
d72c7c144e Make octoprint_client support multiple instances
Adjusted cli implementation accordingly
2017-03-31 18:48:13 +02:00
Gina Häußge
5c0a564592 PMGR: Better handling of plugins disabled on the repo
Switched button from "Incompatible" to "Disabled", added link to
plugin page on repo with the prominent alert box explaining the
reason for disabling.
2017-03-31 17:55:18 +02:00
Gina Häußge
d27dd26a61 PMGR: Also allow filtering notices against affected OctoPrint versions 2017-03-31 17:32:41 +02:00
Gina Häußge
52633d0433 PMGR: Support for plugin notices
Evaluates json data file as e.g. published on
plugins.octoprint.org/notices.json and displays notices for plugins
installed and matching (optional) version lists.
2017-03-31 16:52:48 +02:00
Gina Häußge
ea3b7ab1da Update pnotify to version 2.1.0, incl. all modules 2017-03-31 15:22:59 +02:00
Gina Häußge
a01b9fe8d4 Disable reload button and show spinner on click 2017-03-30 15:50:32 +02:00
Gina Häußge
f1cf482919 Adjusted metadata of bundled plugins 2017-03-30 14:09:12 +02:00
Gina Häußge
18e14aa412 Support "disabling unrecommended" for bundled plugins
* Extended plugin metadata by new property, only evaluated for bundled
    plugins.
  * Adjusted plugin manager to evaluate new metadata and add
    confirmation dialog with details when attempting to disable such
    a plugin.
2017-03-30 14:08:47 +02:00
Gina Häußge
c3ad1d3691 Announcements: Various improvements
* Added combined OctoBlog feed, replacing news + spotlight (+
    octoprintonair), added corresponding config migration
  * Subscribe to all registered feeds by default
  * Added config button to announcement reader
  * Added note how to edit announcement subscriptions to notifications
  * Auto-hide announcements on logout
  * Order channels server-side based on new order config setting
2017-03-30 12:40:57 +02:00
Gina Häußge
35d9775e51 Limit verbosity of failed system event handlers 2017-03-30 11:37:46 +02:00
Gina Häußge
fda67f48ff Allow users to ignore update notification & setting to disable outright
Old default behaviour of showing logged in users the update
notification stays default, but can now be disabled via the software
update plugin settings.

Additionally added the ignore button to the notification for users as
well (and made ignore entry in local storage user specific to still
show notification to other logged in users), plus a small hint that
in order to apply updates an admin is needed. Additionally now hiding
the notification on log out.

Closes #1739
2017-03-29 14:47:49 +02:00
Gina Häußge
e97c9f954d Early validation of file to select for printing & better documentation
See #1843
2017-03-29 11:53:16 +02:00
Gina Häußge
01ad9b8b14 Fix order of PrintCancelled and PrintFailed event
Closes #1836
2017-03-27 17:42:07 +02:00
Gina Häußge
2d105517c9 Synchronized access to selected file in printer implementation
Should solve #1837
2017-03-27 16:48:43 +02:00
Gina Häußge
97b2a02926 Fix message catchall * not working in socket clientlib 2017-03-24 16:56:11 +01:00
Gina Häußge
517fd6f3ab Auto detect Malyan firmware and configure comm layer
Should close #1762
2017-03-24 16:55:54 +01:00
Gina Häußge
fb2f9ba593 Added note on lack of language pack repo & to use the wiki 2017-03-22 16:50:33 +01:00
Gina Häußge
3ec2d7bd14 Delete confirmation & bulk delete for timelapses
Also introduced a new helper, a progress modal that can be used for
providing feedback about things such as bulk delete operations in the
background.

See #748 and discussion in #1807
2017-03-22 16:28:33 +01:00
Gina Häußge
675a54aa05 Fix filter parameter and force parameter on /api/files/<origin> 2017-03-21 13:15:43 +01:00
Gina Häußge
880b99faaf Better feedback of current vs selected profile & available actions
Also part of fixing core reason of #1734
2017-03-21 10:43:45 +01:00
Gina Häußge
5535a9aeb0 Handle default printer profile like all other profiles
It now resides in a file on disk and can be deleted. If the profile
configured as default is not available (e.g. due to having been
manually deleted, or on first start), the default profile as defined
in the profile manager will be written as _default and that will be
used/set as default.

On first start after this change gets applied, OctoPrint will migrate
the old "default overlay" residing in config.yaml to a file on disk
and delete the old entries in config.yaml.

Solves core reason of #1734
2017-03-20 18:33:13 +01:00
Gina Häußge
3bc77ffe3d Always merge with basic default profile 2017-03-20 13:18:39 +01:00
Gina Häußge
896aad3ab0 Migrate printer profile before saving as well
We want to make sure that externally added profiles are up to current
format.
2017-03-20 13:18:39 +01:00
Claudiu Ceia
01e970553f Fix typo: Celcius to Celsius (#1826) 2017-03-20 10:26:53 +01:00
Gina Häußge
6613d580f2 Support daemon mode on linux AND freebsd 2017-03-19 10:53:44 +01:00
Gina Häußge
ac6900ffb6 REALLY remove "Hide empty folders" m)
See #1671
2017-03-16 16:33:58 +01:00
Gina Häußge
fa73fd3c14 Merge branch 'master' into maintenance
# Conflicts:
#	src/octoprint/server/api/settings.py
#	src/octoprint/settings.py
2017-03-16 15:16:52 +01:00
Gina Häußge
0a69dbeddb Preparing release of 1.3.2 2017-03-16 13:08:31 +01:00
Gina Häußge
13714dc8d9 Enable save button when marking "save as default" 2017-03-16 11:25:53 +01:00
Gina Häußge
5a6edefec1 Slight rewording 2017-03-16 11:25:48 +01:00
ntoff
87be930a68 timelapse tab unsaved warning and rearrange interval input box
Addition of a notification under the save button when there are unsaved
changes, and a notice under the save as default checkbox when unticked,
that changes are only temporary.

Also move the "interval" box up the top to position it underneath the
timelapse type dropdown list, and change the text to be a bit more
descriptive.

(cherry picked from commit 381a016)
2017-03-15 12:47:47 +01:00
Gina Häußge
627d11fa51 Remove some redundance & return 400 on all wrong option values 2017-03-14 17:25:39 +01:00
Gina Häußge
315a80a7a7 Fix wrong default value for postroll
Closes #1821
2017-03-14 17:25:13 +01:00
Gina Häußge
1b91790f5f Merge branch 'fix/fileAccessRaceCondition' into maintenance 2017-03-13 17:14:14 +01:00
Gina Häußge
3e5923b21e Consolidate API Key handling
System wide API key now offers a generate button like the user
API keys. Setting the API key directly to a value via the settings API
endpoint is now no longer possible, which should prevent setting it
accidentally thanks to the browser prefilling things where it shouldn't.

No delete button is offered for the system wide API key since it will
get automatically regenerated on server start if not set, so
regeneration is the only functionality here that makes sense.

If no API key is set in the user settings, the "delete" button is now
disabled. If a key is already set and a new one is to be generated, a
confirmation dialog makes sure this is really what the user wants. Same
for deleting an existing API key.

Both the system wide API key and the user specific API keys will now
only display a QRCode if there's actually a value for the key.
2017-03-13 17:09:56 +01:00
Gina Häußge
c1fdbaa1e7 Force refresh of settings on login/logout
Our access rights might have changed, so let's make sure our
view of the settings is up to date.
2017-03-13 17:07:27 +01:00
Gina Häußge
1c132c39ad Preparing release of 1.3.2rc1 2017-03-10 14:35:11 +01:00
Gina Häußge
7114462024 Fixed python setup.py babel_compile 2017-03-10 14:24:49 +01:00
Gina Häußge
ebae1b475b Don't apply navbar gradient to dropdown entries 2017-03-10 12:49:21 +01:00
Gina Häußge
6e793c2ba3 Don't mark "can't clean" messages from setup.py clean as error
Might confuse users to see that marked up like an error when it's
perfectly normal for some kinds of installs simply because the
specific build folders never were created in the first place.
2017-03-10 11:36:49 +01:00
Gina Häußge
b38884db63 Removed an obsolete (and broken) method from PipCaller 2017-03-10 11:20:13 +01:00
Gina Häußge
a49772fcf3 Removed bits from clean command made redundant by #732
Force --all on stock clean command unless --orig is specified, in
which case "python setup.py clean" behaves like the stock clean
command. Additionally there are now --noeggs to skip egg deletion and
--nopyc to skip pyc deletion.
2017-03-09 18:41:55 +01:00
Gina Häußge
052796d5d2 Merge branch 'feature/inherit-clean' of https://github.com/DanLipsitt/OctoPrint into improve/cleanCommand 2017-03-09 18:40:50 +01:00
Gina Häußge
559238ca3c More solid parsing of line number from resends
Matches:

  * Resend:23
  * Resend:N23
  * Resend:N:23
  * rs 23
  * rs N23
  * rs N:23
  * rs N23 Expected checksum 109

Based on issue reported via PR #300
2017-03-09 17:08:01 +01:00
Gina Häußge
d298c3c672 Apply analysis throttle only every n lines
Default n = 100, configurable via config.yaml. Should make analysis a
bit faster while still giving the Pi air to breathe.
2017-03-09 15:38:52 +01:00
Gina Häußge
136736d307 Reset line numbers if printer sends "start" when operational
Might have been an external reset of the printer we didn't otherwise
detect, and unless we reset the line numbers we'll now be off and run
into resend requests.

Solves #1676
2017-03-09 14:35:07 +01:00
Shawn Bruce
5d1a0eaa16 Only reset scroll position for settings content. (Fixes #1812)
(cherry picked from commit 5c81833)
2017-03-09 11:57:08 +01:00
Andy Werner
8a4934e6f8 Fix an issue in user settings
* UserSettings: crashed if overwrite an existing key with primitive value by same key with complex value. Also reduced number of calls to user.get_setting()

* Updated tests

(cherry picked from commit b75b53d)
2017-03-08 18:11:36 +01:00
Gina Häußge
a0e5f79483 Only load file into GCODE viewer when that is actually visible
Reduces needed bandwidth on page load, might help to mitigate
bandwidth related issues described in #1241.
2017-03-08 18:03:16 +01:00
Gina Häußge
ab42cc2a7f Better error resilience against garbage history data from plugins
See #1805
2017-03-06 15:32:30 +01:00
Gina Häußge
d8f2630fd4 Don't call onUserLoggedIn/Out on user reload 2017-03-06 14:11:41 +01:00
Gina Häußge
811c91955c Fix for new user settings getting lost until restart
On reload of the user settings a new user object was created but not
updated on the associated session user(s). That let to session user
(s) still referring to the old user instances with the only partially
updated user settings.

Behaviour changed such that on a reload of the users from file
(including user settings) all registered session users will now get
their reference updated as well.

Also made modelling of user id to session id a bit less redundant.
2017-03-06 14:02:39 +01:00
Gina Häußge
2dcd6e02b1 Remove webapp headers to play nice with Safari's session handling
Solves #1792
2017-03-06 11:37:00 +01:00
Gina Häußge
d845257cf4 Fixed caching of main page
Got broken by 62890ef73a
2017-03-01 18:28:37 +01:00
Gina Häußge
c765e6e228 Revert "Only do lookup by userid if session is None"
This reverts commit f02fac20ed.

The commit turned out to nuke the "remember me" functionality.
2017-03-01 15:49:19 +01:00
Gina Häußge
20e1219d9e Virtual printer: configurable ok format 2017-03-01 15:48:36 +01:00
Gina Häußge
14120f732b Only check if we need to close login dropdown if it's open 2017-02-28 10:00:51 +01:00
Gina Häußge
b7e2b0f794 Fixed login dropdown not auto closing on click outside of it
When two wrongs make one right...
2017-02-28 09:54:36 +01:00
Gina Häußge
f02fac20ed Only do lookup by userid if session is None 2017-02-27 15:51:24 +01:00
Gina Häußge
755bcaa311 Add current path to "Back" button in file list
Closes #1712
2017-02-24 15:05:26 +01:00
Gina Häußge
aab98a7c9f Disable "Slice" button when printing and local slicer is selected
Solves #1631
2017-02-24 13:21:33 +01:00
Gina Häußge
3a984d41ff Remove color option in printer profile editor
We don't use it anywhere and its presence keeps confusing users. Kept
in the model since we might want to use it at some later time.

Closes #1790
2017-02-24 12:38:37 +01:00
Gina Häußge
28d01e2fa6 Disable external heatup detection until firmware is detected 2017-02-24 12:32:05 +01:00
Gina Häußge
2198add8e6 SWU: Refresh cache on startup & prevent concurrent refresh & fix hash 2017-02-24 11:56:02 +01:00
Gina Häußge
1de307e15d Log version, safe mode & plugins to log on log roll over
We want to make sure that information is ALWAYS in each and every log.
2017-02-24 10:53:16 +01:00
Gina Häußge
aab7b7f797 Timelapse: ignore both z-hop flanks but allow z-hop to next layer
Former implementation tested for z-hop rising flank and anything that
is falling. That however causes issues with z-hop directly followed
by layer change (diff is not z-hop size but negative, image hence not
captured).

Instead of testing for positive flank == z-hop and any negative flank,
we now test for absolute value == z-hop.

Solves #1777
2017-02-23 17:17:38 +01:00
Gina Häußge
162e8c50d3 Fixed CSS and LESS bundling for core vs plugins vs all 2017-02-23 17:05:42 +01:00
Gina Häußge
636d8e0faa Eventhandling: Wait for command to finish before triggering next
Should solve #733
2017-02-23 16:50:04 +01:00
Gina Häußge
62890ef73a Fix a bunch of caching issues
Cache was not invalidated on change of:

  * snapshot URL presence
  * system menu entry presence
  * gcode viewer enabled/disabled
  * changes in access control availability

Refactored cache setup to add enable_timelapse, enable_gcodeviewer
and enable_accesscontrol to ETag calculation, removed system menu
check. Template filtering will now be done based on the values of
these flags at render time, not before.

See also #1776 for a related ticket.
2017-02-23 14:49:47 +01:00
Gina Häußge
79af90dd6a Make sure we don't try to use an empty logging.yaml
Fixes #1560
2017-02-22 18:25:12 +01:00
Gina Häußge
d15262e7cc Fixed wrong replacement for __progress placeholder in events
Data reported from printer backend is already percent, multiplying it
with 100 again produces wrong values.
2017-02-22 17:58:21 +01:00
Gina Häußge
41f0ed0124 Move announcements between system and login 2017-02-22 15:20:07 +01:00
Gina Häußge
ff595a7e31 Move notifications down a bit
See discussion in #1741
2017-02-22 15:19:04 +01:00
Gina Häußge
444312d7d9 Free up some space in the navbar
* Use only icons for settings and system entries
  * Limit length of login entry to 100px
  * Limit length of instance name to 250px
  * Removed "OctoPrint" text if instance name is set

See discussion in #1741
2017-02-22 15:17:39 +01:00
Gina Häußge
c203d79434 Remove empty-folder-filter
Doesn't really add anything and only causes issues for people.

Solves #1671
2017-02-21 17:06:26 +01:00
Eyal Soha
6aae0017c4 add sameDevice to SlicingViewModel
(cherry picked from commit fea0791)
2017-02-21 14:15:02 +01:00
Eyal Soha
ebe93f9a6d add same device to the slicing API
(cherry picked from commit ce38ef6)
2017-02-21 14:14:54 +01:00
Greg Hulands
a16680b453 Issue #1780: Safari Webcam Fix.
(cherry picked from commit e82efd2)
2017-02-21 14:13:26 +01:00
Gina Häußge
9f963696c8 Interpret wait during connect fully as ok
Otherwise we might switch to connected state but lack an
acknowledgement to send the next lines and stay in a wait cycle.

Also related to #1770
2017-02-20 12:44:42 +01:00
Gina Häußge
7f0eb8d895 Hex-escape unprintable characters in terminal tab
If there's any binary going over the line like null bytes, we want to
see that here too.
2017-02-20 12:05:38 +01:00
Gina Häußge
e1eaf4eb8e comm: More resilience against garbage on the line during connect
* leading and trailing null bytes will now be stripped
  * while connecting, a "wait" will also trigger switch to connected
    state - relevant when connecting without reset and initial "ok" for
    M110 gets mangled
  * extended virtual printer by new options to test the above:
      * mangled "ok" can now be injected via "preparedOks" setting and
        prepare_ok DEBUG command
      * simulated reset lines on beginning ("start" etc) now only sent
        if new setting "simulateReset" is true

Should fix #1770
2017-02-20 11:57:47 +01:00
Gina Häußge
4cc410133b Fixed description of a setting 2017-02-17 13:52:16 +01:00
Gina Häußge
216f05d553 Hibernate communication with printer during active G4 on Repetier
Should hopefully solve #1506
2017-02-17 13:52:16 +01:00
Gina Häußge
b7c078f429 Fixed size checking in watchdog growth check
It helps to actually update the last checked file size on each
iteration 🤦‍♀️

Related to #1760
2017-02-17 13:05:23 +01:00
Gina Häußge
7331bc2bf5 Ensure file from watched folder is stable in size before upload
Additional fix for #1760
2017-02-16 19:30:58 +01:00
Gina Häußge
59f49f392e Refactored upload/watched to use file check methods in PrinterInterface
Extracted methods to check if modification of a file is possible and
to determine if a specific file is currently select to take care of
denying upload and re-selecting file after upload.

Refactored watched folder handler to use the same methods and mirror
behaviour of file upload via API.

Should solve #1760
2017-02-16 19:29:21 +01:00
Gina Häußge
997e0b510b Abort file analysis if file is about to be overwritten 2017-02-16 16:52:30 +01:00
Gina Häußge
1f9b8f40cd Enqueue copied/moved files/folders for analysis
Fixes #1775
2017-02-15 17:35:42 +01:00
Gina Häußge
8630ec5beb Fix some bugs in the client lib refactoring
* Endless recursion on file delete as reported in #1738
  * Broken implementation of .move
  * Broken definition of .pathForEntry, .entryForPath,
    .pathForElement and .elementByPath
2017-02-15 16:15:35 +01:00
Gina Häußge
e8349d6593 Always create a user session for requests with an API key
API endpoints that were not decorated with restricted_access so far did
not properly create a user session for cookie-less requests with an API
key only.

That meant that flask.current_user stayed an anonymous user, even with
the global admin API key. In case of /api/settings that meant that even
with the global admin API key it was not possible to read settings that
are admin-only (like the API key for example) or user-only.

This has now been rectified by moving the session creation into a
different before_request handler that is registered globally on all API
endpoints, meaning that an API key will now always lead to a user
session to be created, regardless of the requirements of the API
endpoint in question. Additionally the CORS handling was extracted
as well as the API key presence enforcement.

BlueprintPlugins will now also get the CORS and session-from-API-Key
treatment if they do not declare their endpoints as restricted.

Might solve the API key "n/a" issue filed in #1751, but since the cause
of that isn't identified yet that's not sure.
2017-02-15 13:12:35 +01:00
Gina Häußge
9b457cce9e Fixed user settings API 2017-02-15 11:38:33 +01:00
Gina Häußge
b2229ae24a SWU: Ignore empty or None configs 2017-02-14 15:03:20 +01:00
Gina Häußge
189c842881 dict_merge should not hiccup on None values 2017-02-14 15:02:33 +01:00
Gina Häußge
6963e5e495 SWU: We need to do that overwrite protection differently
Only replace data from config.yaml with merged results once everything
trying to overwrite stuff is filtered out.
2017-02-14 12:52:07 +01:00
Gina Häußge
7b6642f7c2 SWU: Better resilience against overwriting of update configs
Don't allow overwriting of "octoprint" config through plugins, don't
allow overwriting of already registered configs unless id to register
matches plugin identifier (in which case the already registered config
was probably a case of a copy-paste-error from another plugin).
2017-02-14 11:14:03 +01:00
Gina Häußge
5d97dc4b40 Better resilience against broken software update configs
Fixes #1773
2017-02-14 10:42:02 +01:00
Paul de Vries
b453897ea3 Upgrade LESS.min.js from 2.7.1 to 2.7.2
This will fix the broken contrast function introduced in 2.7.1

This commit will only affect the contrast function
See more @ https://github.com/less/less.js/compare/v2.7.1...v2.7.2#diff-8c2e50ef84a06711745a46e22c67d631
2017-02-05 14:45:10 +01:00
Gina Häußge
54a9a7b906 Use codecs.open for translation po files 2017-01-26 17:22:51 +01:00
Gina Häußge
a3f24c59e9 Don't render untranslated strings to messages.js 2017-01-26 17:22:07 +01:00
Gina Häußge
eaadf8743b Allow multiple instances of the JS client
We now have a global OctoPrintClient, which is the class from which
all clients are derived, and a global OctoPrint, which is a single
instance already setup and ready to use in case we only need one.

It would be cleaner to have clients create that singular instance
themselves, but we need to maintain backward compatibility for now
with how we established the client to work with the 1.3.0 release.

New clients can be create with

    client = new OctoPrintClient({ /* options */ });

Alternatively the options can be left out and set at a later point:

    client = new OctoPrintClient();
    /* ... */
    client.options = { /* options */ };

Individual client components register themselves with OctoPrintClient
via OctoPrintClient.registerComponent(name, component) from the
component JS files. Just like before their instances are then
available in the individual client instances under "<client>.<name>",
 e.g. "OctoPrint.files".

Plugin components register themselves with OctoPrintClient via
OctoPrintClient.registerPluginComponent(name, component) from the
component JS files. Just like before their instances are then
available in the individual client instances under "<client>.plugins
.<name>", e.g. "OctoPrint.plugins.softwareupdate".

This should make it possible to create dashboard pages utilizing the
JS client that monitor the status of multiple OctoPrint instances,
without workarounds such as having to swap out the options globally
before each request.

See #1681 for the corresponding discussion.
2017-01-26 14:59:56 +01:00
Gina Häußge
b0cd742bf4 Fix UMD pattern 2017-01-26 14:59:54 +01:00
Gina Häußge
7ab3eabe0f Support for shared nozzle setups
Support multi-extruder setups that share a single nozzle and heater,
like the E3D Cyclops, Diamon hotend or probably the upcoming Prusa Mk2
multi-extruder upgrade.

The Control tab will still allow tool switching and extruding for
the configured extruders, the Temperature tab will only display
one hotend temperature though.

Printer profiles have been extended by a new option
extruder.sharedNozzle that defaults to False. Extruder offsets are
not displayed in the profile editor if that setting is checked and
reset to (0,0).
2017-01-26 13:33:42 +01:00
Gina Häußge
8f3b6dca79 Fix stupid typo 2017-01-25 16:21:15 +01:00
Gina Häußge
29a2c6abec Allow new locales to be provided by plugins
Core translations still win over plugin translations, but at least
this way it's possible to provide full blown translations via plugins.
2017-01-25 16:02:25 +01:00
Gina Häußge
9250cd0c3b Whitespace, comments & added @eyal0 to AUTHORS.md
(cherry picked from commit c7f67cc)
2017-01-24 11:38:52 +01:00
Eyal Soha
6b2f28240e Ignore a leading v or V in github release tags.
This fixes foosel/OctoPrint#1723 .

(cherry picked from commit f1c3829)
2017-01-24 11:38:46 +01:00
Gina Häußge
c8dfe363bc Only offer daemon subcommand on linux 2017-01-20 17:10:59 +01:00
Gina Häußge
e20fcd9ce5 Merge branch 'rc/maintenance' into maintenance 2017-01-20 16:28:42 +01:00
Gina Häußge
3da3cfd8a0 Fixed passing of "daemon" legacy parameter on CLI
This time this hopefully really solves #1641
2017-01-20 15:33:24 +01:00
Gina Häußge
88a8bdf7b3 Add "Restart in safe mode" system menu entry 2017-01-20 14:27:06 +01:00
Gina Häußge
a948050c54 SWU: Fixed update configs without restart 2017-01-19 14:07:04 +01:00
Gina Häußge
0d76df2cd5 SWU: Fixed python_checker and python_updater 2017-01-19 14:06:33 +01:00
Gina Häußge
3b5c2fe519 SWU: Config version 4 didn't properly migrate old commands -> version 5 2017-01-19 12:33:45 +01:00
Gina Häußge
6f5ee4d291 Fixed doctests of software update version checks 2017-01-19 12:33:44 +01:00
Gina Häußge
507ddde9dd Improved error resilience in plugin repository handling 2017-01-19 12:33:43 +01:00
Gina Häußge
a646fff5ff Fix persistence of config version on settings migration 2017-01-19 12:33:27 +01:00
Gina Häußge
6268e27dd7 Fix settings not allowing to delete values not in defaults anymore 2017-01-19 12:33:25 +01:00
Gina Häußge
caa84d7918 Don't kill manual software update configs during migration
See lengthy comment in source added through this commit for details.
2017-01-19 12:11:01 +01:00
Gina Häußge
6d1e28ae9c We still need _read_lines after all in the streamed file info 2017-01-18 13:04:01 +01:00
Gina Häußge
1e482369b8 Further synchronization in comm layer
Prevent concurrent sending of commands from the monitor thread for
incoming ok's while processing the start, pause, resume or cancel
of a print job.
2017-01-18 12:58:38 +01:00
Gina Häußge
a6c4f8ba3b Fix potential race condition on print start
When the sending of the first line of a file to print is still taking
place while an "ok" from the firmware comes in, it's possible
that two threads will try to access the file handle in parallel. That
can lead to trouble within Python's codecs module.

Synchronizing all access to the handle should do the trick.
2017-01-17 17:46:20 +01:00
Gina Häußge
6bd788a83f Always define pixfmt for timelapse in video filter chain
Apparently having a chain AND the pix_fmt parameter
produces issues with higher resolutions.

Should fix #1317
2017-01-17 13:03:27 +01:00
Gina Häußge
4c971a92db from ... import * is only allowed at module level 2017-01-13 14:17:39 +01:00
Gina Häußge
1f0e67f85e Added FAQ link to footer 2017-01-13 13:42:53 +01:00
Noah Martin
74597483dc Added a mask icon for Safari pinned tab and touchbar
(cherry picked from commit ff02192)
2017-01-13 13:33:21 +01:00
Noah Martin
b1057a4cc8 Simplified install process on Mac
(cherry picked from commit 726eec8)
2017-01-13 13:29:11 +01:00
Gina Häußge
20cd13904d Cura: Fix selection of which start/end gcode to choose
So far the plugin selected the gcode script corresponding to the number of
extruders configured in the printer profile. After a close look into the
implementation in Cura itself, prompted by #1708, it turns out that this is
in fact wrong.

Cura selects the gcode script to use based on the maximum of the number of
extruders needed for printing the models in the scene and the minimum number
of extruders needed for generating support (if support extruder is "both" or "first"
or there is only one extruder, that's 1, if it's "second" and there is more than one
extruder, it's 2).

This commit changes the plugin's implementation to mirror this implementation.
The difference to Cura is that we have the number of extruders needed for the
models in the scene hard coded to 1 since we only support STL right now which
can never contain more than one object. If we ever decide to support merging of
multiple STLs into one single multi-extruder print or other model files like AMF
or OBJ from OctoPrint's slicer support, we need to change this.
2017-01-13 12:54:01 +01:00
Gina Häußge
95e4ad82b4 Cura: Fix off-by-one error for placeholder replacement
Affected print_temperature and filament_diameter placeholders.

E.g. `print_temperature2` was wrongly attempting to fetch `print_temperatures[2]`
 instead of `print_temperatures[1]` (0-based-indexing!)

 Partially fixes #1708
2017-01-13 11:25:08 +01:00
Gina Häußge
9e3d2bed65 Merge branch 'improve/passwordManagers' into maintenance 2017-01-12 18:59:39 +01:00
Gina Häußge
7f3d4a8380 Allow configuration of analysis throttling via config.yaml 2017-01-12 18:16:50 +01:00
Gina Häußge
e6dd37e26e Various analysis queue fixes
* Fix priority queue sorting (sorts ascending, not descending!)
  * Abort low priority jobs when a high priority job comes in
  * Utilize queue for tracking aborted jobs too
  * Abort analysis for items that are to be deleted/moved (also
    fixes issue under Windows where it was impossible to delete
    a file for which the analysis was still running).
2017-01-12 18:16:42 +01:00
Gina Häußge
d69c166f10 Fix unanalysed files from subfolders to not be found on startup 2017-01-12 15:15:02 +01:00