Compare commits

...
Author SHA1 Message Date
Gina Häußge 0894d6cab0 ♻️ Use data classes for state monitor & printer 2023-11-30 14:39:51 +01:00
Gina Häußge 6349ce88c4 ⬆️ Upgrade zeroconf 2023-11-28 18:09:42 +01:00
Gina Häußge 6a75fb6c34 🚸 Keep tool change control enabled while printing
Implements #4892
2023-11-28 18:09:23 +01:00
Gina Häußge 734ce07913 🐛 discovery: fix ssdp on vlans
Really listen on ALL configured addresses, not just the first one per
device.

Closes #4814

Thanks @nastevens!
2023-11-28 17:41:42 +01:00
Gina Häußge fb27d5ba64 🥅 virtual: recalculate wait timeout after gcode eval
Otherwise we might run into a race condition in case of long running
commands.

For an example see #4907:

A `G4 S54` triggered a `wait` response, since right after sending the
`ok` the host didn't send a new incoming line fast enough to prevent
that from happening. As a result, combined with several simulated
transmition errors right after, things get so much out of balance that
at some point the incoming queue runs full and an exception gets
triggered, killing the connection with a simulated SerialTimeout.

This fix should close the core cause of #4907
2023-11-28 11:27:08 +01:00
Gina Häußge 33525e46f9 🧑‍💻 virtual: Configuration of simulated errors 2023-11-27 16:59:23 +01:00
Gina Häußge 703ec2da4c ⚡️ Make WSGIContainer use threads for async handling
Copied from current tornado.wsgi.WSGIContainer. Seems to solve
to not delete the tmp files too early.

Also turned UploadStorageFallbackHandler async, otherwise
connections would be closed too early, causing issues in E2E
and probably also regular use.
2023-11-27 11:17:08 +01:00
Gina Häußge 817a8814d8 ⬆️ Upgrade Playwright 2023-11-27 11:17:07 +01:00
Gina Häußge 95f979fa07 Revert "⚡️ Make WSGIContainer use threads for async handling"
This reverts commit 12833a3b83.
2023-11-23 17:44:07 +01:00
Gina Häußge 12833a3b83 ⚡️ Make WSGIContainer use threads for async handling
Copied from current tornado.wsgi.WSGIContainer. Seems to solve
#4764. UploadStorageFallbackHandler needed some adjustments
to not delete the tmp files too early.
2023-11-23 17:11:46 +01:00
GitHub Nightly Merge Action 8b4e40ac32 Merge branch 'master' into maintenance 2023-11-23 00:12:06 +00:00
Credomane Evonguard 3fae2952b1 🚸 Add APIKey details to user settings so QRCode can be viewed. (#4895)
Closes #4894
2023-11-22 17:22:29 +01:00
evan.wurden 8bcebb7ed9 🚸 Add axis labels to model size dimensions (#4898)
Closes #4866
2023-11-22 17:19:18 +01:00
dependabot[bot] a93b4d3972 👷 Bump dessant/lock-threads from 4 to 5 (#4910)
Bumps [dessant/lock-threads](https://github.com/dessant/lock-threads) from 4 to 5.
- [Release notes](https://github.com/dessant/lock-threads/releases)
- [Changelog](https://github.com/dessant/lock-threads/blob/main/CHANGELOG.md)
- [Commits](https://github.com/dessant/lock-threads/compare/v4...v5)

---
updated-dependencies:
- dependency-name: dessant/lock-threads
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-22 17:16:58 +01:00
dependabot[bot] b141f79669 👷 Bump actions/github-script from 6 to 7 (#4909)
Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-22 17:15:57 +01:00
Gina Häußge 2480fcd390 📝 Update plugin tutorial
Make sure cookiecutter templates are correctly shown.

Closes #4852
2023-11-22 15:24:06 +01:00
Gina Häußge fcc99bd2ce 👷 Publish release artifacts as release assets
Closes #4908
2023-11-21 17:50:23 +01:00
Gina Häußge 3953f6309b 📝 logViewModel -> logsViewModel
Closes #4906
2023-11-21 17:03:38 +01:00
Gina Häußge bfd7199afc 🔥 Get rid of unmaintained scripts folder
Closes #4880
2023-11-20 16:05:59 +01:00
Gina Häußge 395a82b14a 🥅 Logging in case of temp parsing errors
See #4903
2023-11-20 11:50:27 +01:00
Gina Häußge a1f43ced66 🥅 Protect offset code against empty temps
Potential fix for #4903
2023-11-20 11:12:54 +01:00
Gina Häußge 5ab0786873 📝 Add note about settings vs data folder
Closes #4787
2023-11-20 10:53:30 +01:00
cociweb 35b12fdf05 🌐 Correct Model vs Modell typos (#4897) 2023-10-27 10:59:42 +02:00
Hynek SchlawackandGina Häußge 4b7cd98e5a 📌 Remove upper pin from argon2-cffi (#4899)
argon2-cffi uses calendar versioning, therefore the pin achieves no compatibility promises and only limits releases to from before 2022.

Co-authored-by: Gina Häußge <gina@octoprint.org>
2023-10-27 10:48:41 +02:00
Gina Häußge 628e8d6589 ✨ Add funding link to footer 2023-10-24 15:57:23 +02:00
Gina Häußge 406c8d857d ✨ Add funding banner to About dialog 2023-10-24 15:57:14 +02:00
Gina Häußge 5b4b029d1d 🚸 More visible funding request in wizard 2023-10-24 15:57:06 +02:00
Gina Häußge 4830ac53c7 ✨ Add operation to FileRemoved event
Also document operation field for FileAdded.
2023-10-24 15:56:55 +02:00
Gina Häußge 523d4aa5ac ✨ Add progress to Print(Failed|Cancelled|Paused) events 2023-10-24 15:56:45 +02:00
Gina Häußge 8a4db71e07 Merge branch 'maintenance' of github.com:OctoPrint/OctoPrint into maintenance 2023-10-19 13:26:30 +02:00
GitHub Nightly Merge Action 1a40b7ac05 Merge branch 'master' into maintenance 2023-10-19 00:11:21 +00:00
Gina Häußge dfe2893049 💸 Update FUNDING.yml
Add ko-fi and liberapay links
2023-10-18 15:05:39 +02:00
Gina Häußge d825eeffe7 🥅 plugin_version could be None
E.g. if we try to load notifications for a bundled plugin (could
happen in case of identifier clash - normally *shouldn't* but just
did during development, so better safe than sorry)
2023-10-17 16:54:08 +02:00
Gina Häußge fb7fa0bde8 Merge branch 'improve/replace_versioneer' into maintenance 2023-10-16 14:41:47 +02:00
GitHub Nightly Merge Action 8f7dff1bc0 Merge branch 'master' into maintenance 2023-10-13 00:11:45 +00:00
Gina Häußge f325791ec6 ⏪ Revert the addition of 3.11.2 to test install matrix 2023-10-12 14:14:35 +02:00
Gina Häußge df257eca83 👷 Fix a typo 2023-10-12 10:47:31 +02:00
Gina Häußge 74990e8ee6 👷 Add bookworm python 3 version to test matrix 2023-10-12 10:46:01 +02:00
Gina Häußge 2813baa232 Merge branch 'staging/bugfix' into maintenance 2023-10-09 17:20:01 +02:00
Gina Häußge 8365b47bd5 🔖 staging/bugfix is now 1.9.4.dev 2023-10-09 17:19:40 +02:00
Gina Häußge 506648c152 🔖 Preparing release of 1.9.3 2023-10-09 14:32:34 +02:00
Gina Häußge d0072cff89 Merge branch 'bug/gcode_script_vuln' into staging/bugfix 2023-10-09 14:31:21 +02:00
Gina Häußge 2b7c01563f 📌 Pin pydantic to 1.10.12
Solves #4893 by working around pydantic/pydantic#7689
2023-10-09 10:49:37 +02:00
Gina Häußge 7bfd77d9eb Merge branch 'master' into staging/bugfix 2023-10-09 10:19:41 +02:00
Gina Häußge 5ca7f07cb7 👷 Include server run in test install workflow 2023-10-09 10:13:40 +02:00
Gina Häußge 3bde48a9fb 🔒️ Use sandboxed jinja env for gcode scripts
Without this patch, an attacker with admin rights could configure
a specially crafted GCODE Script to allow for code execution during
rendering of that script. An attacker might use this to extract data
managed by OctoPrint, or manipulate data managed by OctoPrint,
as well as execute arbitrary commands with the rights of the
OctoPrint process on the server system.

Fixes a reported security issue, CVE pending.
2023-08-31 16:35:08 +02:00
44 changed files with 719 additions and 627 deletions

No files matched your search

+2
View File
@@ -1,5 +1,7 @@
# These are supported funding model platforms
github: [foosel]
ko_fi: OctoPrint
patreon: foosel
liberapay: foosel
custom: https://octoprint.org/support-octoprint/
+32 -5
View File
@@ -195,8 +195,8 @@ jobs:
name: octoprint-logs
path: ${{ github.workspace }}/e2econfig/logs
publish-on-testpypi:
name: 📦 Publish on TestPyPI
publish-on-release:
name: 📦 Publish on GitHub release
if: github.event_name == 'release' && github.repository == 'OctoPrint/OctoPrint'
needs:
- pre-commit
@@ -211,12 +211,39 @@ jobs:
with:
name: dist
path: dist
- name: 📦 Publish to index
- name: ⬆ Upload to release
run: |
UPLOAD_URL="https://uploads.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets"
for file in dist/*; do
[ -e "$file" ] || exit 1
echo "Uploading $file..."
response=$(curl -s -XPOST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: $(file -b --mime-type $file)" \
--data-binary @$file \
"$UPLOAD_URL?name=$(basename $file)")
echo "$response" | jq -e '.errors' >/dev/null && echo "Error uploading $file to release: $response" && exit 1 || true
done
publish-on-testpypi:
name: 📦 Publish on TestPyPI
if: github.event_name == 'release' && github.repository == 'OctoPrint/OctoPrint'
needs:
- publish-on-release
runs-on: ubuntu-latest
steps:
- name: ⬇ Download build result
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: ⬆ Upload to index
uses: pypa/gh-action-pypi-publish@release/v1
continue-on-error: true
with:
password: ${{ secrets.testpypi_password }}
repository_url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/
publish-on-pypi:
name: 📦 Publish tagged releases to PyPI
@@ -229,7 +256,7 @@ jobs:
with:
name: dist
path: dist
- name: 📦 Publish to index
- name: ⬆ Publish to index
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}
+1 -1
View File
@@ -10,7 +10,7 @@ jobs:
name: 🔒 Lock issues & PRs closed over a year
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v4
- uses: dessant/lock-threads@v5
with:
github-token: ${{ github.token }}
issue-comment: ""
+2 -2
View File
@@ -7,7 +7,7 @@ jobs:
issue-automation:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
@@ -72,7 +72,7 @@ jobs:
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/github-script@v6
- uses: actions/github-script@v7
env:
REMINDER: >
Hi @${{ github.event.issue.user.login }}!
+1 -1
View File
@@ -7,7 +7,7 @@ jobs:
linkifyBundles:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
+1 -1
View File
@@ -12,7 +12,7 @@ jobs:
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
+44 -37
View File
@@ -15,21 +15,63 @@ jobs:
matrix:
os: ["ubuntu-latest"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
branch: ["master"]
branch: ["master", "release"]
runs-on: ${{ matrix.os }}
steps:
- name: ⬇ Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
path: src
- name: 🐍 Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: ⬇ Checkout code
# Checkout code and install
- name: ⬇ Checkout code to test
if: ${{ matrix.branch != 'release' }}
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
fetch-depth: 0
path: checkout
- name: 👷 Build and install checkout
if: ${{ matrix.branch != 'release' }}
working-directory: checkout
run: |
pip install .
# Install latest release
- name: 👀 Determine latest release
if: ${{ matrix.branch == 'release' }}
run: |
OCTOPRINT_VERSION=$(curl -i https://github.com/OctoPrint/OctoPrint/releases/latest | grep -i location: | head -n1 | awk -F/ '{print $NF}' | tr -d '\r')
echo "OCTOPRINT_VERSION=$OCTOPRINT_VERSION" >> $GITHUB_ENV
- name: 👷 Build and install latest release
if: ${{ matrix.branch == 'release' }}
run: |
pip install https://github.com/OctoPrint/OctoPrint/archive/${{ env.OCTOPRINT_VERSION }}.zip
# Test if server starts without error
- name: 🏗 Create base config for test server
run: |
mkdir e2econfig
cp -r src/.github/fixtures/with_acl/* e2econfig
- name: 🧪 Start OctoPrint server
run: |
timeout -k 10s 30s octoprint serve --basedir e2econfig &
wait
- name: 🔎 Check octoprint.log for errors
run: |
log=${{ github.workspace }}/e2econfig/logs/octoprint.log
if grep "\- ERROR \-" $log; then
echo "::error::Errors were logged to octoprint.log"
grep -Pazo '(?m)^\N+\- ERROR \-\N*\n(^\N*?\n)*?(?=\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} \- )' $log
exit 1
fi
- name: 📧 Discord success notification
continue-on-error: true
env:
@@ -45,38 +87,3 @@ jobs:
uses: Ilshidur/action-discord@master
with:
args: "🚫 Test install on Python ${{ matrix.python }} under `${{ matrix.os }}` for `OctoPrint/OctoPrint:${{ matrix.branch }}` failed"
install-latest:
name: Install latest release
strategy:
matrix:
os: ["ubuntu-latest"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}
steps:
- name: 👀 Determine latest release
run: |
OCTOPRINT_VERSION=$(curl -i https://github.com/OctoPrint/OctoPrint/releases/latest | grep -i location: | head -n1 | awk -F/ '{print $NF}' | tr -d '\r')
echo "OCTOPRINT_VERSION=$OCTOPRINT_VERSION" >> $GITHUB_ENV
- name: 🐍 Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: 👷 Build and install latest release
run: |
pip install https://github.com/OctoPrint/OctoPrint/archive/${{ env.OCTOPRINT_VERSION }}.zip
- name: 📧 Discord success notification
continue-on-error: true
env:
DISCORD_WEBHOOK: ${{ secrets.discord_webhook }}
uses: Ilshidur/action-discord@master
with:
args: "☑️ Test install on Python ${{ matrix.python }} under `${{ matrix.os }}` for `OctoPrint/OctoPrint:${{ env.OCTOPRINT_VERSION }}` was successful"
- name: 📧 Discord failure notification
continue-on-error: true
if: failure()
env:
DISCORD_WEBHOOK: ${{ secrets.discord_webhook }}
uses: Ilshidur/action-discord@master
with:
args: "🚫 Test install on Python ${{ matrix.python }} under `${{ matrix.os }}` for `OctoPrint/OctoPrint:${{ env.OCTOPRINT_VERSION }}` failed"
+4 -6
View File
@@ -10,7 +10,6 @@ thanks to everyone who contributed!
* 3DPrinterOS
* Al Mucci
* Ash King
* Ben Fritsch
* BigTreeTech
* Boris Hussein
* Brad Jackson
@@ -18,13 +17,12 @@ thanks to everyone who contributed!
* Christian Wolf
* Christian Würthner
* Christoph Sigrist
* Creality3D
* DeltaMaker 3D Printers
* Dennis Breining
* Dima Gorbenko
* Douglas Floyd
* Ed Crump
* Ernesto Martinez
* Fiberpunk
* Franziska Kunsmann
* Hog Duske
* Jacob Renstrom
@@ -41,10 +39,10 @@ thanks to everyone who contributed!
* Lachlan Bell
* Lefteris Lertas
* LulzBot
* Makerbase
* Makespace Madrid
* Mark Greenwald
* Mark Walker
* Martin Majewski
* Michael Aumock
* Michael Badagliacco
* Mike Labanov
@@ -52,7 +50,6 @@ thanks to everyone who contributed!
* Norman Jaffe
* Obico
* Ory Weaver
* Peopoly
* Pete Barnwell
* Raise3D
* Randy C. Will
@@ -64,6 +61,7 @@ thanks to everyone who contributed!
* Stefan Krister
* Steve Dougherty
* Steve Thompson
* Tideline 3D
* Ulrich Kempken
and 1970 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [GitHub Sponsors](https://github.com/users/foosel/sponsorship)!
and 1918 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [GitHub Sponsors](https://github.com/users/foosel/sponsorship)!
+9 -2
View File
@@ -210,8 +210,8 @@ There many configuration options via ``config.yaml`` for the virtual printer tha
EXTENDED_M20: false
LFN_WRITE: false
# Whether to include area report in the M115 output (M115_GEOMETRY_REPORT in Marlin)
m115ReportArea: false
# Whether to include area report in the M115 output (M115_GEOMETRY_REPORT in Marlin)
m115ReportArea: false
# Simulated ambient temperature in °C
ambientTemperature: 21.3
@@ -241,6 +241,13 @@ There many configuration options via ``config.yaml`` for the virtual printer tha
# Resend ratio to simulate noise on the line
resend_ratio: 0
# communication errors to simulate at specific line numbers
simulated_errors:
- 100:resend # requests a simple resend at line 100
- 105:resend_with_timeout # requests a resend at line 105 and simulates not responding to it
- 110:missing_lineno # simulates a missing line number at line 110
- 115:checksum_mismatch # simulates a checksum mismatch at line 115
.. _sec-development-virtual-printer-log:
Log file
+4
View File
@@ -246,6 +246,7 @@ FileAdded
* ``name``: the file's name
* ``type``: the file's type, a list of the path within the type hierarchy, e.g. ``["machinecode", "gcode"]`` or
``["model", "stl"]``
* ``operation``: the operation that triggered the event, either ``add``, ``copy`` or ``move``.
.. note::
@@ -263,6 +264,7 @@ FileRemoved
* ``name``: the file's name
* ``type``: the file's type, a list of the path within the type hierarchy, e.g. ``["machinecode", "gcode"]`` or
``["model", "stl"]``
* ``operation``: the operation that triggered the event, either ``remove`` or ``move``
.. note::
@@ -525,6 +527,7 @@ PrintCancelled
feedrate outside of OctoPrint, e.g. through the printer controller, or if you are printing from SD, this will
NOT be accurate)
* ``fileposition``: position in the file in bytes at the time of cancellation
* ``progress``: print progress as a percentage at the time of cancellation
.. deprecated:: 1.3.0
@@ -557,6 +560,7 @@ PrintPaused
feedrate outside of OctoPrint, e.g. through the printer controller, or if you are printing from SD, this will
NOT be accurate)
* ``fileposition``: position in the file in bytes at the time of pausing
* ``progress``: print progress as a percentage at the time of pausing
.. deprecated:: 1.3.0
+107 -24
View File
@@ -64,13 +64,15 @@ We'll start at the most basic form a plugin can take - just a few simple lines o
Saving this as ``helloworld.py`` in ``~/.octoprint/plugins`` yields you something resembling these log entries upon server startup::
(venv) $ octoprint serve
2015-01-27 11:14:35,124 - octoprint.server - INFO - Starting OctoPrint 1.2.0-dev-448-gd96e56e (devel branch)
2023-11-20 11:14:35,122 - octoprint.startup - INFO - ******************************************************************************
2023-11-20 11:14:35,124 - octoprint.startup - INFO - Starting OctoPrint 1.9.3
2023-11-20 11:14:35,124 - octoprint.startup - INFO - ******************************************************************************
[...]
2015-01-27 11:14:35,124 - octoprint.plugin.core - INFO - Loading plugins from /home/pi/.octoprint/plugins, /home/pi/OctoPrint/src/octoprint/plugins and installed plugin packages...
2023-11-20 11:14:35,124 - octoprint.plugin.core - INFO - Loading plugins from /home/gina/.octoprint/plugins, /home/gina/devel/OctoPrint/src/octoprint/plugins and installed plugin packages...
[...]
2015-01-27 11:14:36,135 - octoprint.plugin.core - INFO - 3 plugin(s) registered with the system:
2023-11-20 11:14:36,135 - octoprint.plugin.core - INFO - 19 plugin(s) registered with the system:
[...]
| Hello World (1.0.0) = /home/pi/.octoprint/plugins/helloworld.py
| Hello World (1.0.0) = /home/gina/.octoprint/plugins/helloworld.py
[...]
OctoPrint found that plugin in the folder and took a look into it. The name and the version it displays in that log
@@ -106,7 +108,7 @@ Apart from being discovered by OctoPrint, our plugin does nothing yet. We want t
and restart OctoPrint. You now get this output in the log::
2015-01-27 11:17:10,792 - octoprint.plugins.helloworld - INFO - Hello World!
2023-11-20 11:17:10,792 - octoprint.plugins.helloworld - INFO - Hello World!
Neat, isn't it? We added a custom class that subclasses one of OctoPrint's :ref:`plugin mixins <sec-plugins-mixins>`
with :class:`~octoprint.plugin.StartupPlugin` and another control property, ``__plugin_implementation__``, that instantiates
@@ -143,7 +145,7 @@ So let's begin. We'll use the `cookiecutter <https://github.com/audreyr/cookiecu
here. This should already be installed if you used the ``plugins`` extra while installing OctoPrint. However,
you may install it with::
(venv) $ pip install "cookiecutter>=1.4,<1.7"
(venv) $ pip install "cookiecutter>=2.1.1,<3"
Then we can use the ``octoprint dev plugin:new`` command [#f1]_ to generate a new OctoPrint plugin skeleton for us::
@@ -229,16 +231,75 @@ configuration parameters for you:
.. code-block:: python
# coding=utf-8
########################################################################################################################
### Do not forget to adjust the following variables to your own plugin.
# The plugin's identifier, has to be unique
plugin_identifier = "helloworld"
# The plugin's python package, should be "octoprint_<plugin identifier>", has to be unique
plugin_package = "octoprint_helloworld"
# The plugin's human readable name. Can be overwritten within OctoPrint's internal data via __plugin_name__ in the
# plugin module
plugin_name = "OctoPrint-Helloworld"
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "1.0.0"
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
plugin_description = """A quick "Hello World" example plugin for OctoPrint"""
plugin_author = "Your Name"
# The plugin's author. Can be overwritten within OctoPrint's internal data via __plugin_author__ in the plugin module
plugin_author = "Your name"
# The plugin's author's mail address.
plugin_author_email = "you@somewhere.net"
# The plugin's homepage URL. Can be overwritten within OctoPrint's internal data via __plugin_url__ in the plugin module
plugin_url = "https://github.com/yourGithubName/OctoPrint-Helloworld"
# The plugin's license. Can be overwritten within OctoPrint's internal data via __plugin_license__ in the plugin module
plugin_license = "AGPLv3"
# Any additional requirements besides OctoPrint should be listed here
plugin_requires = []
### --------------------------------------------------------------------------------------------------------------------
### More advanced options that you usually shouldn't have to touch follow after this point
### --------------------------------------------------------------------------------------------------------------------
# Additional package data to install for this plugin. The subfolders "templates", "static" and "translations" will
# already be installed automatically if they exist. Note that if you add something here you'll also need to update
# MANIFEST.in to match to ensure that python setup.py sdist produces a source distribution that contains all your
# files. This is sadly due to how python's setup.py works, see also http://stackoverflow.com/a/14159430/2028598
plugin_additional_data = []
# Any additional python packages you need to install with your plugin that are not contained in <plugin_package>.*
plugin_additional_packages = []
# Any python packages within <plugin_package>.* you do NOT want to install with your plugin
plugin_ignored_packages = []
# Additional parameters for the call to setuptools.setup. If your plugin wants to register additional entry points,
# define dependency links or other things like that, this is the place to go. Will be merged recursively with the
# default setup parameters as provided by octoprint_setuptools.create_plugin_setup_parameters using
# octoprint.util.dict_merge.
#
# Example:
# plugin_requires = ["someDependency==dev"]
# additional_setup_parameters = {"dependency_links": ["https://github.com/someUser/someRepo/archive/master.zip#egg=someDependency-dev"]}
# "python_requires": ">=3,<4" blocks installation on Python 2 systems, to prevent confused users and provide a helpful error.
# Remove it if you would like to support Python 2 as well as 3 (not recommended).
additional_setup_parameters = {"python_requires": ">=3,<4"}
########################################################################################################################
# ... remaining setup.py content ...
Now all that's left to do is to move our ``helloworld.py`` into the ``octoprint_helloworld`` folder and renaming it to
``__init__.py``. Make sure to delete the copy under ``~/.octoprint/plugins`` in the process, including the ``.pyc`` file!
@@ -249,23 +310,34 @@ discoverable by OctoPrint, however we don't have to reinstall it after any chang
to your OctoPrint installation::
(venv) $ octoprint dev plugin:install
running develop
running egg_info
creating OctoPrint_HelloWorld.egg-info
>> /home/gina/.pyenv/versions/3.11.2/envs/octoprint-py311/bin/python -m pip install -e .
Obtaining file:///home/gina/devel/OctoPrint-Helloworld
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
[...]
Finished processing dependencies for OctoPrint-HelloWorld==1.0.0
Installing collected packages: OctoPrint-Helloworld
Running setup.py develop for OctoPrint-Helloworld
Successfully installed OctoPrint-Helloworld-0.1.0
Restart OctoPrint. Your plugin should still be properly discovered and the log line should be printed::
2015-01-27 13:43:34,134 - octoprint.server - INFO - Starting OctoPrint 1.2.0-dev-448-gd96e56e (devel branch)
2023-11-20 13:43:34,132 - octoprint.startup - INFO - ******************************************************************************
2023-11-20 13:43:34,134 - octoprint.startup - INFO - Starting OctoPrint 1.9.3
2023-11-20 13:43:34,134 - octoprint.startup - INFO - ******************************************************************************
[...]
2015-01-27 13:43:34,134 - octoprint.plugin.core - INFO - Loading plugins from /home/pi/.octoprint/plugins, /home/pi/OctoPrint/src/octoprint/plugins and installed plugin packages...
2023-11-20 13:43:34,134 - octoprint.plugin.core - INFO - Loading plugins from /home/gina/.octoprint/plugins, /home/gina/devel/OctoPrint/src/octoprint/plugins and installed plugin packages...
[...]
2015-01-27 13:43:34,818 - octoprint.plugin.core - INFO - 3 plugin(s) registered with the system:
2023-11-20 13:43:34,818 - octoprint.plugin.core - INFO - 19 plugin(s) registered with the system:
[...]
| Hello World (1.0.0) = /home/pi/devel/OctoPrint-HelloWorld/octoprint_helloworld
| Hello World (1.0.0) = /home/gina/devel/OctoPrint-HelloWorld/octoprint_helloworld
[...]
2015-01-27 13:43:38,997 - octoprint.plugins.helloworld - INFO - Hello World!
2023-11-20 13:43:38,997 - octoprint.plugins.helloworld - INFO - Hello World!
Looks like it still works!
@@ -282,9 +354,20 @@ of information now defined twice:
.. code-block:: python
:caption: setup.py
plugin_name = "OctoPrint-HelloWorld"
# ...
# The plugin's human readable name. Can be overwritten within OctoPrint's internal data via __plugin_name__ in the
# plugin module
plugin_name = "OctoPrint-Helloworld"
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "1.0.0"
plugin_description = "A quick \"Hello World\" example plugin for OctoPrint"
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
plugin_description = """A quick "Hello World" example plugin for OctoPrint"""
# ...
The nice thing about our plugin now being a proper Python package is that OctoPrint can and will access the metadata defined
within ``setup.py``! So, we don't really need to define all this data twice. Remove ``__plugin_name__``, ``__plugin_version__``
@@ -303,9 +386,9 @@ and ``__plugin_description__`` from ``__init__.py``, but leave ``__plugin_implem
and restart OctoPrint::
2015-01-27 13:46:33,786 - octoprint.plugin.core - INFO - 3 plugin(s) registered with the system:
2023-11-20 13:46:33,786 - octoprint.plugin.core - INFO - 19 plugin(s) registered with the system:
[...]
| OctoPrint-HelloWorld (1.0.0) = /home/pi/devel/OctoPrint-HelloWorld/octoprint_helloworld
| OctoPrint-HelloWorld (1.0.0) = /home/gina/devel/OctoPrint-HelloWorld/octoprint_helloworld
[...]
Our "Hello World" Plugin still gets detected fine, but it's now listed under the same name it's installed under,
@@ -327,9 +410,9 @@ Our "Hello World" Plugin still gets detected fine, but it's now listed under the
Restart OctoPrint again::
2015-01-27 13:48:54,122 - octoprint.plugin.core - INFO - 3 plugin(s) registered with the system:
2023-11-20 13:48:54,122 - octoprint.plugin.core - INFO - 19 plugin(s) registered with the system:
[...]
| Hello World (1.0.0) = /home/pi/OctoPrint-HelloWorld/octoprint_helloworld
| Hello World (1.0.0) = /home/gina/devel/OctoPrint-HelloWorld/octoprint_helloworld
[...]
Much better! You can override pretty much all of the metadata defined within ``setup.py`` from within your Plugin itself --
@@ -339,7 +422,7 @@ overrides.
Following the README of the `Plugin Skeleton <https://github.com/OctoPrint/OctoPrint-PluginSkeleton>`_ you could now
already publish your plugin on Github and it would be directly installable by others using pip::
(venv) $ pip install https://github.com/yourGithubName/OctoPrint-HelloWorld/archive/master.zip
(venv) $ pip install https://github.com/yourGithubName/OctoPrint-HelloWorld/archive/main.zip
But let's add some more features instead.
@@ -532,7 +615,7 @@ settings view model into the ``href`` attribute of the link tag:
.. code-block:: html
<a href="#" data-bind="attr: {href: settings.settings.plugins.helloworld.url}">Hello World!</a>
<a href="javascript:void()" data-bind="attr: {href: settings.settings.plugins.helloworld.url}">Hello World!</a>
You might have noticed the quite ugly way to access our plugin's ``url`` property here: ``settings.settings.plugins.helloworld.url``.
The reason for this is that we'll make our plugin use the existing ``NavigationViewModel`` which holds the
+1 -1
View File
@@ -122,7 +122,7 @@ gcodeViewModel
View model for the gcode viewer tab.
gcodeFilesViewModel
Deprecated in favor of ``filesViewModel``.
logViewModel
logsViewModel
View model for the logfile settings dialog.
loginStateViewModel
View model for the current login state of the user, very interesting for plugins that need to
-44
View File
@@ -1,44 +0,0 @@
# init/systemd files for OctoPrint.
Assumes OctoPrint is installed under user pi at /home/pi/OctoPrint/venv/bin/octoprint. If you have a different
setup you'll need to adjust octoprint.default (init) or octoprint.service (systemd) accordingly.
## init
Download the init.d files to the locations shown:
```
octoprint.default => /etc/default/octoprint
octoprint.init => /etc/init.d/octoprint
```
Next, enable and start the `octoprint` service:
```sh
# Enable octoprint service
sudo update-rc.d octoprint defaults
# and start it
sudo service octoprint start
```
## systemd
Download the systemd files to the locations shown:
```
octoprint.service => /etc/systemd/system/octoprint.service
```
Next, make necessary modifications (if any) then notify systemd:
```sh
sudo systemctl daemon-reload
```
Finally, enable and start the `octoprint` service:
```sh
# Enable octoprint service
sudo systemctl enable octoprint
# and start it
sudo systemctl start octoprint
```
-29
View File
@@ -1,29 +0,0 @@
# Configuration for /etc/init.d/octoprint
# The init.d script will only run if this variable non-empty.
OCTOPRINT_USER=pi
# base directory to use
#BASEDIR=/home/pi/.octoprint
# configuration file to use
#CONFIGFILE=/home/pi/.octoprint/config.yaml
# On what port to run daemon, default is 5000
PORT=5000
# Path to the OctoPrint executable, you need to set this to match your installation!
#DAEMON=/home/pi/OctoPrint/venv/bin/octoprint
# What arguments to pass to octoprint, usually no need to touch this
DAEMON_ARGS="--port=$PORT"
# Umask of files octoprint generates, Change this to 000 if running octoprint as its own, separate user
UMASK=022
# Process priority, 0 here will result in a priority 20 process.
# -2 ensures Octoprint has a slight priority over user processes.
NICELEVEL=-2
# Should we run at startup?
START=yes
-162
View File
@@ -1,162 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: octoprint
# Required-Start: $local_fs networking
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: OctoPrint daemon
# Description: Starts the OctoPrint daemon with the user specified in
# /etc/default/octoprint.
### END INIT INFO
# Author: Sami Olmari & Gina Häußge
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="OctoPrint Daemon"
NAME="OctoPrint"
PKGNAME=octoprint
PIDFILE=/var/run/$PKGNAME.pid
SCRIPTNAME=/etc/init.d/$PKGNAME
DEFAULTS=/etc/default/$PKGNAME
# Read configuration variable file if it is present
[ -r $DEFAULTS ] && . $DEFAULTS
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
# Exit if the DAEMON is not set
if [ -z "$DAEMON" ]
then
log_warning_msg "Not starting $PKGNAME, DAEMON not set in /etc/default/$PKGNAME."
exit 0
fi
# Exit if the DAEMON is not installed
[ -x "$DAEMON" ] || exit 0
# Load the VERBOSE setting and other rcS variables
[ -f /etc/default/rcS ] && . /etc/default/rcS
if [ -z "$START" -o "$START" != "yes" ]
then
log_warning_msg "Not starting $PKGNAME, edit /etc/default/$PKGNAME to start it."
exit 0
fi
if [ -z "$OCTOPRINT_USER" ]
then
log_warning_msg "Not starting $PKGNAME, OCTOPRINT_USER not set in /etc/default/$PKGNAME."
exit 0
fi
COMMAND_ARGS=
if [ -n "$BASEDIR" ]
then
COMMAND_ARGS="--basedir $BASEDIR $COMMAND_ARGS"
fi
if [ -n "$CONFIGFILE" ]
then
COMMAND_ARGS="--config $CONFIGFILE $COMMAND_ARGS"
fi
#
# Function to verify if a pid is alive
#
is_alive()
{
pid=`cat $1` > /dev/null 2>&1
kill -0 $pid > /dev/null 2>&1
return $?
}
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
is_alive $PIDFILE
RETVAL="$?"
if [ $RETVAL != 0 ]; then
start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile \
--exec $DAEMON --chuid $OCTOPRINT_USER --user $OCTOPRINT_USER --umask $UMASK --nicelevel=$NICELEVEL \
-- serve $COMMAND_ARGS $DAEMON_ARGS
RETVAL="$?"
fi
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --user $OCTOPRINT_USER --pidfile $PIDFILE
RETVAL="$?"
[ "$RETVAL" = "2" ] && return 2
rm -f $PIDFILE
[ "$RETVAL" = "0" ] && return 0 || return 1
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
;;
restart)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2
exit 3
;;
esac
-14
View File
@@ -1,14 +0,0 @@
[Unit]
Description=The snappy web interface for your 3D printer
After=network-online.target
Wants=network-online.target
[Service]
Environment="LC_ALL=C.UTF-8"
Environment="LANG=C.UTF-8"
Type=exec
User=pi
ExecStart=/home/pi/OctoPrint/venv/bin/octoprint serve
[Install]
WantedBy=multi-user.target
+4 -4
View File
@@ -35,7 +35,7 @@ bundled_plugins = [
"OctoPrint-PiSupport>=2023.5.24",
]
core_deps = [
"argon2_cffi>=21.3.0,<22",
"argon2-cffi>=21.3.0",
"Babel>=2.12.1,<2.13", # breaking changes can happen on minor version increases
"cachelib>=0.10.2,<0.11",
"Click>=8.1.3,<9",
@@ -57,7 +57,7 @@ core_deps = [
"pathvalidate>=2.5.2,<3",
"pkginfo>=1.9.6,<2",
"psutil>=5.9.4,<6",
"pydantic>=1.10.7,<2",
"pydantic==1.10.12", # to be kept pinned until https://github.com/pydantic/pydantic/issues/7689 is resolved
"pylru>=1.2.1,<2",
"pyserial>=3.5,<4",
"PyYAML>=6.0.1,<7", # changelog at https://github.com/yaml/pyyaml/blob/master/CHANGES
@@ -71,7 +71,7 @@ core_deps = [
"websocket-client>=1.5.1,<2",
"werkzeug>=2.2.3,<2.3", # breaking changes can happen on minor version increases
"wrapt>=1.15,<1.16",
"zeroconf==0.39.4", # final version to include universal wheel, later takes ages to compiles on rpi, piwheels has no wheels for latest either
"zeroconf~=0.127", # breaking changes can happen on minor version increases (despite semantic versioning)
"zipstream-ng>=1.5.0,<2.0.0",
]
vendored_deps = [
@@ -106,7 +106,7 @@ EXTRA_REQUIRES = {
"pyinstrument",
],
# Dependencies for developing OctoPrint plugins
"plugins": ["cookiecutter>=2.1.1,<3"],
"plugins": ["cookiecutter>=2.1.1,<3"], # update plugin tutorial when updating this
# Dependencies for building the documentation
"docs": [
"sphinx",
+2 -2
View File
@@ -52,8 +52,8 @@ improve/.* 1.10.0 cd955e9a46782119b36cc22b8dea5652ebbf9774
# staging/bugfix is the branch for preparation of the 1.9.x bugfix releases
# so are any bug/... branches
staging/bugfix 1.9.3 f027aaa7300f70b046525a49245b33c43dd198c1
bug/.* 1.9.3 f027aaa7300f70b046525a49245b33c43dd198c1
staging/bugfix 1.9.4 506648c152681bf4b1416cf2b5aaf97d526ee752 pep440-dev
bug/.* 1.9.4 506648c152681bf4b1416cf2b5aaf97d526ee752 pep440-dev
# staging/maintenance is currently the branch for preparation of 1.9.0rc7
# so is regressionfix/...
+2
View File
@@ -769,6 +769,7 @@ class FileManager:
"path": path,
"name": name,
"type": get_file_type(name),
"operation": "remove",
},
)
eventManager().fire(Events.UPDATED_FILES, {"type": "printables"})
@@ -814,6 +815,7 @@ class FileManager:
"path": source_path_in_storage,
"name": source_name,
"type": get_file_type(source_name),
"operation": "move",
},
)
eventManager().fire(
+18 -1
View File
@@ -1606,12 +1606,29 @@ class SettingsPlugin(OctoPrintPlugin):
Including the ``SettingsPlugin`` mixin allows plugins to store and retrieve their own settings within OctoPrint's
configuration.
Plugins including the mixing will get injected an additional property ``self._settings`` which is an instance of
Plugins including the mixin will get injected an additional property ``self._settings`` which is an instance of
:class:`PluginSettingsManager` already properly initialized for use by the plugin. In order for the manager to
know about the available settings structure and default values upon initialization, implementing plugins will need
to provide a dictionary with the plugin's default settings through overriding the method :func:`get_settings_defaults`.
The defined structure will then be available to access through the settings manager available as ``self._settings``.
.. note::
Use the settings only to store configuration data or information that is relevant to the UI. Anything in the settings
is part of the hash that is used to determine whether a client's copy of the UI is still up to date or not. If you
store unrelated and possibly often changing information in the settings, you will force the client to reload the
UI without visible changes, which will lead to a bad user experience.
You may store additional data in your plugin's data folder instead, which is not part of the hash and whose path
can be retrieved through :func:`~
octoprint.plugin.types.OctoPrintPlugin.get_plugin_data_folder`, e.g.:
.. code-block:: python
data_folder = self.get_plugin_data_folder()
with open(os.path.join(data_folder, "some_file.txt"), "w") as f:
f.write("some data")
If your plugin needs to react to the change of specific configuration values on the fly, e.g. to adjust the log level
of a logger when the user changes a corresponding flag via the settings dialog, you can override the
:func:`on_settings_save` method and wrap the call to the implementation from the parent class with retrieval of the
@@ -14,7 +14,7 @@
<tbody data-bind="foreach: keys.paginatedItems">
<tr>
<td class="settings_plugin_appkeys_app"><span data-bind="text: app_id"></span><br /><small class="muted">{{ _('API Key') }}: <span data-bind="text: api_key"></span> <a href="javascript:void(0)" title="{{ _('Copy API Key to clipboard')|edq }}" data-bind="click: function() { copyToClipboard(api_key) }"><i class="fas fa-copy"></i></a></small></td>
<td class="settings_plugin_appkeys_actions"><a href="javascript:void(0)" title="{{ _('Revoke')|edq }}" class="far fa-trash-alt" data-bind="click: function() { $parent.revokeKey($data.api_key) }"></a></td>
<td class="settings_plugin_appkeys_actions"><a href="javascript:void(0)" title="{{ _('Revoke')|edq }}" class="far fa-trash-alt" data-bind="click: function() { $parent.revokeKey($data.api_key) }"></a>&nbsp;|&nbsp;<a href="javascript:void(0)" title="{{ _('Details')|edq }}" class="fas fa-search" data-bind="click: function() { $parent.dialog.showDialog(gettext('Details'), $data) }"></a></td>
</tr>
</tbody>
</table>
+7 -6
View File
@@ -703,12 +703,13 @@ class DiscoveryPlugin(
sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2)
sock.bind(("", self.__class__.ssdp_multicast_port))
sock.setsockopt(
socket.IPPROTO_IP,
socket.IP_ADD_MEMBERSHIP,
socket.inet_aton(self.__class__.ssdp_multicast_addr)
+ socket.inet_aton("0.0.0.0"),
)
for address in self.get_interface_addresses():
sock.setsockopt(
socket.IPPROTO_IP,
socket.IP_ADD_MEMBERSHIP,
socket.inet_aton(self.__class__.ssdp_multicast_addr)
+ socket.inet_aton(address),
)
self._logger.info(f"Registered {self.get_instance_name()} for SSDP")
@@ -18,10 +18,10 @@ from octoprint.util.version import (
)
SENTRY_URL_SERVER = (
"https://ba4e3d61c37a4d219e1cd81bdc1417a7@o118517.ingest.sentry.io/1373987"
"https://f723fd2a91da40dbae1148193ea49001@o118517.ingest.sentry.io/1373987"
)
SENTRY_URL_COREUI = (
"https://2382252761de4d318e5f83be0816efaa@o118517.ingest.sentry.io/1374096"
"https://a115318be6faed605c6bfde4e183b7a0@o118517.ingest.sentry.io/1374096"
)
SETTINGS_DEFAULTS = {
@@ -2348,10 +2348,11 @@ def _filter_relevant_notification(notification, plugin_version, octoprint_versio
and (
(version_ranges is None and versions is None)
or (
version_ranges
plugin_version
and version_ranges
and (any(map(lambda v: plugin_version in v, version_ranges)))
)
or (versions and plugin_version in versions)
or (plugin_version and versions and plugin_version in versions)
)
and (
"octoversions" not in notification
@@ -75,6 +75,12 @@ class VirtualPrinterPlugin(
"resend_ratio": 0,
"locked": False,
"passcode": "1234",
"simulated_errors": [
"100:resend",
"105:resend_with_timeout",
"110:missing_lineno",
"115:checksum_mismatch",
],
}
def get_settings_version(self):
@@ -200,10 +200,18 @@ class VirtualPrinter:
self._killed = False
self._triggerResendAt100 = True
self._triggerResendWithTimeoutAt105 = True
self._triggerResendWithMissingLinenoAt110 = True
self._triggerResendWithChecksumMismatchAt115 = True
self._simulated_errors = {}
for v in self._settings.get(["simulated_errors"]):
if ":" not in v:
continue
try:
k, v = v.split(":", 1)
k = int(k)
self._simulated_errors[k] = v
except ValueError:
# ignore this, it's not a valid entry
pass
self._already_simulated_errors = set()
readThread = threading.Thread(
target=self._processIncoming,
@@ -281,10 +289,7 @@ class VirtualPrinter:
self._killed = False
self._triggerResendAt100 = True
self._triggerResendWithTimeoutAt105 = True
self._triggerResendWithMissingLinenoAt110 = True
self._triggerResendWithChecksumMismatchAt115 = True
self._already_simulated_errors.clear()
if self._temperature_reporter is not None:
self._temperature_reporter.cancel()
@@ -340,7 +345,14 @@ class VirtualPrinter:
pass
def _processIncoming(self):
next_wait_timeout = time.monotonic() + self._waitInterval
next_wait_timeout = 0
def recalculate_next_wait_timeout():
nonlocal next_wait_timeout
next_wait_timeout = time.monotonic() + self._waitInterval
recalculate_next_wait_timeout()
buf = b""
while self.incoming is not None and not self._killed:
self._simulateTemps()
@@ -356,7 +368,7 @@ class VirtualPrinter:
except queue.Empty:
if self._sendWait and time.monotonic() > next_wait_timeout:
self._send("wait")
next_wait_timeout = time.monotonic() + self._waitInterval
recalculate_next_wait_timeout()
continue
except Exception:
if self.incoming is None:
@@ -372,7 +384,7 @@ class VirtualPrinter:
else:
continue
next_wait_timeout = time.monotonic() + self._waitInterval
recalculate_next_wait_timeout()
if data is None:
continue
@@ -401,50 +413,41 @@ class VirtualPrinter:
linenumber = int(re.search(b"N([0-9]+)", data).group(1))
self.lastN = linenumber
self.current_line = linenumber
self._triggerResendAt100 = True
self._triggerResendWithTimeoutAt105 = True
self._sendOk()
self._already_simulated_errors.clear()
continue
elif data.startswith(b"N"):
linenumber = int(re.search(b"N([0-9]+)", data).group(1))
expected = self.lastN + 1
if linenumber != expected:
self._triggerResend(actual=linenumber)
continue
elif linenumber == 100 and self._triggerResendAt100:
# simulate a resend at line 100
self._triggerResendAt100 = False
self._triggerResend(expected=100)
continue
elif (
linenumber == 105
and self._triggerResendWithTimeoutAt105
and not self._writingToSd
linenumber in self._simulated_errors
and linenumber not in self._already_simulated_errors
):
# simulate a resend with timeout at line 105
self._triggerResendWithTimeoutAt105 = False
self._triggerResend(expected=105)
self._dont_answer = True
self.lastN = linenumber
continue
elif (
linenumber == 110
and self._triggerResendWithMissingLinenoAt110
and not self._writingToSd
):
self._triggerResendWithMissingLinenoAt110 = False
self._send(self._error("lineno_missing", self.lastN))
continue
elif (
linenumber == 115
and self._triggerResendWithChecksumMismatchAt115
and not self._writingToSd
):
self._triggerResendWithChecksumMismatchAt115 = False
self._triggerResend(checksum=True)
continue
action = self._simulated_errors[linenumber]
if action == "resend":
self._triggerResend(expected=linenumber)
self._already_simulated_errors.add(linenumber)
continue
elif action == "resend_with_timeout" and not self._writingToSd:
self._triggerResend(expected=linenumber)
self._dont_answer = True
self.lastN = linenumber
self._already_simulated_errors.add(linenumber)
continue
elif action == "missing_lineno" and not self._writingToSd:
self._send(self._error("lineno_missing", self.lastN))
self._already_simulated_errors.add(linenumber)
continue
elif action == "checksum_mismatch" and not self._writingToSd:
self._triggerResend(checksum=True)
self._already_simulated_errors.add(linenumber)
continue
elif len(self._prepared_errors):
prepared = self._prepared_errors.pop(0)
if callable(prepared):
@@ -453,11 +456,14 @@ class VirtualPrinter:
elif isinstance(prepared, str):
self._send(prepared)
continue
elif self._rerequest_last:
self._triggerResend(actual=linenumber)
continue
else:
self.lastN = linenumber
data = data.split(None, 1)[1].strip()
data += b"\n"
@@ -528,6 +534,10 @@ class VirtualPrinter:
continue
finally:
# recalculate the timeout again, as we might have just run a long
# running command
recalculate_next_wait_timeout()
# make sure that the debug sleepAfter and sleepAfterNext stuff works even
# if we continued above
if len(self._sleepAfter) or len(self._sleepAfterNext):
+75 -126
View File
@@ -14,6 +14,7 @@ import time
from frozendict import frozendict
import octoprint.schema.printer as schema
import octoprint.util.json
from octoprint import util as util
from octoprint.events import Events, eventManager
@@ -46,12 +47,6 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
self._logger = logging.getLogger(__name__)
self._logger_job = logging.getLogger(f"{__name__}.job")
self._dict = (
frozendict
if settings().getBoolean(["devel", "useFrozenDictForPrinterState"])
else dict
)
self._analysisQueue = analysisQueue
self._fileManager = fileManager
self._printerProfileManager = printerProfileManager
@@ -132,28 +127,11 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
on_get_resends=self._updateResendDataCallback,
)
self._stateMonitor.reset(
state=self._dict(
schema.PrinterState(
text=self.get_state_string(),
flags=self._getStateFlags(),
error=self.get_error(),
),
job_data=self._dict(
file=self._dict(name=None, path=None, size=None, origin=None, date=None),
estimatedPrintTime=None,
lastPrintTime=None,
filament=self._dict(length=None, volume=None),
user=None,
),
progress=self._dict(
completion=None,
filepos=None,
printTime=None,
printTimeLeft=None,
printTimeOrigin=None,
),
current_z=None,
offsets=self._dict(),
resends=self._dict(count=0, ratio=0),
)
)
eventManager().subscribe(
@@ -823,11 +801,11 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
return self._comm.getErrorString()
def get_current_data(self, *args, **kwargs):
return util.thaw_frozendict(self._stateMonitor.get_current_data())
return self._stateMonitor.get_current_data()
def get_current_job(self, *args, **kwargs):
currentData = self._stateMonitor.get_current_data()
return util.thaw_frozendict(currentData["job"])
return currentData["job"]
def get_current_temperatures(self, *args, **kwargs):
if self._comm is not None:
@@ -1068,7 +1046,9 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
self._state = state
self._stateMonitor.set_state(
self._dict(text=state_string, flags=self._getStateFlags(), error=error_string)
schema.PrinterState(
text=state_string, flags=self._getStateFlags(), error=error_string
)
)
payload = {
@@ -1094,7 +1074,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
printTimeLeftOrigin=None,
):
self._stateMonitor.set_progress(
self._dict(
schema.JobProgress(
completion=int(completion * 100) if completion is not None else None,
filepos=filepos,
printTime=int(printTime) if printTime is not None else None,
@@ -1103,7 +1083,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
)
)
def _updateProgressDataCallback(self):
def _updateProgressDataCallback(self) -> schema.JobProgress:
if self._comm is None:
progress = None
filepos = None
@@ -1160,7 +1140,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
f"Error while estimating print time via {estimator}"
)
return self._dict(
return schema.JobProgress(
completion=progress * 100 if progress is not None else None,
filepos=filepos,
printTime=int(printTime) if printTime is not None else None,
@@ -1168,10 +1148,10 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
printTimeLeftOrigin=printTimeLeftOrigin,
)
def _updateResendDataCallback(self):
def _updateResendDataCallback(self) -> schema.ResendInfo:
if not self._comm:
return self._dict(count=0, transmitted=0, ratio=0)
return self._dict(
return schema.ResendInfo()
return schema.ResendInfo(
count=self._comm.received_resends,
transmitted=self._comm.transmitted_lines,
ratio=int(self._comm.resend_ratio * 100),
@@ -1185,19 +1165,17 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
data = {"time": int(time.time())}
for tool in tools.keys():
data["tool%d" % tool] = self._dict(
actual=tools[tool][0], target=tools[tool][1]
)
data["tool%d" % tool] = {"actual": tools[tool][0], "target": tools[tool][1]}
if bed is not None and isinstance(bed, tuple):
data["bed"] = self._dict(actual=bed[0], target=bed[1])
data["bed"] = {"actual": bed[0], "target": bed[1]}
if chamber is not None and isinstance(chamber, tuple):
data["chamber"] = self._dict(actual=chamber[0], target=chamber[1])
data["chamber"] = {"actual": chamber[0], "target": chamber[1]}
for identifier, values in custom.items():
data[identifier] = self._dict(actual=values[0], target=values[1])
data[identifier] = {"actual": values[0], "target": values[1]}
self._temps.append(data)
self._stateMonitor.add_temperature(self._dict(**data))
self._stateMonitor.add_temperature(data)
def _validateJob(self, filename, sd):
if not valid_file_type(filename, type="machinecode"):
@@ -1248,23 +1226,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
}
else:
self._selectedFile = None
self._stateMonitor.set_job_data(
self._dict(
file=self._dict(
name=None,
path=None,
display=None,
origin=None,
size=None,
date=None,
),
estimatedPrintTime=None,
averagePrintTime=None,
lastPrintTime=None,
filament=None,
user=None,
)
)
self._stateMonitor.set_job_data(schema.JobData())
return
estimatedPrintTime = None
@@ -1329,8 +1291,8 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
date = data.timestamp
self._stateMonitor.set_job_data(
self._dict(
file=self._dict(
schema.JobData(
file=schema.FileInfo(
name=name_in_storage,
path=path_in_storage,
display=display_name,
@@ -1354,14 +1316,8 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
):
self._selectedFile["user"] = user
job_data = self.get_current_job()
self._stateMonitor.set_job_data(
self._dict(
file=job_data["file"],
estimatedPrintTime=job_data["estimatedPrintTime"],
averagePrintTime=job_data["averagePrintTime"],
lastPrintTime=job_data["lastPrintTime"],
filament=job_data["filament"],
self._stateMonitor.update_job_data(
schema.JobData(
user=user,
)
)
@@ -1390,7 +1346,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
)
def _getStateFlags(self):
return self._dict(
return schema.StateFlags(
operational=self.is_operational(),
printing=self.is_printing(),
cancelling=self.is_cancelling(),
@@ -1453,6 +1409,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
payload["time"] = self._comm.getPrintTime()
payload["reason"] = "error"
payload["error"] = self._comm.getErrorString()
payload["progress"] = self._comm.getPrintProgress()
def finalize():
self._fileManager.log_print(
@@ -1534,7 +1491,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
def on_comm_sd_state_change(self, sdReady):
self._stateMonitor.set_state(
self._dict(
schema.PrinterState(
text=self.get_state_string(),
flags=self._getStateFlags(),
error=self.get_error(),
@@ -1569,7 +1526,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
self._setJobData(full_path, size, sd, user=user, data=data)
self._stateMonitor.set_state(
self._dict(
schema.PrinterState(
text=self.get_state_string(),
flags=self._getStateFlags(),
error=self.get_error(),
@@ -1628,7 +1585,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
printTimeLeft=0,
)
self._stateMonitor.set_state(
self._dict(
schema.PrinterState(
text=self.get_state_string(),
flags=self._getStateFlags(),
error=self.get_error(),
@@ -1669,7 +1626,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
else:
self._updateProgressData()
self._stateMonitor.set_state(
self._dict(
schema.PrinterState(
text=self.get_state_string(),
flags=self._getStateFlags(),
error=self.get_error(),
@@ -1688,11 +1645,13 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
self._updateProgressData()
fileposition = self._comm.getFilePosition() if self._comm else None
progress = self._comm.getPrintProgress() if self._comm else None
payload = self._payload_for_print_job_event(
position=self._comm.cancel_position.as_dict()
if self._comm and self._comm.cancel_position
else None,
fileposition=fileposition["pos"] if fileposition else None,
progress=progress,
action_user=user,
)
if payload:
@@ -1741,11 +1700,13 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
def on_comm_print_job_paused(self, suppress_script=False, user=None):
fileposition = self._comm.getFilePosition() if self._comm else None
progress = self._comm.getPrintProgress() if self._comm else None
payload = self._payload_for_print_job_event(
position=self._comm.pause_position.as_dict()
if self._comm and self._comm.pause_position and not suppress_script
else None,
fileposition=fileposition["pos"] if fileposition else None,
progress=progress,
action_user=user,
)
if payload:
@@ -1809,7 +1770,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
self._setJobData(remote_filename, filesize, True, user=user)
self._updateProgressData(completion=0.0, filepos=0, printTime=0)
self._stateMonitor.set_state(
self._dict(
schema.PrinterState(
text=self.get_state_string(),
flags=self._getStateFlags(),
error=self.get_error(),
@@ -1840,7 +1801,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
self._setJobData(None, None, None)
self._updateProgressData()
self._stateMonitor.set_state(
self._dict(
schema.PrinterState(
text=self.get_state_string(),
flags=self._getStateFlags(),
error=self.get_error(),
@@ -1874,6 +1835,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
print_job_user=None,
position=None,
fileposition=None,
progress=None,
action_user=None,
):
if print_job_file is None:
@@ -1919,6 +1881,9 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
if fileposition is not None:
result["fileposition"] = fileposition
if progress is not None:
result["progress"] = int(progress * 100)
if print_job_user is not None:
result["owner"] = print_job_user
@@ -1947,12 +1912,7 @@ class StateMonitor:
self._on_get_progress = on_get_progress
self._on_get_resends = on_get_resends
self._state = None
self._job_data = None
self._current_z = None
self._offsets = {}
self._progress = None
self._resends = None
self._data = schema.CurrentData()
self._progress_dirty = False
self._resends_dirty = False
@@ -1967,83 +1927,79 @@ class StateMonitor:
self._worker.daemon = True
self._worker.start()
def _get_current_progress(self):
def _get_current_progress(self) -> schema.JobProgress:
if callable(self._on_get_progress):
return self._on_get_progress()
return self._progress
def _get_current_resends(self):
def _get_current_resends(self) -> schema.ResendInfo:
if callable(self._on_get_resends):
return self._on_get_resends()
return self._resends
def reset(
self,
state=None,
job_data=None,
progress=None,
current_z=None,
offsets=None,
resends=None,
):
self.set_state(state)
self.set_job_data(job_data)
self.set_progress(progress)
self.set_current_z(current_z)
self.set_temp_offsets(offsets)
self.set_resends(resends)
def reset(self, state: schema.PrinterState) -> None:
self._data.reset(state=state)
def add_temperature(self, temperature):
def add_temperature(self, temperature: dict) -> None:
self._on_add_temperature(temperature)
self._change_event.set()
def add_log(self, log):
def add_log(self, log: str) -> None:
self._on_add_log(log)
with self._resends_lock:
self._resends_dirty = True
self._change_event.set()
def add_message(self, message):
def add_message(self, message: str) -> None:
self._on_add_message(message)
self._change_event.set()
def set_current_z(self, current_z):
self._current_z = current_z
def set_current_z(self, current_z: float) -> None:
self._data.currentZ = current_z
self._change_event.set()
def set_state(self, state):
def set_state(self, state: schema.PrinterState) -> None:
with self._state_lock:
self._state = state
self._data.state = state
self._change_event.set()
def set_job_data(self, job_data):
self._job_data = job_data
def set_job_data(self, job_data: schema.JobData) -> None:
self._data.job = job_data
self._change_event.set()
def trigger_progress_update(self):
def update_job_data(self, job_data: schema.JobData) -> None:
self._data.job.update(job_data)
self._change_event.set()
def trigger_progress_update(self) -> None:
with self._progress_lock:
self._progress_dirty = True
self._change_event.set()
def set_progress(self, progress):
def set_progress(self, progress: schema.JobProgress) -> None:
with self._progress_lock:
self._progress_dirty = False
self._progress = progress
self._data.progress = progress
self._change_event.set()
def set_resends(self, resend_ratio):
def trigger_resends_update(self) -> None:
with self._resends_lock:
self._resends_dirty = True
self._change_event.set()
def set_resends(self, resend_info: schema.ResendInfo) -> None:
with self._resends_lock:
self._resends_dirty = False
self._resends = resend_ratio
self._data.resends = resend_info
self._change_event.set()
def set_temp_offsets(self, offsets):
def set_temp_offsets(self, offsets: dict) -> None:
if offsets is None:
offsets = {}
self._offsets = offsets
self._data.offsets = offsets
self._change_event.set()
def _work(self):
def _work(self) -> None:
try:
while True:
self._change_event.wait()
@@ -2066,25 +2022,18 @@ class StateMonitor:
"to include logs!)"
)
def get_current_data(self):
def get_current_data(self) -> dict:
with self._progress_lock:
if self._progress_dirty:
self._progress = self._get_current_progress()
self._data.progress = self._get_current_progress()
self._progress_dirty = False
with self._resends_lock:
if self._resends_dirty:
self._resends = self._get_current_resends()
self._data.resends = self._get_current_resends()
self._resends_dirty = False
return {
"state": self._state,
"job": self._job_data,
"currentZ": self._current_z,
"progress": self._progress,
"offsets": self._offsets,
"resends": self._resends,
}
return self._data.dict()
class DataHistory(InvariantContainer):
+92
View File
@@ -0,0 +1,92 @@
from typing import Dict
from octoprint.schema import BaseModel
class StateFlags(BaseModel):
operational: bool = False
printing: bool = False
cancelling: bool = False
pausing: bool = False
resuming: bool = False
finishing: bool = False
closedOrError: bool = False
error: bool = False
paused: bool = False
ready: bool = False
sdReady: bool = False
class PrinterState(BaseModel):
text: str = None
flags: StateFlags = StateFlags()
error: str = None
class FileInfo(BaseModel):
name: str = None
path: str = None
size: int = None
origin: str = None
date: int = None
class FilamentInfo(BaseModel):
length: float = None
volume: float = None
class JobData(BaseModel):
file: FileInfo = None
estimatedPrintTime: float = None
lastPrintTime: float = None
filament: FilamentInfo = None
user: str = None
def update(self, other):
if not isinstance(other, JobData):
return
if other.file is not None:
self.file = other.file
if other.estimatedPrintTime is not None:
self.estimatedPrintTime = other.estimatedPrintTime
if other.lastPrintTime is not None:
self.lastPrintTime = other.lastPrintTime
if other.filament is not None:
self.filament = other.filament
if other.user is not None:
self.user = other.user
class JobProgress(BaseModel):
completion: float = None
filepos: float = None
printTime: float = None
printTimeLeft: float = None
printTimeLeftOrigin: str = None
class ResendInfo(BaseModel):
count: int = 0
transmitted: int = 0
ratio: float = 0.0
class CurrentData(BaseModel):
state: PrinterState = PrinterState()
job: JobData = JobData()
currentZ: float = 0.0
progress: JobProgress = JobProgress()
offsets: Dict[str, float] = {}
resends: ResendInfo = ResendInfo()
def reset(self, state: PrinterState = None):
if state is None:
state = PrinterState()
self.state = state
self.job = JobData()
self.currentZ = 0.0
self.progress = JobProgress()
self.offsets = {}
self.resends = ResendInfo()
+9 -5
View File
@@ -677,10 +677,7 @@ class Server:
## Tornado initialization starts here
ioloop = (
IOLoop()
) # TODO: This way to create the ioloop is deprecated and logs a warning
ioloop.install()
ioloop = IOLoop.current()
enable_cors = settings().getBoolean(["api", "allowCrossOrigin"])
@@ -1020,13 +1017,20 @@ class Server:
removed_headers = ["Server"]
from concurrent.futures import ThreadPoolExecutor
server_routes.append(
(
r".*",
util.tornado.UploadStorageFallbackHandler,
{
"fallback": util.tornado.WsgiInputContainer(
app.wsgi_app, headers=headers, removed_headers=removed_headers
app.wsgi_app,
executor=ThreadPoolExecutor(
thread_name_prefix="WsgiRequestHandler"
),
headers=headers,
removed_headers=removed_headers,
),
"file_prefix": "octoprint-file-upload-",
"file_suffix": ".tmp",
+93 -43
View File
@@ -20,6 +20,8 @@ import tornado.iostream
import tornado.tcpserver
import tornado.util
import tornado.web
from tornado.concurrent import dummy_executor
from tornado.ioloop import IOLoop
from zipstream.ng import ZIP_DEFLATED, ZipStream
import octoprint.util
@@ -562,7 +564,7 @@ class UploadStorageFallbackHandler(RequestlessExceptionLoggingMixin, CorsSupport
self._new_body += value + b"\r\n"
self._new_body += b"--%s--\r\n" % self._multipart_boundary
def _handle_method(self, *args, **kwargs):
async def _handle_method(self, *args, **kwargs):
"""
Takes care of defining the new request body if necessary and forwarding
the current request and changed body to the ``fallback``.
@@ -582,17 +584,24 @@ class UploadStorageFallbackHandler(RequestlessExceptionLoggingMixin, CorsSupport
# directly use data from buffer
body = self._buffer
# rewrite content length
self.request.headers["Content-Length"] = len(body)
try:
# call the configured fallback with request and body to use
self._fallback(self.request, body)
self._headers_written = True
result = self._fallback(self.request, body)
if result is not None:
await result
# self._headers_written = True
finally:
# make sure the temporary files are removed again
for f in self._files:
octoprint.util.silent_remove(f)
self._cleanup_files()
def _cleanup_files(self):
"""
Removes all temporary files created by this handler.
"""
for f in self._files:
octoprint.util.silent_remove(f)
# make all http methods trigger _handle_method
get = _handle_method
@@ -663,12 +672,21 @@ class WsgiInputContainer:
The implementation logic is basically the same as ``tornado.wsgi.WSGIContainer`` but the ``__call__`` and ``environ``
methods have been adjusted to allow for an optionally supplied ``body`` argument which is then used for ``wsgi.input``.
Additionally, some headers can be added or removed from the response by supplying ``forced_headers`` and
``removed_headers`` arguments. ``forced_headers`` will be added to the response, ``removed_headers`` will be removed.
"""
def __init__(
self, wsgi_application, headers=None, forced_headers=None, removed_headers=None
self,
wsgi_application,
executor=None,
headers=None,
forced_headers=None,
removed_headers=None,
):
self.wsgi_application = wsgi_application
self.executor = dummy_executor if executor is None else executor
if headers is None:
headers = {}
@@ -682,11 +700,19 @@ class WsgiInputContainer:
self.removed_headers = removed_headers
def __call__(self, request, body=None):
future = tornado.concurrent.Future()
IOLoop.current().spawn_callback(
self.handle_request, request, body=body, future=future
)
return future
async def handle_request(self, request, body=None, future=None):
"""
Wraps the call against the WSGI app, deriving the WSGI environment from the supplied Tornado ``HTTPServerRequest``.
:param request: the ``tornado.httpserver.HTTPServerRequest`` to derive the WSGI environment from
:param body: an optional body to use as ``wsgi.input`` instead of ``request.body``, can be a string or a stream
:param future: a future to complete after the request has been handled
"""
data = {}
@@ -697,48 +723,72 @@ class WsgiInputContainer:
data["headers"] = response_headers
return response.append
app_response = self.wsgi_application(
WsgiInputContainer.environ(request, body), start_response
)
try:
response.extend(app_response)
loop = IOLoop.current()
app_response = await loop.run_in_executor(
self.executor,
self.wsgi_application,
self.environ(request, body),
start_response,
)
try:
app_response_iter = iter(app_response)
def next_chunk():
try:
return next(app_response_iter)
except StopIteration:
return None
while True:
chunk = await loop.run_in_executor(self.executor, next_chunk)
if chunk is None:
break
response.append(chunk)
finally:
if hasattr(app_response, "close"):
app_response.close()
body = b"".join(response)
finally:
if hasattr(app_response, "close"):
app_response.close()
if not data:
raise Exception("WSGI app did not call start_response")
if not data:
raise Exception("WSGI app did not call start_response")
status_code, reason = data["status"].split(" ", 1)
status_code = int(status_code)
headers = data["headers"]
header_set = {k.lower() for (k, v) in headers}
body = tornado.escape.utf8(body)
if status_code != 304:
if "content-length" not in header_set:
headers.append(("Content-Length", str(len(body))))
if "content-type" not in header_set:
headers.append(("Content-Type", "text/html; charset=UTF-8"))
status_code_str, reason = data["status"].split(" ", 1)
status_code = int(status_code_str)
headers = data["headers"]
header_set = {k.lower() for (k, v) in headers}
body = tornado.escape.utf8(body)
if status_code != 304:
if "content-length" not in header_set:
headers.append(("Content-Length", str(len(body))))
if "content-type" not in header_set:
headers.append(("Content-Type", "text/html; charset=UTF-8"))
header_set = {k.lower() for (k, v) in headers}
for header, value in self.headers.items():
if header.lower() not in header_set:
header_set = {k.lower() for (k, v) in headers}
for header, value in self.headers.items():
if header.lower() not in header_set:
headers.append((header, value))
for header, value in self.forced_headers.items():
headers.append((header, value))
for header, value in self.forced_headers.items():
headers.append((header, value))
headers = [
(header, value)
for header, value in headers
if header.lower() not in self.removed_headers
]
headers = [
(header, value)
for header, value in headers
if header.lower() not in self.removed_headers
]
start_line = tornado.httputil.ResponseStartLine("HTTP/1.1", status_code, reason)
header_obj = tornado.httputil.HTTPHeaders()
for key, value in headers:
header_obj.add(key, value)
request.connection.write_headers(start_line, header_obj, chunk=body)
request.connection.finish()
self._log(status_code, request)
start_line = tornado.httputil.ResponseStartLine(
"HTTP/1.1", status_code, reason
)
header_obj = tornado.httputil.HTTPHeaders()
for key, value in headers:
header_obj.add(key, value)
assert request.connection is not None
request.connection.write_headers(start_line, header_obj, chunk=body)
request.connection.finish()
self._log(status_code, request)
finally:
if future is not None:
future.set_result(None)
@staticmethod
def environ(request, body=None):
+4 -3
View File
@@ -646,9 +646,10 @@ class Settings:
return folder
def _init_script_templating(self):
from jinja2 import BaseLoader, ChoiceLoader, Environment, TemplateNotFound
from jinja2 import BaseLoader, ChoiceLoader, TemplateNotFound
from jinja2.ext import Extension
from jinja2.nodes import Include
from jinja2.sandbox import SandboxedEnvironment
from octoprint.util.jinja import FilteredFileSystemLoader
@@ -717,9 +718,9 @@ class Settings:
def list_templates(self):
return self._default.list_templates()
class RelEnvironment(Environment):
class RelEnvironment(SandboxedEnvironment):
def __init__(self, prefix_sep=":", *args, **kwargs):
Environment.__init__(self, *args, **kwargs)
super().__init__(*args, **kwargs)
self._prefix_sep = prefix_sep
def join_path(self, template, parent):
+1 -1
View File
@@ -1 +1 @@
.actioncol,.btn{text-align:center}.btn,.btn-link,ul.dropdown-menu li a{cursor:pointer}.btn,.slider .slider-handle{background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));margin-bottom:0}.btn,.btn-danger,.btn-info,.btn-inverse,.btn-primary,.btn-success,.btn-warning{filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x}.btn{display:inline-block;*display:inline;*zoom:1;padding:4px 12px;font-size:14px;line-height:20px;vertical-align:middle;color:#333;text-shadow:0 1px 1px rgba(255,255,255,.75);background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);*background-color:#e6e6e6;border:1px solid #ccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.btn.active,.btn.disabled,.btn:active,.btn:focus,.btn:hover,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:first-child{*margin-left:0}.btn:focus,.btn:hover{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:#333 dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.btn.active,.btn:active{background-color:#ccc\9;background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-primary,.slider .slider-selection{text-shadow:0 -1px 0 rgba(0,0,0,.25);background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c)}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class*=" icon-"],.btn-large [class^=icon-]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class*=" icon-"],.btn-small [class^=icon-]{margin-top:0}.btn-mini [class*=" icon-"],.btn-mini [class^=icon-]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.btn-danger.active,.btn-info.active,.btn-inverse.active,.btn-primary.active,.btn-success.active,.btn-warning.active{color:rgba(255,255,255,.75)}.btn-primary{color:#fff;background-color:#006dcc;background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#04c}.btn-primary.active,.btn-primary.disabled,.btn-primary:active,.btn-primary:focus,.btn-primary:hover,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary.active,.btn-primary:active{background-color:#039\9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#f89406}.btn-warning.active,.btn-warning.disabled,.btn-warning:active,.btn-warning:focus,.btn-warning:hover,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning.active,.btn-warning:active{background-color:#c67605\9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#da4f49;background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);bLine truncated
.btn,.btn-link,ul.dropdown-menu li a{cursor:pointer}#files .gcode_files .entry:hover,.btn{background-color:#f5f5f5}.btn,.btn-danger,.btn-info,.btn-inverse,.btn-primary,.btn-success,.btn-warning{filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x}.btn{display:inline-block;*display:inline;*zoom:1;padding:4px 12px;margin-bottom:0;font-size:14px;line-height:20px;text-align:center;vertical-align:middle;color:#333;text-shadow:0 1px 1px rgba(255,255,255,.75);background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);*background-color:#e6e6e6;border:1px solid #ccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.btn.active,.btn.disabled,.btn:active,.btn:focus,.btn:hover,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:first-child{*margin-left:0}.btn:focus,.btn:hover{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:#333 dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.btn.active,.btn:active{background-color:#ccc\9;background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-primary,.slider .slider-selection{text-shadow:0 -1px 0 rgba(0,0,0,.25);background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c)}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class*=" icon-"],.btn-large [class^=icon-]{margin-top:4px}.btn-small [class*=" icon-"],.btn-small [class^=icon-],table td.timelapse_files_checkbox input[type=checkbox],table td.timelapse_unrendered_checkbox input[type=checkbox],table th.timelapse_files_checkbox input[type=checkbox],table th.timelapse_unrendered_checkbox input[type=checkbox]{margin-top:0}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-mini [class*=" icon-"],.btn-mini [class^=icon-]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.border_box,.input-block-level{-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.btn-danger.active,.btn-info.active,.btn-inverse.active,.btn-primary.active,.btn-success.active,.btn-warning.active{color:rgba(255,255,255,.75)}.btn-primary{color:#fff;background-color:#006dcc;background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#04c}.btn-primary.active,.btn-primary.disabled,.btn-primary:active,.btn-primary:focus,.btn-primary:hover,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary.active,.btn-primary:active{background-color:#039\9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#f89406}.btn-warning.active,.btn-warning.disabled,.btn-warning:active,.btn-warning:focus,.btn-warning:hover,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning.active,.btn-warning:active{bLine truncated
@@ -41,11 +41,14 @@ $(function () {
$("a:first", self.aboutTabs).tab("show");
}
self.aboutContent.scrollTop(0);
const maxHeight = $.fn.modal.defaults.maxHeight() - 80 - 60;
self.aboutDialog
.modal({
minHeight: function () {
return Math.max($.fn.modal.defaults.maxHeight() - 80, 250);
}
return Math.max(maxHeight, 250);
},
maxHeight: maxHeight
})
.css({
"margin-left": function () {
@@ -1063,7 +1063,7 @@ $(function () {
gettext("Model size") +
": " +
_.sprintf(
"%(width).2fmm &times; %(depth).2fmm &times; %(height).2fmm",
"%(width).2fmm (X) &times; %(depth).2fmm (Y) &times; %(height).2fmm (Z)",
dimensions
);
output += "<br>";
@@ -4,12 +4,14 @@ $(function () {
self.dontPrintUnattendedAcknowledged = ko.observable(false);
self.dontPortForwardAcknowledged = ko.observable(false);
self.fundingRequestAcknowledged = ko.observable(false);
self.error = ko.observable(false);
self.allAcknowledged = ko.pureComputed(function () {
return (
self.dontPrintUnattendedAcknowledged() &&
self.dontPortForwardAcknowledged()
self.dontPortForwardAcknowledged() &&
self.fundingRequestAcknowledged()
);
});
@@ -34,9 +36,11 @@ $(function () {
self._showAcknowledgementNeededDialog = function () {
self.error(true);
showMessageDialog({
title: gettext("Please acknowledge the safety warnings"),
title: gettext(
"Please acknowledge the safety warnings and call for funding"
),
message: gettext(
"You haven't yet acknowledged all safety warnings. Please do so first."
"You haven't yet acknowledged all safety warnings and the call for funding. Please do so first."
)
});
};
+24
View File
@@ -1092,6 +1092,30 @@ ul.dropdown-menu li a {
}
}
.funding-banner {
display: flex;
flex-grow: 1;
flex-direction: row;
align-items: center;
padding: 1em;
height: 60px;
border-top: 1px solid #85ba80;
border-bottom: 1px solid #85ba80;
background-color: #85ba8066;
.banner-icon {
display: inline-block;
font-size: 4em;
line-height: 1em;
}
.banner-text {
font-size: 1em;
margin: 0 0 0 1.5em;
}
}
/** Footer */
.footer {
ul {
@@ -3,6 +3,13 @@
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h3 id="about_dialog_label">{{ _('About OctoPrint') }}</h3>
</div>
<div class="funding-banner">
<span class="banner-icon">💸</span>
<p class="banner-text">
Work on OctoPrint is only possible through continued financial support by people like you!<br />
<strong><a href="https://octoprint.org/support-octoprint/?utm_source=octoprint&utm_medium=about_banner&utm_campaign=funding" target="_blank" rel="noopener noreferer">Click here if you enjoy OctoPrint and want to help with its funding!</a></strong>
</p>
</div>
<div class="modal-body">
<div class="full-sized-box">
<div class="tabbable row-fluid">
@@ -42,16 +42,21 @@
</div>
</div>
<h4>{{ _('If you enjoy OctoPrint...') }}</h4>
<h4>{{ _('Support OctoPrint\'s ongoing development!') }}</h4>
<div class="row-fluid">
<div class="span1 text-center"><img src="{{ url_for('static', filename='img/tentacle-56x56.png') }}"></div>
<div class="span11">
<p>{% trans url='https://octoprint.org/support-octoprint/?utm_source=octoprint&utm_medium=first_run_wizard' %}
Please consider <strong><a href="{{ url }}" target="_blank">supporting OctoPrint's ongoing development</a></strong>,
which can only continue with funding by users like you! You can also find this link in the "About" dialog.<br>
<p>{% trans url='https://octoprint.org/support-octoprint/?utm_source=octoprint&utm_medium=first_run_wizard&campaign=funding' %}
Work on OctoPrint is only possible through continued financial support by people like you!
If you enjoy OctoPrint, please <strong><a href="{{ url }}" target="_blank">click here to learn how to help with its funding</a></strong> -
every bit helps!<br>
<strong>Thank you!</strong>
{% endtrans %}</p>
<p><label class="checkbox" data-bind="style: { border: !fundingRequestAcknowledged() && error() ? '1px dashed red' : 'inherit' }">
<input type="checkbox" data-bind="checked: fundingRequestAcknowledged">
<strong>{{ _('I have read and understood this') }}</strong>
</label></p>
</div>
</div>
+1 -4
View File
@@ -5,10 +5,7 @@
</ul>
<ul id="footer_links" class="pull-right">
<li><a href="https://octoprint.org" target="_blank" rel="noreferrer noopener"><i class="fas fa-home"></i> {{ _('Web') }}</a></li>
<li><a href="https://community.octoprint.org" target="_blank" rel="noreferrer noopener"><i class="fab fa-discourse"></i> {{ _('Forum') }}</a></li>
<li><a href="https://discord.octoprint.org" target="_blank" rel="noreferrer noopener"><i class="fab fa-discord"></i> {{ _('Discord') }}</a></li>
<li><a href="https://faq.octoprint.org" target="_blank" rel="noreferrer noopener"><i class="fas fa-question-circle"></i> {{ _('FAQ') }}</a></li>
<li><a href="https://docs.octoprint.org" target="_blank" rel="noreferrer noopener"><i class="fas fa-book"></i> {{ _('Docs') }}</a></li>
<li><a href="https://octoprint.org/support-octoprint/?utm_source=octoprint&utm_medium=footer&utm_campaign=funding" target="_blank" rel="noreferrer noopener"><i class="fas fa-donate"></i> {{ _('Donate') }}</a></li>
<li id="footer_about"><a href="javascript:void(0)" data-bind="click: function() { show('about_about') }"><i class="fas fa-info-circle"></i> {{ _('About') }}</a></li>
<li id="footer_systeminfo" data-bind="visible: $root.loginState.hasPermissionKo($root.access.permissions.SYSTEM)"><a href="javascript:void(0)" data-bind="click: function() { show('about_systeminfo') }"><i class="fas fa-flag-checkered"></i> {{ _('System') }}</a></li>
</ul>
+2 -2
View File
@@ -120,12 +120,12 @@
<button class="btn btn-block control-box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendRetractCommand() }">{{ _('Retract') }}</button>
<div data-bind="style: { visibility: tools().length > 1 ? 'visible' : 'hidden' }">
<div class="btn-group control-box" style="display: inline-block">
<button class="btn dropdown-toggle" data-toggle="dropdown" data-bind="enable: isOperational() && !isPrinting() && !isPaused()">
<button class="btn dropdown-toggle" data-toggle="dropdown" data-bind="enable: isOperational()">
{{ _('Switch Tool...') }}
<span class="caret"></span>
</button>
<ul class="dropdown-menu" data-bind="foreach: tools">
<li><a href="#" data-bind="click: $root.sendSelectToolCommand, text: name(), enable: $root.isOperational() && !$root.isPrinting() && !$root.isPaused()"></a></li>
<li><a href="javascript:void(0)" data-bind="click: $root.sendSelectToolCommand, text: name(), enable: $root.isOperational()"></a></li>
</ul>
</div>
<a class="text-info" style="display: inline-block; height: 30px; vertical-align: middle" href="javascript:void(0)" data-bind="popover: {placement: 'top', trigger: 'hover', title: '{{ _('Please note!') }}', content: '{{ _('The selected tool can only be set, it cannot be read back from the firmware due to a limitation of the communication protocol. There is no way to show the current setting.') }}'}"><i class="fas fa-info-circle"></i></a>
+11 -6
View File
@@ -6138,13 +6138,11 @@ def apply_temperature_offsets(line, offsets, current_tool=None):
return line
groups = match.groupdict()
if "temperature" not in groups or groups["temperature"] is None:
if not groups.get("temperature"):
return line
offset = 0
if current_tool is not None and (
groups["command"] == "104" or groups["command"] == "109"
):
if current_tool is not None and groups["command"] in ("104", "109"):
# extruder temperature, determine which one and retrieve corresponding offset
tool_num = current_tool
if "tool" in groups and groups["tool"] is not None:
@@ -6153,14 +6151,21 @@ def apply_temperature_offsets(line, offsets, current_tool=None):
tool_key = "tool%d" % tool_num
offset = offsets[tool_key] if tool_key in offsets and offsets[tool_key] else 0
elif groups["command"] == "140" or groups["command"] == "190":
elif groups["command"] in ("140", "190"):
# bed temperature
offset = offsets["bed"] if "bed" in offsets else 0
if offset == 0:
return line
temperature = float(groups["temperature"])
try:
temperature = float(groups["temperature"])
except ValueError:
_logger.warning(
f"Could not parse target temperature, ignoring line for offset application: {line}"
)
return line
if temperature == 0:
return line
+66 -31
View File
@@ -9,65 +9,100 @@
"version": "1.0.0",
"license": "MIT",
"devDependencies": {
"@playwright/test": "^1.30.0"
"@playwright/test": "^1.40.0"
}
},
"node_modules/@playwright/test": {
"version": "1.30.0",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.30.0.tgz",
"integrity": "sha512-SVxkQw1xvn/Wk/EvBnqWIq6NLo1AppwbYOjNLmyU0R1RoQ3rLEBtmjTnElcnz8VEtn11fptj1ECxK0tgURhajw==",
"version": "1.40.0",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.0.tgz",
"integrity": "sha512-PdW+kn4eV99iP5gxWNSDQCbhMaDVej+RXL5xr6t04nbKLCBwYtA046t7ofoczHOm8u6c+45hpDKQVZqtqwkeQg==",
"dev": true,
"dependencies": {
"@types/node": "*",
"playwright-core": "1.30.0"
"playwright": "1.40.0"
},
"bin": {
"playwright": "cli.js"
},
"engines": {
"node": ">=14"
"node": ">=16"
}
},
"node_modules/@types/node": {
"version": "18.11.18",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz",
"integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==",
"dev": true
},
"node_modules/playwright-core": {
"version": "1.30.0",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.30.0.tgz",
"integrity": "sha512-7AnRmTCf+GVYhHbLJsGUtskWTE33SwMZkybJ0v6rqR1boxq2x36U7p1vDRV7HO2IwTZgmycracLxPEJI49wu4g==",
"node_modules/fsevents": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"dev": true,
"hasInstallScript": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/playwright": {
"version": "1.40.0",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.0.tgz",
"integrity": "sha512-gyHAgQjiDf1m34Xpwzaqb76KgfzYrhK7iih+2IzcOCoZWr/8ZqmdBw+t0RU85ZmfJMgtgAiNtBQ/KS2325INXw==",
"dev": true,
"dependencies": {
"playwright-core": "1.40.0"
},
"bin": {
"playwright": "cli.js"
},
"engines": {
"node": ">=14"
"node": ">=16"
},
"optionalDependencies": {
"fsevents": "2.3.2"
}
},
"node_modules/playwright-core": {
"version": "1.40.0",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.0.tgz",
"integrity": "sha512-fvKewVJpGeca8t0ipM56jkVSU6Eo0RmFvQ/MaCQNDYm+sdvKkMBBWTE1FdeMqIdumRaXXjZChWHvIzCGM/tA/Q==",
"dev": true,
"bin": {
"playwright-core": "cli.js"
},
"engines": {
"node": ">=16"
}
}
},
"dependencies": {
"@playwright/test": {
"version": "1.30.0",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.30.0.tgz",
"integrity": "sha512-SVxkQw1xvn/Wk/EvBnqWIq6NLo1AppwbYOjNLmyU0R1RoQ3rLEBtmjTnElcnz8VEtn11fptj1ECxK0tgURhajw==",
"version": "1.40.0",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.0.tgz",
"integrity": "sha512-PdW+kn4eV99iP5gxWNSDQCbhMaDVej+RXL5xr6t04nbKLCBwYtA046t7ofoczHOm8u6c+45hpDKQVZqtqwkeQg==",
"dev": true,
"requires": {
"@types/node": "*",
"playwright-core": "1.30.0"
"playwright": "1.40.0"
}
},
"@types/node": {
"version": "18.11.18",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz",
"integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==",
"dev": true
"fsevents": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"dev": true,
"optional": true
},
"playwright": {
"version": "1.40.0",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.0.tgz",
"integrity": "sha512-gyHAgQjiDf1m34Xpwzaqb76KgfzYrhK7iih+2IzcOCoZWr/8ZqmdBw+t0RU85ZmfJMgtgAiNtBQ/KS2325INXw==",
"dev": true,
"requires": {
"fsevents": "2.3.2",
"playwright-core": "1.40.0"
}
},
"playwright-core": {
"version": "1.30.0",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.30.0.tgz",
"integrity": "sha512-7AnRmTCf+GVYhHbLJsGUtskWTE33SwMZkybJ0v6rqR1boxq2x36U7p1vDRV7HO2IwTZgmycracLxPEJI49wu4g==",
"version": "1.40.0",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.0.tgz",
"integrity": "sha512-fvKewVJpGeca8t0ipM56jkVSU6Eo0RmFvQ/MaCQNDYm+sdvKkMBBWTE1FdeMqIdumRaXXjZChWHvIzCGM/tA/Q==",
"dev": true
}
}
+1 -1
View File
@@ -8,6 +8,6 @@
"author": "Gina Häußge",
"license": "MIT",
"devDependencies": {
"@playwright/test": "^1.30.0"
"@playwright/test": "^1.40.0"
}
}
+3 -3
View File
@@ -1967,7 +1967,7 @@ msgstr "Fertig!"
#: src/octoprint/plugins/gcodeviewer/static/js/gcodeviewer.js:700
#: src/octoprint/static/js/app/viewmodels/files.js:1066
msgid "Model size"
msgstr "Modelgröße"
msgstr "Modellgröße"
#: src/octoprint/plugins/gcodeviewer/static/js/gcodeviewer.js:710
msgid "Estimated layer height"
@@ -2128,7 +2128,7 @@ msgstr "Nächste Schicht"
#: src/octoprint/plugins/gcodeviewer/templates/gcodeviewer_tab.jinja2:26
msgid "Model info"
msgstr "Modelinformationen"
msgstr "Modellinformationen"
#: src/octoprint/plugins/gcodeviewer/templates/gcodeviewer_tab.jinja2:29
msgid "Layer info"
@@ -2148,7 +2148,7 @@ msgstr "Ausschnitt auf Modell zentrieren"
#: src/octoprint/plugins/gcodeviewer/templates/gcodeviewer_tab.jinja2:45
msgid "Zoom in on model"
msgstr "Auf Model zoomen"
msgstr "Auf Modell zoomen"
#: src/octoprint/plugins/gcodeviewer/templates/gcodeviewer_tab.jinja2:51
msgid "Show moves"