Merge branch 'maintenance' into devel
This commit is contained in:
commit
58f73f3ed9
25 files changed
+182
-98
No files matched your search
+30
-37
@@ -1,45 +1,11 @@
|
||||
# OctoPrint Changelog
|
||||
|
||||
## 1.3.7rc4 (2018-04-04)
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* [#2536](https://github.com/foosel/OctoPrint/issues/2536) - Fix a wrong state tracking when starting an SD print through the controller, causing a disconnect due to a timeout.
|
||||
* [#2544](https://github.com/foosel/OctoPrint/issues/2544) - Fix an exception when connecting to the raw websocket at `/sockjs/websocket` (instead of `/sockjs/<server_id>/<session_id>/websocket`).
|
||||
* [#2546](https://github.com/foosel/OctoPrint/issues/2546) - Fix the `PRINT_FAILED` event getting triggered twice on print failure due to disconnect
|
||||
|
||||
([Commits](https://github.com/foosel/OctoPrint/compare/1.3.7rc3...1.3.7rc4))
|
||||
|
||||
## 1.3.7rc3 (2018-03-29)
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* [#2524](https://github.com/foosel/OctoPrint/issues/2524) Ignore `wait` while job is on hold.
|
||||
|
||||
([Commits](https://github.com/foosel/OctoPrint/compare/1.3.7rc2...1.3.7rc3))
|
||||
|
||||
## 1.3.7rc2 (2018-03-23)
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* [#1951](http://github.com/foosel/OctoPrint/issues/1951) - Fixed plugins being able to modify internal state data (e.g. progress, job), causing concurrent modification and resulting run time errors in the printer state processing.
|
||||
* [#2494](https://github.com/foosel/OctoPrint/issues/2494) - Fixed `undefined` values not saving in the settings.
|
||||
* [#2499](https://github.com/foosel/OctoPrint/issues/2499) - Fixed communication error notification lacking the actual error message.
|
||||
* [#2501](https://github.com/foosel/OctoPrint/issues/2501) - Fixed a bug causing log downloads to fail with an HTTP 500 error.
|
||||
* [#2506](https://github.com/foosel/OctoPrint/issues/2506) - Fixed `printer.get_current_data` and `printer.get_current_job` returning `frozendict` instead of `dict` instances, causing issues with plugins relying on being able to modify the returned data (e.g. [dattas/OctoPrint-DetailedProgress#26](https://github.com/dattas/OctoPrint-DetailedProgress/issues/26)).
|
||||
* [#2508](https://github.com/foosel/OctoPrint/issues/2508) - Fixed HTTP 500 error on `/api/slicing` in case of an unconfigured slicer.
|
||||
* Have `OctoPrintJsonEncoder` fall back to regular flask JSON encoder, otherwise we might not be able to serialize some data types we need to be able to serialize.
|
||||
* Use `pkg_resources` to determine pip version during environment check instead of `import pip; pip.__version__` since the latter causes issues with pip version 9.0.2. In the same spirit make `pip.main` approach of calling `pip` in the PipCaller the last resort during auto detection, only after trying `pip` or `pip.exe` inside the same folder as the Python executable.
|
||||
* Use `octoprint.util.monotonic_time` instead of `monotonic.monotonic` in comm layer.
|
||||
* Fixed timelapse not stopping on print failure due to firmware error due to missing `PrintFailed` event.
|
||||
|
||||
([Commits](https://github.com/foosel/OctoPrint/compare/1.3.7rc1...1.3.7rc2))
|
||||
|
||||
## 1.3.7rc1 (2018-03-19)
|
||||
## 1.3.7 (2018-04-09)
|
||||
|
||||
### Improvements
|
||||
|
||||
* [#324](https://github.com/foosel/OctoPrint/issues/324) & [#2414](https://github.com/foosel/OctoPrint/issues/2414) - Native support for the following [@ commands](http://docs.octoprint.org/en/maintenance/features/atcommands.html): `@pause` (pauses the print), `@resume` (resumes the print), `@cancel` or `@abort` (cancels the print). More commands can be added through the plugin hooks [`octoprint.comm.protocol.atcommand.*`](http://docs.octoprint.org/en/maintenance/plugins/hooks.html#octoprint-comm-protocol-atcommand-phase).
|
||||
* [#1951](http://github.com/foosel/OctoPrint/issues/1951) - Fixed plugins being able to modify internal state data (e.g. progress, job), causing concurrent modification and resulting run time errors in the printer state processing.
|
||||
* [#2208](https://github.com/foosel/OctoPrint/issues/2208) - New plugin hook [`octoprint.comm.protocol.gcode.error`](http://docs.octoprint.org/en/maintenance/plugins/hooks.html#octoprint-comm-protocol-gcode-error) to allow plugins to override OctoPrint's handling of `Error:`/`!!` messages reported by the firmware. Can be used to "downgrade" errors that aren't actually fatal errors that make the printer halt.
|
||||
* [#2213](https://github.com/foosel/OctoPrint/issues/2213) - Made sure to prevent accidental configuration of a temperature cutoff value less than 1min for the temperature graph.
|
||||
* [#2250](https://github.com/foosel/OctoPrint/pull/2250) - Added [`octoprint.util.ResettableTimer`](http://docs.octoprint.org/en/maintenance/modules/util.html#octoprint.util.ResettableTimer) helper class.
|
||||
@@ -50,6 +16,7 @@
|
||||
* Firmware must send a "File opened: ..." message on start of the print
|
||||
* Firmware must respond to an immediately sent `M27` with `SD printing byte <current>/<total>`
|
||||
* Firmware must stay responsive during ongoing print to allow for regular M27 polls (or push those automatically) or M25 to pause/cancel the print through OctoPrint.
|
||||
* Firmware must send `Done printing file` or respond to `M27` with `Not SD printing` when SD printing finishes (either due to being done or to having been cancelled by the user).
|
||||
* [#2362](https://github.com/foosel/OctoPrint/issues/2362) - Added option to configure timelapse snapshot timeout.
|
||||
* [#2367](https://github.com/foosel/OctoPrint/issues/2367) - Added support for `//action:cancel` action command.
|
||||
* [#2378](https://github.com/foosel/OctoPrint/issues/2378) - Made GCODE viewer gracefully handle GCODE subcodes.
|
||||
@@ -104,11 +71,37 @@
|
||||
* [#2426](https://github.com/foosel/OctoPrint/issues/2426) - Made resend logging to `octoprint.log` unicode safe
|
||||
* [#2442](https://github.com/foosel/OctoPrint/issues/2442) - Don't even import disabled plugins, use a dummy entry for them just like for backlisted plugins. More resilience against misbehaving plugins.
|
||||
* [#2461](https://github.com/foosel/OctoPrint/issues/2461) - Fixed OctoPrint not properly disconnecting in case of a firmware error.
|
||||
* [#2494](https://github.com/foosel/OctoPrint/issues/2494) - Fixed `undefined` values not saving in the settings.
|
||||
* [#2499](https://github.com/foosel/OctoPrint/issues/2499) (regression) - Fixed communication error notification lacking the actual error message.
|
||||
* [#2501](https://github.com/foosel/OctoPrint/issues/2501) (regression) - Fixed a bug causing log downloads to fail with an HTTP 500 error.
|
||||
* [#2506](https://github.com/foosel/OctoPrint/issues/2506) (regression) - Fixed `printer.get_current_data` and `printer.get_current_job` returning `frozendict` instead of `dict` instances, causing issues with plugins relying on being able to modify the returned data (e.g. [dattas/OctoPrint-DetailedProgress#26](https://github.com/dattas/OctoPrint-DetailedProgress/issues/26)).
|
||||
* [#2508](https://github.com/foosel/OctoPrint/issues/2508) (regression) - Fixed HTTP 500 error on `/api/slicing` in case of an unconfigured slicer.
|
||||
* [#2524](https://github.com/foosel/OctoPrint/issues/2524) - Ignore `wait` while job is on hold.
|
||||
* [#2536](https://github.com/foosel/OctoPrint/issues/2536) - Fix a wrong state tracking when starting an SD print through the controller, causing a disconnect due to a timeout.
|
||||
* [#2544](https://github.com/foosel/OctoPrint/issues/2544) (regression) - Fix an exception when connecting to the raw websocket at `/sockjs/websocket` (instead of `/sockjs/<server_id>/<session_id>/websocket`).
|
||||
* [#2546](https://github.com/foosel/OctoPrint/issues/2546) (regression) - Fix the `PRINT_FAILED` event getting triggered twice on print failure due to disconnect
|
||||
* Use `pkg_resources` to determine pip version during environment check instead of `import pip; pip.__version__` since the latter causes issues with pip version 9.0.2. In the same spirit make `pip.main` approach of calling `pip` in the PipCaller the last resort during auto detection, only after trying `pip` or `pip.exe` inside the same folder as the Python executable.
|
||||
* Use `octoprint.util.monotonic_time` instead of `monotonic.monotonic` in comm layer.
|
||||
* Fixed timelapse not stopping on print failure due to firmware error due to missing `PrintFailed` event.
|
||||
* Announcement Plugin: Fixed a missing line break in case of more than three announcements in a notification.
|
||||
* Docs: Documentation for printer profile related bits and pieces
|
||||
* Docs: Various fixes of typos and grammar.
|
||||
* Have `OctoPrintJsonEncoder` fall back to regular flask JSON encoder, otherwise we might not be able to serialize some data types we need to be able to serialize. (regression)
|
||||
|
||||
([Commits](https://github.com/foosel/OctoPrint/compare/1.3.6...1.3.7rc1))
|
||||
### Known bugs
|
||||
|
||||
* [#2547](https://github.com/foosel/OctoPrint/issues/2547) - Error during processing of afterPrintJobDone script will trigger PRINT_FAILED event even though PRINT_DONE event was already triggered
|
||||
|
||||
### More Information
|
||||
|
||||
* [Commits](https://github.com/foosel/OctoPrint/compare/1.3.6...1.3.7)
|
||||
* Release Candidates:
|
||||
* [1.3.7rc1](https://github.com/foosel/OctoPrint/releases/tag/1.3.7rc1)
|
||||
* [1.3.7rc2](https://github.com/foosel/OctoPrint/releases/tag/1.3.7rc2)
|
||||
* [1.3.7rc3](https://github.com/foosel/OctoPrint/releases/tag/1.3.7rc3)
|
||||
* [1.3.7rc4](https://github.com/foosel/OctoPrint/releases/tag/1.3.7rc4)
|
||||
* A special **Thank you!** to everyone who reported back on these release candidates this time:
|
||||
[aaronkeck](https://github.com/aaronkeck), [akurz42](https://github.com/akurz42), [andrivet](https://github.com/andrivet), [anthonyst91](https://github.com/anthonyst91), [arhi](https://github.com/arhi), [b-morgan](https://github.com/b-morgan), [BryanSmithDev](https://github.com/BryanSmithDev), [chippypilot](https://github.com/chippypilot), [ChrisHeerschap](https://github.com/ChrisHeerschap), [Crowlord](https://github.com/Crowlord), [dforsi](https://github.com/dforsi), [drdelaney](https://github.com/drdelaney), [FormerLurker](https://github.com/FormerLurker), [goeland86](https://github.com/goeland86), [inspiredbylife](https://github.com/inspiredbylife), [jbjones27](https://github.com/jbjones27), [jesasi](https://github.com/jesasi), [jneilliii](https://github.com/jneilliii), [JohnOCFII](https://github.com/JohnOCFII), [kantlivelong](https://github.com/kantlivelong), [lnx13](https://github.com/lnx13), [makaper](https://github.com/makaper), [markwal](https://github.com/markwal), [MiquelAdell](https://discourse.octoprint.org/u/MiquelAdell), [ml0w](https://github.com/ml0w), [mmotley999](https://github.com/mmotley999), [mrhanman](https://github.com/mrhanman), [SCiunczyk](https://github.com/SCiunczyk), [tdub415](https://github.com/tdub415), [tedder42](https://discourse.octoprint.org/u/tedder42), [thatjoshguy](https://github.com/thatjoshguy), [wescrockett](https://github.com/wescrockett)
|
||||
|
||||
## 1.3.6 (2017-12-12)
|
||||
|
||||
|
||||
+2
-1
@@ -23,6 +23,7 @@ thanks to everyone who contributed!
|
||||
* günter weber
|
||||
* James Seigel
|
||||
* Jeff Moe
|
||||
* Jeff Renfer
|
||||
* Jefferson Hunt
|
||||
* Jeremiah Avery
|
||||
* Josh Daniels
|
||||
@@ -54,4 +55,4 @@ thanks to everyone who contributed!
|
||||
* Thomas Hatley
|
||||
* Trent Shumay
|
||||
|
||||
and 1217 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
|
||||
and 1233 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
|
||||
+1
-1
@@ -472,7 +472,7 @@ Upload file or create folder
|
||||
:form select: Whether to select the file directly after upload (``true``) or not (``false``). Optional, defaults
|
||||
to ``false``. Ignored when creating a folder.
|
||||
: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``. Ignored when creating a folder.
|
||||
is implicitly ``true`` as well. Optional, defaults to ``false``. Ignored when creating a folder.
|
||||
: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``). Ignored when creating a folder.
|
||||
:form foldername: The name of the folder to create. Ignored when uploading a file.
|
||||
|
||||
@@ -37,7 +37,7 @@ Besides that, OctoPrint also provides a :ref:`full state report of the printer <
|
||||
OctoPrint's internal webserver is single threaded and can only handle one request at a time. This is
|
||||
not a problem generally since asynchronous programming allows to just have one request which is waiting for
|
||||
data from a long running backend operation to sleep while handling other requests. The internal framework
|
||||
used for providing the REST API though, Flask, is based on WSGI, which is synchrounous in nature. This means
|
||||
used for providing the REST API though, Flask, is based on WSGI, which is synchronous in nature. This means
|
||||
that it is impossible to wait in a non blocking wait while handling a request on the REST API. So in order to
|
||||
return the response of a command sent to the printer, the single thread of the webserver would have to be blocked
|
||||
by the API while the response wasn't available yet. Which in turn would mean that the whole web server would
|
||||
|
||||
@@ -581,7 +581,7 @@ Profile
|
||||
* - ``axes``
|
||||
- 0..1
|
||||
- Object
|
||||
- Description of the printer's axes properties, one entry each for ``x``, ``y``, ``z`` and ``e`` holding maxium speed
|
||||
- Description of the printer's axes properties, one entry each for ``x``, ``y``, ``z`` and ``e`` holding maximum speed
|
||||
and whether this axis is inverted or not.
|
||||
* - ``axes.{axis}.speed``
|
||||
- 0..1
|
||||
|
||||
@@ -151,7 +151,7 @@ appearance or to modify the order and presence of the various UI components:
|
||||
|
||||
# order of settings, if settings plugins are registered gets extended internally by
|
||||
# section_plugins and all settings plugins
|
||||
settings
|
||||
settings:
|
||||
- section_printer
|
||||
- serial
|
||||
- printerprofiles
|
||||
@@ -454,7 +454,7 @@ 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
|
||||
# Parameters for the print time estimation 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.
|
||||
|
||||
@@ -207,8 +207,8 @@ FolderAdded
|
||||
|
||||
Payload:
|
||||
* ``storage``: the storage's identifier
|
||||
* ``path``: the folders's path within its storage location
|
||||
* ``name``: the folders's name
|
||||
* ``path``: the folder's path within its storage location
|
||||
* ``name``: the folder's name
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -220,8 +220,8 @@ FolderRemoved
|
||||
|
||||
Payload:
|
||||
* ``storage``: the storage's identifier
|
||||
* ``path``: the folders's path within its storage location
|
||||
* ``name``: the folders's name
|
||||
* ``path``: the folder's path within its storage location
|
||||
* ``name``: the folder's name
|
||||
|
||||
.. note::
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ All GCODE scripts have access to the following template variables through the te
|
||||
* ``last_temperature``: Last actual and target temperature reported for all available tools and if available the
|
||||
heated bed. This is a dictionary of key-value pairs. The keys are the indices of the available tools (``0``, ``1``,
|
||||
...) and ``b`` for the heated bed. The values are a dictionary consisting of ``actual`` and ``target`` keys mapped
|
||||
to the corresponding temperature in degrees celsius. Note that not all tools your printer has must necessarily be
|
||||
to the corresponding temperature in degrees Celsius. Note that not all tools your printer has must necessarily be
|
||||
present here, neither must the heated bed - it depends on whether OctoPrint has values for a tool or the bed. Also
|
||||
note that ``actual`` and ``target`` might be ``None``.
|
||||
* ``script``: An object wrapping the script's type (``gcode``) and name (e.g. ``afterPrintCancelled``) as ``script.type``
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
@@ -417,7 +417,7 @@
|
||||
|
||||
Creates a custom exception class. ``name`` may be either a function in which case it will be used
|
||||
as constructor for the new exception class, or a string, in which case a constructor with proper
|
||||
``name``, ``message`` and ``stack`` attributes will be created. The class hierarchy will be propery
|
||||
``name``, ``message`` and ``stack`` attributes will be created. The class hierarchy will be properly
|
||||
setup to subclass ``Error``.
|
||||
|
||||
**Example:**
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
A boolean value, specifies whether to immediately start printing the file after the upload
|
||||
completes (true) or not (false, default)
|
||||
userdata
|
||||
An optional object or a serialized JSON string of additional user supplised data to associate with
|
||||
An optional object or a serialized JSON string of additional user supplied data to associate with
|
||||
the uploaded file.
|
||||
|
||||
See :ref:`Upload file or create folder <sec-api-fileops-uploadfile>` for more details on the file upload API and
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
.. js:function:: OctoPrintClient.socket.onRateTooHigh(measured, maximum)
|
||||
|
||||
Called by the socket client when the last measured round trip time was higher than the
|
||||
current upper procesisng limit, indicating that the messages are now processed slower than
|
||||
current upper processing limit, indicating that the messages are now processed slower than
|
||||
the current rate requires and a slower rate might be necessary.
|
||||
|
||||
Can be overwritten with custom handler methods. The default implementation will call
|
||||
|
||||
@@ -410,8 +410,8 @@ Now look at that!
|
||||
Settings Galore: How to make parts of your plugin user adjustable
|
||||
-----------------------------------------------------------------
|
||||
|
||||
Remember that Wikipedia link we added to our little link in the navigation bar? It links to the english Wikipedia. But
|
||||
what if we want to allow our users to adjust that according to their wishes, e.g. to link to the german language node
|
||||
Remember that Wikipedia link we added to our little link in the navigation bar? It links to the English Wikipedia. But
|
||||
what if we want to allow our users to adjust that according to their wishes, e.g. to link to the German language node
|
||||
about "Hello World" programs instead?
|
||||
|
||||
To allow your users to customized the behaviour of your plugin you'll need to implement the :class:`~octoprint.plugin.SettingsPlugin`
|
||||
@@ -509,7 +509,7 @@ section doesn't yet exist in the file, create it):
|
||||
# [...]
|
||||
|
||||
Restart OctoPrint. Not only should the URL displayed in the log file have changed, but also the link should now (after
|
||||
a proper shift-reload) point to the german Wikipedia node about "Hello World" programs::
|
||||
a proper shift-reload) point to the German Wikipedia node about "Hello World" programs::
|
||||
|
||||
2015-01-30 11:47:18,634 - octoprint.plugins.helloworld - INFO - Hello World! (more: https://de.wikipedia.org/wiki/Hallo-Welt-Programm)
|
||||
|
||||
|
||||
@@ -56,9 +56,9 @@ Example:
|
||||
// more of your view model's implementation
|
||||
}
|
||||
|
||||
// we don't explicitely declare a name property here
|
||||
// we don't explicitly declare a name property here
|
||||
// our view model will be registered under "myCustomViewModel" (implicit
|
||||
// name derived from contructor name) and "yourCustomViewModel" (explicitely
|
||||
// name derived from constructor name) and "yourCustomViewModel" (explicitly
|
||||
// provided as additional name)
|
||||
OCTOPRINT_VIEWMODELS.push({
|
||||
construct: MyCustomViewModel,
|
||||
|
||||
@@ -184,7 +184,7 @@ class StorageInterface(object):
|
||||
|
||||
def copy_folder(self, source, destination):
|
||||
"""
|
||||
Copys the folder ``source`` to ``destination``
|
||||
Copies the folder ``source`` to ``destination``
|
||||
|
||||
:param string source: path to the source folder
|
||||
:param string destination: path to destination
|
||||
@@ -233,7 +233,7 @@ class StorageInterface(object):
|
||||
|
||||
def copy_file(self, source, destination):
|
||||
"""
|
||||
Copys the file ``source`` to ``destination``
|
||||
Copies the file ``source`` to ``destination``
|
||||
|
||||
:param string source: path to the source file
|
||||
:param string destination: path to destination
|
||||
|
||||
@@ -71,6 +71,7 @@ import octoprint.plugin
|
||||
import octoprint.timelapse
|
||||
import octoprint._version
|
||||
import octoprint.util
|
||||
import octoprint.util.net
|
||||
import octoprint.filemanager.storage
|
||||
import octoprint.filemanager.analysis
|
||||
import octoprint.slicing
|
||||
@@ -160,7 +161,7 @@ def unauthorized_user():
|
||||
|
||||
class Server(object):
|
||||
def __init__(self, settings=None, plugin_manager=None, connectivity_checker=None, environment_detector=None,
|
||||
event_manager=None, host="0.0.0.0", port=5000, debug=False, safe_mode=False, allow_root=False,
|
||||
event_manager=None, host=None, port=None, debug=False, safe_mode=False, allow_root=False,
|
||||
octoprint_daemon=None):
|
||||
self._settings = settings
|
||||
self._plugin_manager = plugin_manager
|
||||
@@ -217,6 +218,24 @@ class Server(object):
|
||||
debug = self._debug
|
||||
safe_mode = self._safe_mode
|
||||
|
||||
if self._host is None:
|
||||
host = self._settings.get(["server", "host"])
|
||||
if host is None:
|
||||
if octoprint.util.net.HAS_V6:
|
||||
host = "::"
|
||||
else:
|
||||
host = "0.0.0.0"
|
||||
|
||||
self._host = host
|
||||
|
||||
if ":" in self._host and not octoprint.util.net.HAS_V6:
|
||||
raise RuntimeError("IPv6 host address {!r} configured but system doesn't support IPv6".format(self._host))
|
||||
|
||||
if self._port is None:
|
||||
self._port = self._settings.getInt(["server", "port"])
|
||||
if self._port is None:
|
||||
self._port = 5000
|
||||
|
||||
self._logger = logging.getLogger(__name__)
|
||||
self._setup_heartbeat_logging()
|
||||
pluginManager = self._plugin_manager
|
||||
@@ -471,11 +490,6 @@ class Server(object):
|
||||
|
||||
## Tornado initialization starts here
|
||||
|
||||
if self._host is None:
|
||||
self._host = self._settings.get(["server", "host"])
|
||||
if self._port is None:
|
||||
self._port = self._settings.getInt(["server", "port"])
|
||||
|
||||
ioloop = IOLoop()
|
||||
ioloop.install()
|
||||
|
||||
@@ -627,7 +641,9 @@ class Server(object):
|
||||
default_max_body_size=self._settings.getInt(["server", "maxSize"]),
|
||||
xheaders=True,
|
||||
trusted_downstream=trusted_downstream)
|
||||
self._server.listen(self._port, address=self._host)
|
||||
self._server.listen(self._port, address=self._host if self._host != "::" else None) # special case - tornado
|
||||
# only listens on v4 & v6
|
||||
# if we use None as address
|
||||
|
||||
### From now on it's ok to launch subprocesses again
|
||||
|
||||
@@ -672,7 +688,8 @@ class Server(object):
|
||||
|
||||
# prepare our after startup function
|
||||
def on_after_startup():
|
||||
self._logger.info("Listening on http://%s:%d" % (self._host, self._port))
|
||||
self._logger.info("Listening on http://{}:{}".format(self._host if not ":" in self._host else "[" + self._host + "]",
|
||||
self._port))
|
||||
|
||||
if safe_mode and self._settings.getBoolean(["server", "startOnceInSafeMode"]):
|
||||
self._logger.info("Server started successfully in safe mode as requested from config, removing flag")
|
||||
@@ -1462,15 +1479,10 @@ class Server(object):
|
||||
import BaseHTTPServer
|
||||
import SimpleHTTPServer
|
||||
import threading
|
||||
import socket
|
||||
|
||||
host = self._host
|
||||
port = self._port
|
||||
if host is None:
|
||||
host = self._settings.get(["server", "host"])
|
||||
if port is None:
|
||||
port = self._settings.getInt(["server", "port"])
|
||||
|
||||
self._logger.debug("Starting intermediary server on {}:{}".format(host, port))
|
||||
|
||||
class IntermediaryServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
def __init__(self, rules=None, *args, **kwargs):
|
||||
@@ -1527,9 +1539,27 @@ class Server(object):
|
||||
|
||||
rules = map(process, filter(lambda rule: len(rule) == 2 or len(rule) == 3, rules))
|
||||
|
||||
self._intermediary_server = BaseHTTPServer.HTTPServer((host, port),
|
||||
lambda *args, **kwargs: IntermediaryServerHandler(rules, *args, **kwargs),
|
||||
bind_and_activate=False)
|
||||
class HTTPServerV6(BaseHTTPServer.HTTPServer):
|
||||
address_family = socket.AF_INET6
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
BaseHTTPServer.HTTPServer.__init__(self, *args, **kwargs)
|
||||
|
||||
# make sure to enable dual stack mode, otherwise the socket might only listen on IPv6
|
||||
self.socket.setsockopt(octoprint.util.net.IPPROTO_IPV6, octoprint.util.net.IPV6_V6ONLY, 0)
|
||||
|
||||
if ":" in host:
|
||||
# v6
|
||||
ServerClass = HTTPServerV6
|
||||
else:
|
||||
# v4
|
||||
ServerClass = BaseHTTPServer.HTTPServer
|
||||
|
||||
self._logger.debug("Starting intermediary server on http://{}:{}".format(host if not ":" in host else "[" + host + "]", port))
|
||||
|
||||
self._intermediary_server = ServerClass((host, port),
|
||||
lambda *args, **kwargs: IntermediaryServerHandler(rules, *args, **kwargs),
|
||||
bind_and_activate=False)
|
||||
|
||||
# if possible, make sure our socket's port descriptor isn't handed over to subprocesses
|
||||
from octoprint.util.platform import set_close_exec
|
||||
|
||||
@@ -147,7 +147,7 @@ default_settings = {
|
||||
"triggerOkForM29": True
|
||||
},
|
||||
"server": {
|
||||
"host": "0.0.0.0",
|
||||
"host": None,
|
||||
"port": 5000,
|
||||
"firstRun": True,
|
||||
"startOnceInSafeMode": False,
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<div id="forgot_password_dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="forgot_password_dialog_label" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h3 id="forgot_password_dialog_label">{{ _('Forgot password?') }}</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>{{ _('See detailed instructions at <a href="https://discourse.octoprint.org/t/i-forgot-my-octoprint-password-how-can-i-reset-it/215">I forgot my OctoPrint password, how can I reset it?</a>') }}</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-block" data-dismiss="modal" aria-hidden="true">{{ _('Close') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -18,8 +18,8 @@
|
||||
<div class="controls">
|
||||
<div class="input-append input-block-level">
|
||||
<input type="text" readonly="readonly" id="settings-apikey" data-bind="value: api_key, attr: {placeholder: '{{ _('N/A') }}'}">
|
||||
<a class="btn add-on" title="Copy API Key to clipboard" data-bind="click: copyApiKey, enable: api_key"><i class="fa fa-copy"></i></a>
|
||||
<a class="btn add-on" title="Generate new API Key" data-bind="click: generateApiKey, enable: api_key"><i class="fa fa-refresh"></i></a>
|
||||
<a class="btn add-on" title="Copy API Key to clipboard" data-bind="click: copyApiKey, css: {'disabled': !api_key()}"><i class="fa fa-copy"></i></a>
|
||||
<a class="btn add-on" title="Generate new API Key" data-bind="click: generateApiKey"><i class="fa fa-refresh"></i></a>
|
||||
</div>
|
||||
<span class="help-block">{{ _('Please note that changes to the API key are applied immediately, without having to "Save" first.') }}</span>
|
||||
</div>
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
<div class="controls">
|
||||
<div class="input-append input-block-level">
|
||||
<input type="text" readonly="readonly" id="userSettings-access_apikey" data-bind="value: access_apikey, attr: {placeholder: '{{ _('N/A') }}'}">
|
||||
<a class="btn add-on" title="Copy API Key to clipboard" data-bind="click: copyApikey, enable: access_apikey"><i class="fa fa-copy"></i></a>
|
||||
<a class="btn add-on" title="Copy API Key to clipboard" data-bind="click: copyApikey, css: {'disabled': !access_apikey()}"><i class="fa fa-copy"></i></a>
|
||||
<a class="btn add-on" title="Generate new API Key" data-bind="click: generateApikey"><i class="fa fa-refresh"></i></a>
|
||||
<a class="btn btn-danger add-on" title="Delete API Key" data-bind="click: deleteApikey, enable: access_apikey"><i class="fa fa-trash-o"></i></a>
|
||||
<a class="btn btn-danger add-on" title="Delete API Key" data-bind="click: deleteApikey, css: {'disabled': !access_apikey()}"><i class="fa fa-trash-o"></i></a>
|
||||
</div>
|
||||
<span class="help-block">{{ _('Please note that changes to the API key are applied immediately, without having to "Confirm" first.') }}</span>
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<form id="loginForm" data-bind="event: {'submit': loginState.prepareLogin }" onsubmit="return false; // this gets overwritten on view model bind">
|
||||
<label for="login_user">{{ _('Username') }}</label>
|
||||
<input type="text" id="login_user" name="username" data-bind="valueWithInit: loginState.loginUser" placeholder="{{ _('Username') }}" autocapitalize="none" autocorrect="off">
|
||||
<span class="pull-right"><small><a href="#forgot_password_dialog" data-toggle="modal">{{ _('Forgot password?') }}</a></small></span>
|
||||
<span class="pull-right"><small><a href="https://faq.octoprint.org/forgotten-password" target="_blank" rel="noreferrer noopener" tabindex="-1">{{ _('Forgot password?') }}</a></small></span>
|
||||
<label for="login_pass">{{ _('Password') }}</label>
|
||||
<input type="password" id="login_pass" name="password" data-bind="valueWithInit: loginState.loginPass" placeholder="{{ _('Password') }}">
|
||||
<label class="checkbox">
|
||||
@@ -19,5 +19,3 @@
|
||||
<li><a href="#" id="usersettings_button" data-bind="click: function() { usersettings.show(); }">{{ _('User Settings') }}</a></li>
|
||||
<li><a href="#" id="logout_button" data-bind="click: loginState.logout">{{ _('Logout') }}</a></li>
|
||||
</ul>
|
||||
|
||||
{% include 'dialogs/forgot_password.jinja2' %}
|
||||
@@ -1557,7 +1557,11 @@ class MachineCom(object):
|
||||
handled = True
|
||||
|
||||
# process timeouts
|
||||
elif ((line == "" and now > self._timeout) or (self.isPrinting() and not self.isSdPrinting() and not self.job_on_hold and now > self._ok_timeout)) \
|
||||
elif ((line == "" and now > self._timeout) or (self.isPrinting()
|
||||
and not self.isSdPrinting()
|
||||
and not self.job_on_hold
|
||||
and not self._long_running_command
|
||||
and not self._heating and now > self._ok_timeout)) \
|
||||
and (not self._blockWhileDwelling or not self._dwelling_until or now > self._dwelling_until):
|
||||
# We have two timeout variants:
|
||||
#
|
||||
@@ -3562,7 +3566,8 @@ class PrintingGcodeFileInformation(PrintingFileInformation):
|
||||
"""
|
||||
with self._handle_mutex:
|
||||
if self._handle is None:
|
||||
raise ValueError("File %s is not open for reading" % self._filename)
|
||||
self._logger.warn(u"File {} is not open for reading".format(self._filename))
|
||||
return None, None, None
|
||||
|
||||
try:
|
||||
offsets = self._offsets_callback() if self._offsets_callback is not None else None
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# coding=utf-8
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
|
||||
__copyright__ = "Copyright (C) 2018 The OctoPrint Project - Released under terms of the AGPLv3 License"
|
||||
|
||||
import socket
|
||||
import sys
|
||||
|
||||
HAS_V6 = socket.has_ipv6
|
||||
|
||||
if hasattr(socket, "IPPROTO_IPV6") and hasattr(socket, "IPV6_V6ONLY"):
|
||||
# Dual stack support, hooray!
|
||||
IPPROTO_IPV6 = socket.IPPROTO_IPV6
|
||||
IPV6_V6ONLY = socket.IPV6_V6ONLY
|
||||
else:
|
||||
if sys.platform == "win32":
|
||||
# Python 2.7 on Windows lacks IPPROTO_IPV6, but supports the socket options just fine, let's redefine it
|
||||
IPPROTO_IPV6 = 41
|
||||
IPV6_V6ONLY = 27
|
||||
else:
|
||||
# Whatever we are running on here, it we don't want to use V6 on here due to lack of dual stack support
|
||||
HAS_V6 = False
|
||||
@@ -50,6 +50,22 @@ def recursively_handle_files(directory, file_matcher, folder_matcher=None, folde
|
||||
return applied_handler
|
||||
|
||||
|
||||
def has_requirement(requirement, requirements):
|
||||
if requirement is None or requirements is None:
|
||||
return False
|
||||
|
||||
assert isinstance(requirement, basestring)
|
||||
assert isinstance(requirements, (list, tuple))
|
||||
assert all(map(lambda x: x is not None and isinstance(x, basestring), requirements))
|
||||
|
||||
requirement = requirement.lower()
|
||||
requirements = [r.lower() for r in requirements]
|
||||
compat = [requirement.lower() + c for c in ("<", "<=", "!=", "==", ">=", ">", "~=", "===")]
|
||||
|
||||
return requirement in requirements or \
|
||||
any(any(r.startswith(c) for c in compat) for r in requirements)
|
||||
|
||||
|
||||
class CleanCommand(_clean):
|
||||
user_options = _clean.user_options + [("orig", None, "behave like original clean command"),
|
||||
("noeggs", None, "don't clean up eggs"),
|
||||
@@ -479,7 +495,7 @@ def create_plugin_setup_parameters(identifier="todo", name="TODO", version="0.1"
|
||||
requires = ["OctoPrint"]
|
||||
if not isinstance(requires, list):
|
||||
raise ValueError("requires must be a list")
|
||||
if "OctoPrint" not in requires:
|
||||
if not has_requirement("OctoPrint", requires):
|
||||
requires = ["OctoPrint"] + list(requires)
|
||||
|
||||
if extra_requires is None:
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# coding=utf-8
|
||||
|
||||
import unittest
|
||||
import ddt
|
||||
|
||||
import octoprint_setuptools
|
||||
|
||||
@ddt.ddt
|
||||
class OctoPrintSetuptoolsTest(unittest.TestCase):
|
||||
|
||||
@ddt.data(
|
||||
("OctoPrint", ["OctoPrint", "flask"], True),
|
||||
("OctoPrint", ["OctoPrint<1.3.7", "flask"], True),
|
||||
("OctoPrint", ["OctoPrint<=1.3.7", "flask"], True),
|
||||
("OctoPrint", ["OctoPrint==1.3.7", "flask"], True),
|
||||
("OctoPrint", ["OctoPrint!=1.3.7", "flask"], True),
|
||||
("OctoPrint", ["OctoPrint>=1.3.7", "flask"], True),
|
||||
("OctoPrint", ["OctoPrint>1.3.7", "flask"], True),
|
||||
("OctoPrint", ["OctoPrint~=1.3.7", "flask"], True),
|
||||
("OctoPrint", ["OctoPrint===1.3.7", "flask"], True),
|
||||
("OctoPrint", ["oCTOpRINT>=1.3.7", "flask"], True),
|
||||
("OctoPrint", ["flask"], False),
|
||||
("OctoPrint", [], False),
|
||||
("OctoPrint", None, False),
|
||||
(None, [], False),
|
||||
)
|
||||
@ddt.unpack
|
||||
def test_has_requirement(self, requirement, requirements, expected):
|
||||
actual = octoprint_setuptools.has_requirement(requirement, requirements)
|
||||
self.assertEqual(actual, expected)
|
||||
Reference in new issue
Block a user