diff --git a/.codespell_ignore_words b/.codespell_ignore_words new file mode 100644 index 000000000..ff8047339 --- /dev/null +++ b/.codespell_ignore_words @@ -0,0 +1,4 @@ +managable +commitish +matchs +medias diff --git a/.eslintrc.yaml b/.eslintrc.yaml index c34fe2339..427f3a1e9 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -1,40 +1,4 @@ -overrides: - - files: - - "src/octoprint/static/js/app/**" - env: - browser: true - jquery: true - parserOptions: - ecmaVersion: 5 - rules: - es5/no-arrow-functions: error - es5/no-binary-and-octal-literals: error - es5/no-block-scoping: error - es5/no-classes: error - es5/no-computed-properties: error - es5/no-default-parameters: error - es5/no-destructuring: error - es5/no-exponentiation-operator: error - es5/no-for-of: error - es5/no-generators: error - es5/no-modules: error - es5/no-object-super: error - es5/no-rest-parameters: error - es5/no-shorthand-properties: error - es5/no-spread: error - es5/no-template-literals: error - es5/no-typeof-symbol: error - es5/no-unicode-code-point-escape: error - es5/no-unicode-regex: error - - files: - - "tests/cypress/**" - env: - node: true - es6: true - cypress/globals: true - extends: - - "plugin:cypress/recommended" - -plugins: - - eslint-plugin-es5 - - cypress +env: + browser: true + jquery: true + es2018: true diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 7a3f3bd3e..c1c9fc706 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -2,6 +2,7 @@ # pre-commit version updates b4f265d9f67508677e1697e74e248b895da7f43c +2231e81efd32d649798f7a58cdb1755e34902d8a # Switch to black formatting 1f93b2355a2816918e11a55e61b42010d15a6720 diff --git a/.github/fixtures/with_acl/config.yaml b/.github/fixtures/with_acl/config.yaml index d409a5735..c8d6efab9 100644 --- a/.github/fixtures/with_acl/config.yaml +++ b/.github/fixtures/with_acl/config.yaml @@ -4,10 +4,14 @@ devel: enableRateLimiter: false enableCsrfProtection: false plugins: - virtual_printer: - enabled: true + softwareupdate: + checks: + octoprint: + disabled: true tracking: enabled: false + virtual_printer: + enabled: true server: firstRun: false onlineCheck: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c9edaa801..50fcc7cf8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,7 @@ jobs: name: πŸ§ͺ Unit tests strategy: matrix: - python: ["3.7", "3.8", "3.9", "3.10"] + python: ["3.7", "3.8", "3.9", "3.10", "3.11"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -84,7 +84,7 @@ jobs: needs: build strategy: matrix: - python: ["3.7", "3.8", "3.9", "3.10"] + python: ["3.7", "3.8", "3.9", "3.10", "3.11"] installable: ["wheel", "sdist"] runs-on: ubuntu-latest steps: @@ -110,7 +110,6 @@ jobs: name: πŸ§ͺ E2E tests needs: build runs-on: ubuntu-latest - continue-on-error: true steps: - name: ⬇ Checkout code uses: actions/checkout@v3 @@ -120,11 +119,13 @@ jobs: with: name: dist path: dist + - name: πŸ— Set up Python 3.7 uses: actions/setup-python@v4 with: python-version: 3.7 - - name: πŸš€ Install wheel + + - name: πŸ— Install OctoPrint build run: | pip install dist/OctoPrint-*-py2.py3-none-any.whl @@ -133,26 +134,63 @@ jobs: mkdir e2econfig cp -r .github/fixtures/with_acl/* e2econfig - - name: πŸš€ Run Cypress - uses: cypress-io/github-action@v4.2.0 - with: - working-directory: tests/cypress - browser: chrome - start: "octoprint -b ${{ github.workspace }}/e2econfig serve --host 127.0.0.1 --port 5000" - wait-on: "http://127.0.0.1:5000/online.txt" + - name: πŸ— Prepare Playwright env + working-directory: ./tests/playwright + run: | + npm ci + PLAYWRIGHT_VERSION=$(npm ls --json @playwright/test | jq --raw-output '.dependencies["@playwright/test"].version') + echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV - - name: ⬆ Upload screenshots - uses: actions/upload-artifact@v3 - if: failure() + - name: 🧰 Cache Playwright browser binaries + uses: actions/cache@v3 + id: playwright-cache with: - name: cypress-screenshots - path: tests/cypress/screenshots - - name: ⬆ Upload videos + path: "~/.cache/ms-playwright" + key: "${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}" + restore-keys: | + ${{ runner.os }}-playwright- + + - name: πŸ— Install Playwright browser binaries & OS dependencies + if: steps.playwright-cache.outputs.cache-hit != 'true' + working-directory: ./tests/playwright + run: | + npx playwright install --with-deps + + - name: πŸ— Install Playwright OS dependencies + if: steps.playwright-cache.outputs.cache-hit == 'true' + working-directory: ./tests/playwright + run: | + npx playwright install-deps + + - name: 🎭 Run Playwright + working-directory: ./tests/playwright + run: | + npx playwright test + env: + OCTOPRINT_SERVER_BASE: ${{ github.workspace }}/e2econfig + + - 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: ⬆ Upload Playwright report uses: actions/upload-artifact@v3 if: always() with: - name: cypress-videos - path: tests/cypress/videos + name: playwright-report + path: tests/playwright/playwright-report + + - name: ⬆ Upload OctoPrint logs + uses: actions/upload-artifact@v3 + if: failure() + with: + name: octoprint-logs + path: ${{ github.workspace }}/e2econfig/logs publish-on-testpypi: name: πŸ“¦ Publish on TestPyPI @@ -171,7 +209,7 @@ jobs: name: dist path: dist - name: πŸ“¦ Publish to index - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 continue-on-error: true with: password: ${{ secrets.testpypi_password }} @@ -189,7 +227,7 @@ jobs: name: dist path: dist - name: πŸ“¦ Publish to index - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.pypi_password }} diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 925341c96..7976d1be2 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: os: ["ubuntu-latest"] - python: ["3.7", "3.8", "3.9", "3.10"] + python: ["3.7", "3.8", "3.9", "3.10", "3.11"] branch: ["master"] runs-on: ${{ matrix.os }} steps: @@ -51,7 +51,7 @@ jobs: strategy: matrix: os: ["ubuntu-latest"] - python: ["3.7", "3.8", "3.9", "3.10"] + python: ["3.7", "3.8", "3.9", "3.10", "3.11"] runs-on: ${{ matrix.os }} steps: - name: πŸ‘€ Determine latest release diff --git a/.gitignore b/.gitignore index f330dc36c..a171eb1a7 100644 --- a/.gitignore +++ b/.gitignore @@ -41,7 +41,3 @@ pypy venv* testconf* - -node_modules -tests/cypress/screenshots -tests/cypress/videos diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d952645fa..8fc5fa364 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,9 @@ -exclude: ^(src/octoprint/vendor/|src/octoprint/static/js/lib|src/octoprint/static/vendor|tests/static/js/lib|tests/util/_files|docs/|scripts/|translations/|.*\.css|.*\.svg) +default_language_version: + python: python3.10 +exclude: ^(src/octoprint/vendor/|src/octoprint/static/js/lib|src/octoprint/static/vendor|src/octoprint_setuptools|tests/static/js/lib|tests/util/_files|scripts/|translations/|.*\.css|.*\.svg) repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.4.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace @@ -14,7 +16,7 @@ repos: args: ["--remove"] exclude: "setup.py|versioneer.py|src/octoprint_setuptools/__init__.py" - repo: https://github.com/asottile/pyupgrade - rev: v2.31.0 + rev: v3.3.1 hooks: - id: pyupgrade args: ["--py37-plus"] @@ -43,30 +45,29 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black - rev: 22.1.0 + rev: 23.1.0 hooks: - id: black - args: ["--config", "black.toml"] - additional_dependencies: - - click==8.0.4 - repo: https://github.com/pycqa/flake8 - rev: 3.9.2 + rev: 6.0.0 hooks: - id: flake8 + args: [--config=setup.cfg] additional_dependencies: - - flake8-bugbear==22.1.11 - - importlib-metadata<5.0 + - flake8-bugbear==23.2.13 + exclude: ^(docs/) - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.5.1 + rev: v2.7.1 hooks: - id: prettier - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.8.0 + rev: v8.35.0 hooks: - id: eslint - additional_dependencies: - - eslint@7.19.0 - - eslint-plugin-es5@v1.3.0 - - eslint-plugin-cypress@2.11.2 files: \.js$ exclude: ^(src/octoprint/vendor/|tests/static/js/lib|tests/util/_files|docs/|scripts/|translations/) + - repo: https://github.com/codespell-project/codespell + rev: v2.2.2 + hooks: + - id: codespell + exclude: ^(src/octoprint/vendor/|tests/static/js/lib|tests/util/_files|tests/playwright|scripts/) diff --git a/.versioneer-lookup b/.versioneer-lookup index 1beb1e2eb..fc69115ad 100644 --- a/.versioneer-lookup +++ b/.versioneer-lookup @@ -18,21 +18,21 @@ prerelease HEAD \(detached.* -# maintenance is currently the branch for preparation of maintenance release 1.8.0 +# maintenance is currently the branch for preparation of maintenance release 1.9.0 # so are any fix/... and improve/... branches -maintenance 1.8.0 3fe45661cd79c5137d9d4f5f4adb4d9519bc2084 pep440-dev -fix/.* 1.8.0 3fe45661cd79c5137d9d4f5f4adb4d9519bc2084 pep440-dev -improve/.* 1.8.0 3fe45661cd79c5137d9d4f5f4adb4d9519bc2084 pep440-dev +maintenance 1.9.0 fa2c4680cca0d1d6b46e6c1ed68ceea4d9b79afb pep440-dev +fix/.* 1.9.0 fa2c4680cca0d1d6b46e6c1ed68ceea4d9b79afb pep440-dev +improve/.* 1.9.0 fa2c4680cca0d1d6b46e6c1ed68ceea4d9b79afb pep440-dev # staging/bugfix is the branch for preparation of the 1.8.7 bugfix release # so are any bug/... branches -staging/bugfix 1.8.7 1875623f05e14c3a197c6ff324f02dce55cec7d2 pep440-dev -bug/.* 1.8.7 1875623f05e14c3a197c6ff324f02dce55cec7d2 pep440-dev +staging/bugfix 1.8.8 8e4c1f5246c4245b839ccdcdabf2beee671b08d7 pep440-dev +bug/.* 1.8.8 8e4c1f5246c4245b839ccdcdabf2beee671b08d7 pep440-dev -# staging/maintenance is currently the branch for preparation of 1.8.0rc6 +# staging/maintenance is currently the branch for preparation of 1.9.0rc6 # so is regressionfix/... -staging/maintenance 1.8.0rc6 45598764e6c7f6257de87a98d15964209ddc9e09 pep440-dev -regressionfix/.* 1.8.0rc6 45598764e6c7f6257de87a98d15964209ddc9e09 pep440-dev +staging/maintenance 1.9.0rc6 2596a99a2497e53e3f73399941bda7822bb1ef6f pep440-dev +regressionfix/.* 1.9.0rc6 2596a99a2497e53e3f73399941bda7822bb1ef6f pep440-dev # staging/devel is currently inactive (but has the 1.4.1rc4 namespace) staging/devel 1.4.1rc4 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev diff --git a/AUTHORS.md b/AUTHORS.md index 487a3838e..1eff52cdc 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -165,6 +165,17 @@ date of first contribution): * [Johan Verrept](https://github.com/JoveToo) * [Nicu Surdu](https://github.com/surdu) * [Zack Lewis](https://github.com/lima3w) + * [Billy Richardson](https://github.com/richardsondev) + * [Christian Bianchini](https://github.com/max246) + * [Kestin Goforth](https://github.com/kforth) + * [Dawid Pieper](https://github.com/dawidpieper) + * ["arrdem"](https://github.com/arrdem) + * [Arkadiusz MiΕ›kiewicz](https://github.com/arekm) + * ["tempodat"](https://github.com/tempodat) + * [Frederik Kemner](https://github.com/040medien) + * [Moiz Rasheed](https://github.com/msrasheed) + * [Scott Martin](https://github.com/smartin015) + * [Shyam Sunder](https://github.com/sgsunder) OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by [Daid Braam](https://github.com/daid). Parts of its communication layer and diff --git a/SUPPORTERS.md b/SUPPORTERS.md index e2a70859c..78f122c09 100644 --- a/SUPPORTERS.md +++ b/SUPPORTERS.md @@ -9,7 +9,6 @@ thanks to everyone who contributed! * 3D-TECH * 3DPrinterOS * Al Mucci - * Arnljot Arntsen * Ash King * Ben Fritsch * BigTreeTech @@ -19,20 +18,18 @@ thanks to everyone who contributed! * Christian Wolf * Christian WΓΌrthner * Christoph Sigrist - * CooperSpartan * Creality3D * DeltaMaker 3D Printers * Dennis Breining + * Dima Gorbenko * Douglas Floyd * Ed Crump * Ernesto Martinez * Franziska Kunsmann * Hog Duske * Jacob Renstrom - * James Mackay * Jeff Green * Jeff Moe - * jeffiel * Jeremy Cole * John Cassel * Julian Melo @@ -44,11 +41,13 @@ thanks to everyone who contributed! * Lachlan Bell * Lefteris Lertas * LulzBot + * Makerbase * Makespace Madrid * Mark Greenwald * Mark Walker * Michael Aumock - * Mike Kershaw + * Michael Badagliacco + * Mike Labanov * Mosaic Manufacturing * Norman Jaffe * Obico @@ -59,15 +58,13 @@ thanks to everyone who contributed! * Randy C. Will * Ranjib Dey * Richard McGuire - * Richard Michaud * Richard Stocks * Robert Gusek - * Sean Jensen-Grey - * Sebastien Andrivet * SimplyPrint + * Songyin Zheng * Stefan Krister * Steve Dougherty * Steve Thompson * Ulrich Kempken -and 2036 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [GitHub Sponsors](https://github.com/users/foosel/sponsorship)! +and 2008 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [GitHub Sponsors](https://github.com/users/foosel/sponsorship)! diff --git a/THIRDPARTYLICENSES.md b/THIRDPARTYLICENSES.md index 3c04c8eff..0222b3f5c 100644 --- a/THIRDPARTYLICENSES.md +++ b/THIRDPARTYLICENSES.md @@ -28,6 +28,7 @@ * [md5.js](https://blueimp.github.io/JavaScript-MD5/): MIT * [Modernizr](http://modernizr.com): MIT * [Moment.js](http://momentjs.com/): MIT + * [Pako](https://github.com/nodeca/pako): MIT * [PNotify](http://sciactive.com/pnotify/): GPL, LGPL, MPL (triple licensed) * [pusher.color.js](http://cache.preserve.io/5g18q0pw/index.html) (original link dead): MIT * [SockJS](https://github.com/sockjs/sockjs-client): MIT @@ -43,7 +44,7 @@ * [emoji](https://github.com/carpedm20/emoji/): BSD * [feedparser](https://github.com/kurtmckee/feedparser): BSD * [filetype](https://h2non.github.io/filetype.py/): MIT - * [Flask](http://flask.pocoo.org/): BSD + * [Flask](https://flask.palletsprojects.com/): BSD * [Flask-Assets](http://github.com/miracle2k/flask-assets): BSD * [Flask-Babel](http://github.com/mitsuhiko/flask-babel): BSD * [Flask-Login](https://github.com/maxcountryman/flask-login): MIT diff --git a/docs/_static/theme_overrides.css b/docs/_static/theme_overrides.css index cce327b20..12de9d439 100644 --- a/docs/_static/theme_overrides.css +++ b/docs/_static/theme_overrides.css @@ -1,14 +1,3 @@ -/* override table width restrictions */ -.wy-table-responsive table td, .wy-table-responsive table th { - /* !important prevents the common CSS stylesheets from - overriding this as on RTD they are loaded after this stylesheet */ - white-space: normal !important; -} - -.wy-table-responsive { - overflow: visible !important; -} - /* style headlink for code block captions like other headlinks */ .code-block-caption .headerlink { display: none; @@ -42,19 +31,3 @@ line-height: 1.5; } -/* make code tags non-red again */ -code, -.rst-content tt { - color: #000 !important; -} - -a code, -.rst-content a tt { - color: #2980B9 !important; -} - -a:visited code, -.rst-content a:visited tt { - color: #9B59B6 !important; -} - diff --git a/docs/api/datamodel.rst b/docs/api/datamodel.rst index 595c91d0d..0b5033def 100644 --- a/docs/api/datamodel.rst +++ b/docs/api/datamodel.rst @@ -485,6 +485,50 @@ GCODE analysis information - 0..1 - Float - The minimum Z coordinate of the printed model, in mm + * - ``travelArea`` + - 0..1 + - Object + - Information regarding the bounding box of all moves + * - ``travelArea.maxX`` + - 0..1 + - Float + - The maximum X coordinate of all moves, in mm + * - ``travelArea.maxY`` + - 0..1 + - Float + - The maximum Y coordinate of all moves, in mm + * - ``travelArea.maxZ`` + - 0..1 + - Float + - The maximum Z coordinate of all moves, in mm + * - ``travelArea.minX`` + - 0..1 + - Float + - The minimum X coordinate of all moves, in mm + * - ``travelArea.minY`` + - 0..1 + - Float + - The minimum Y coordinate of all moves, in mm + * - ``travelArea.minZ`` + - 0..1 + - Float + - The minimum Z coordinate of all moves, in mm + * - ``travelDimensions`` + - 0..1 + - Object + - Information regarding the size of the travel area + * - ``travelDimensions.depth`` + - 0..1 + - Float + - The depth of the travel area, in mm + * - ``travelDimensions.height`` + - 0..1 + - Float + - The height of the travel area, in mm + * - ``travelDimensions.width`` + - 0..1 + - Float + - The width of the travel area, in mm .. _sec-api-datamodel-files-ref: diff --git a/docs/api/files.rst b/docs/api/files.rst index 1cf439741..81367e82a 100644 --- a/docs/api/files.rst +++ b/docs/api/files.rst @@ -908,4 +908,3 @@ Upload response - (File only) Whether the file that was just uploaded was started to print (``true``) or not (``false``). If this is ``false`` but was requested to be ``true`` in the upload request, the user lacked permissions, the printer was not operational or already printing and thus the request could not be fulfilled. - diff --git a/docs/api/printerprofiles.rst b/docs/api/printerprofiles.rst index 395020562..d856b4523 100644 --- a/docs/api/printerprofiles.rst +++ b/docs/api/printerprofiles.rst @@ -627,9 +627,11 @@ Profile - ``float`` - The diameter of the printer's nozzle(s) in mm. * - ``extruder.sharedNozzle`` + - 0..1 - ``boolean`` - Whether there's only one nozzle shared among all extruders (true) or one nozzle per extruder (false). * - ``extruder.defaultExtrusionLength`` + - 0..1 - ``int`` - Default extrusion length used in Control tab on initial page load in mm. * - ``extruder.count`` @@ -642,4 +644,3 @@ Profile - Tuple of (x, y) values describing the offsets of the other extruders relative to the first extruder. E.g. for a printer with two extruders, if the second extruder is offset by 20mm in the X and 25mm in the Y direction, this array will read ``[ [0.0, 0.0], [20.0, 25.0] ]`` - diff --git a/docs/api/timelapse.rst b/docs/api/timelapse.rst index e739b43ee..c7f5a3767 100644 --- a/docs/api/timelapse.rst +++ b/docs/api/timelapse.rst @@ -30,7 +30,7 @@ Delete a timelapse .. http:delete:: /api/timelapse/(string:name) Delete the timelapse ``name``. - + Returns a :ref:`timelapse list ` in the response body with the updated information. @@ -48,7 +48,7 @@ Issue a command for an unrendered timelapse Current only supports to render the unrendered timelapse ``name`` via the ``render`` command. - Requires the ``TIMELAPSE_ADMIN`` permission. + Requires the ``TIMELAPSE_MANAGE_UNRENDERED`` permission. :json command: The command to issue, currently only ``render`` is supported @@ -64,7 +64,7 @@ Delete an unrendered timelapse Returns a :ref:`timelapse list ` in the response body. - Requires the ``TIMELAPSE_DELETE`` permission. + Requires the ``TIMELAPSE_MANAGE_UNRENDERED`` permission. :param unrendered: If provided and true, also include unrendered timelapses in the response @@ -283,4 +283,3 @@ For timelapse type ``timed``. - 1 - int - Seconds between individual shots - diff --git a/docs/api/users.rst b/docs/api/users.rst deleted file mode 100644 index 495829a1f..000000000 --- a/docs/api/users.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. _sec-api-user: - -**** -User -**** - -.. note:: - - This API endpoint has been moved and is now part of :ref:`Access Control `. diff --git a/docs/api/util.rst b/docs/api/util.rst index bb1271240..e3ea44b29 100644 --- a/docs/api/util.rst +++ b/docs/api/util.rst @@ -76,7 +76,7 @@ Various tests * ``content_type_whitelist``: Optional array of supported content types. If set and the URL returns a content type not included in this list, the test will fail. E.g. ``["image/*", "text/plain"]``. * ``content_type_blacklist``: Optional array of unsupported content types. If set and the URL returns a content - type included in this list, the test wil fail. E.g. ``["video/*"]``. Can be used together with ``content_type_whitelist`` + type included in this list, the test will fail. E.g. ``["video/*"]``. Can be used together with ``content_type_whitelist`` to further limit broader content type definition, e.g. by putting ``image/*`` into the whitelist, but disallowing PNG by including ``image/png`` on the blacklist. diff --git a/docs/bundledplugins/backup.rst b/docs/bundledplugins/backup.rst index 6dd70358c..08904875a 100644 --- a/docs/bundledplugins/backup.rst +++ b/docs/bundledplugins/backup.rst @@ -7,7 +7,8 @@ Backup Plugin The OctoPrint Backup Plugin comes bundled with OctoPrint (starting with 1.3.10). -It allows the creation and restoration [#1]_ of backups of OctoPrint's settings, data and installed plugins [#2]_. +It allows the creation and restoration [#1]_ of backups of OctoPrint's settings, data and installed plugins [#2]_ +(but doesn't restore the same plugins versions [#3]_). This allows easy migration to newly setup instances as well as making regular backups to prevent data loss. @@ -171,11 +172,61 @@ octoprint.plugin.backup.additional_excludes :return: A list of paths to exclude, relative to your plugin's data folder :rtype: list -Helpers -------- +.. _sec-bundledplugins-backup-hooks-before-backup: + +octoprint.plugin.backup.before_backup ++++++++++++++++++++++++++++++++++++++ + +.. py:function:: before_backup_hook(*args, **kwargs) + + .. versionadded:: 1.9.0 + + Use this to perform actions right before a backup is created. + +.. _sec-bundledplugins-backup-hooks-after-backup: + +octoprint.plugin.backup.after_backup +++++++++++++++++++++++++++++++++++++ + +.. py:function:: after_backup_hook(error=False, *args, **kwargs) + + .. versionadded:: 1.9.0 + + Use this to perform actions right after a backup was created or backup creation failed. The ``error`` parameter will be set to ``True`` if + the backup creation failed. + + :param error bool: Whether the backup creation failed or not + +.. _sec-bundledplugins-backup-hooks-before-restore: + +octoprint.plugin.backup.before_restore +++++++++++++++++++++++++++++++++++++++ + +.. py:function:: before_restore_hook(*args, **kwargs) + + .. versionadded:: 1.9.0 + + Use this to perform actions right before a backup is restored. + +.. _sec-bundledplugins-backup-hooks-after-restore: + +octoprint.plugin.backup.after_restore ++++++++++++++++++++++++++++++++++++++ + +.. py:function:: after_restore_hook(error=False, *args, **kwargs) + + .. versionadded:: 1.9.0 + + Use this to perform actions right after a backup was restored or backup restoration failed. The ``error`` parameter will be set to ``True`` if + the backup restoration failed. + + :param error bool: Whether the backup restoration failed or not .. _sec-bundledplugins-backup-helpers: +Helpers +------- + The Backup plugin exports two helpers that can be used by other plugins or internal methods from within OctoPrint, without going via the API. @@ -208,3 +259,5 @@ its source repository under ``src/octoprint/plugins/backup``. .. [#2] Note that only those plugins that are available on `OctoPrint's official plugin repository `_ can be automatically restored. If you have plugins installed that are not available on there you'll get their names and - if available - homepage URL displayed after restore in order to be able to manually reinstall them. +.. [#3] Note that the restore process will install the latest possible versions of the plugins instead of the version that was installed at backup + creation time. diff --git a/docs/bundledplugins/loginui.rst b/docs/bundledplugins/loginui.rst deleted file mode 100644 index 4697cd7d3..000000000 --- a/docs/bundledplugins/loginui.rst +++ /dev/null @@ -1,6 +0,0 @@ -.. _sec-bundledplugins-loginui: - -Login UI -======== - -The Login UI plugin's functionality has been merged into OctoPrint's core as of OctoPrint 1.4.2. diff --git a/docs/bundledplugins/pluginmanager.rst b/docs/bundledplugins/pluginmanager.rst index 82eb6f393..02f4a7218 100644 --- a/docs/bundledplugins/pluginmanager.rst +++ b/docs/bundledplugins/pluginmanager.rst @@ -10,7 +10,26 @@ The OctoPrint Plugin Manager comes bundled with OctoPrint. It allows management of installed plugins (listing, enabling, disabling and uninstalling) and installing new plugins from the official `OctoPrint Plugin Repository `_, web addresses -or uploaded file archives. +or uploaded files. + +Installing from URL or file uploads currently supports the following file +formats: + + * ``.zip``, ``.tar.gz``, ``.tgz``, ``.tar``, ``.gz``, ``.whl``: Will be considered to be + plugin archive and installed via ``pip``. + * ``.py``: Will be considered to be a single file plugin and installed by copying it + into ``~/.octoprint/plugins``. + * ``.json``: Will be considered to be either a plugin manager export file (created by the Export button) or a manually created + list of URLs to install from, e.g. + + .. code-block:: json + + [ + "https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/archive/master.zip", + "https://github.com/eyal0/OctoPrint-PrintTimeGenius/archive/master.zip" + ] + + The plugin manager will feed all contained URLs to the same logic as above. .. _fig-bundledplugins-pluginmanager-mainscreen: .. figure:: ../images/bundledplugins-pluginmanager-mainscreen.png diff --git a/docs/conf.py b/docs/conf.py index 8accb00f3..9c1603677 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import absolute_import, division, print_function, unicode_literals - # # OctoPrint documentation build configuration file, created by # sphinx-quickstart on Mon Dec 02 17:08:50 2013. @@ -13,7 +10,8 @@ from __future__ import absolute_import, division, print_function, unicode_litera # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os +import os +import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -21,9 +19,10 @@ import sys, os sys.path.insert(0, os.path.abspath("../src/")) sys.path.append(os.path.abspath("sphinxext")) -import octoprint._version from datetime import date +import octoprint._version + year_since = 2013 year_current = date.today().year @@ -43,6 +42,7 @@ extensions = [ "sphinx.ext.napoleon", "sphinxcontrib.mermaid", "sphinx.ext.intersphinx", + "sphinx_rtd_theme", ] todo_include_todos = True intersphinx_mapping = { @@ -108,7 +108,7 @@ exclude_patterns = ["_build"] # show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" +pygments_style = "stata-dark" # A list of ignored prefixes for module index sorting. # modindex_common_prefix = [] @@ -122,19 +122,14 @@ mermaid_version = "" # -- Options for HTML output --------------------------------------------------- -import sphinx_rtd_theme - -html_theme = "sphinx_rtd_theme" -html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] - # The theme to use for HTML and HTML Help pages. See the documentation for # a list of built-in themes. -# html_theme = "sphinx_rtd_theme" +html_theme = "sphinx_rtd_theme" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -# html_theme_options = {} +html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] diff --git a/docs/configuration/config_yaml.rst b/docs/configuration/config_yaml.rst index baa7e5519..71bf107cc 100644 --- a/docs/configuration/config_yaml.rst +++ b/docs/configuration/config_yaml.rst @@ -764,6 +764,10 @@ Use the following settings to configure the serial connection to the printer: # during connect. waitForStartOnConnect: false + # Specifies whether OctoPrint should wait to load the SD card file list until the first firmware capability + # report is processed. + waitToLoadSdFileList: false + # Specifies whether OctoPrint should send linenumber + checksum with every printer command. Needed for # successful communication with Repetier firmware alwaysSendChecksum: false diff --git a/docs/configuration/yaml.rst b/docs/configuration/yaml.rst index b7b4e56af..e472dda45 100644 --- a/docs/configuration/yaml.rst +++ b/docs/configuration/yaml.rst @@ -221,4 +221,4 @@ clearer (whitespace again made visible to help track indentation): Just make sure you follow a consistent way of indenting your files -- YAML is not as strict as Python when it comes to differing indentation variants within the same file (as long as it's still valid), but consistency will help you as a lot as a human. Ideally you'll use a text editor which highlights white space characters for you (most editors can -be configured this way), this will help tremendously when editing whitespace sensitive syntax such as YAML. \ No newline at end of file +be configured this way), this will help tremendously when editing whitespace sensitive syntax such as YAML. diff --git a/docs/development/environment.rst b/docs/development/environment.rst index 1176f4df3..c901db5dd 100644 --- a/docs/development/environment.rst +++ b/docs/development/environment.rst @@ -57,9 +57,12 @@ When the virtual environment is activated you can then: * run the test suite from the checked out source folder via ``pytest`` * trigger the pre-commit check suite manually from the checked out source folder via ``pre-commit run --hook-stage manual --all-files`` + * rebuild ``.css`` files from ``.less`` sources. See ``octoprint dev css:build --help`` * build the documentation running ``sphinx-build -b html . _build`` in the ``docs`` folder -- the documentation will be available in the newly created ``_build`` directory. You can simply browse it locally by opening ``index.html`` + * check whether there are newer versions of OctoPrint's dependencies available via + ``python setup.py scan_deps`` .. _sec-development-environment-source-linux: @@ -329,10 +332,6 @@ Visual Studio Code (vscode) { "python.defaultInterpreterPath": "venv/bin/python", "python.formatting.provider": "black", - "python.formatting.blackArgs": [ - "--config", - "black.toml" - ], "editor.formatOnSave": true, "python.sortImports.args": [ "--profile=black", @@ -409,5 +408,3 @@ Visual Studio Code (vscode) * Saving a file will run an auto formatter and import sort * ``Ctrl+Shift+B`` can be used to run the ``build docs`` task to rebuild the documentation - - diff --git a/docs/development/virtual_printer.rst b/docs/development/virtual_printer.rst index f0d96138f..d7222b14c 100644 --- a/docs/development/virtual_printer.rst +++ b/docs/development/virtual_printer.rst @@ -118,6 +118,12 @@ There many configuration options via ``config.yaml`` for the virtual printer tha # False: size: true + # Whether M20 responses will include timestamp or not (only if size = true as well) + # + # True: + # False: + timestamp: false + # Whether M20 responses will include longname or not (only if size = true as well) # # True: @@ -200,29 +206,29 @@ There many configuration options via ``config.yaml`` for the virtual printer tha # Simulated ambient temperature in Β°C ambientTemperature: 21.3 - + # Response to M105 when there is a target # Placeholders: # - heater: The heater id (eg. T0, T1, B) # - actual: The actual temperature of the heater # - target: The target temperature of heater m105TargetFormatString: {heater}:{actual:.2f}/ {target:.2f} - + # Response to M105 when there is no target # Placeholders: # - heater: The heater id (eg. T0, T1, B) # - actual: The actual temperature of the heater m105NoTargetFormatString: {heater}:{actual:.2f} - + # Enable virtual EEPROM # If enabled, a file `eeprom.json` will be created in the plugin data folder # to enable settings persistence across connections. Enables M500/1/2/4 commands # And a selection of other settings commands. Responses modeled on Marlin 2.0 enable_eeprom: true - + # Support M503 support_m503: true - + # Resend ratio to simulate noise on the line resend_ratio: 0 diff --git a/docs/events/index.rst b/docs/events/index.rst index c468a1fad..8a882596f 100644 --- a/docs/events/index.rst +++ b/docs/events/index.rst @@ -605,6 +605,21 @@ GcodeScript${ScriptName}Finished .. versionadded:: 1.6.0 +ChartMarked + A time-based marking has been made on the UI's temperature chart. + + Payload: + + * ``type``: The marking's ID. Built-in types are ``print``, ``done``, ``cancel``, ``pause``, and ``resume``. + Plugins may set arbitrary types, which should be prefixed, e.g. ``pluginname_eventtype``. In the UI, the type + ID is used to stylize the marking label. + * ``label``: The human-readable short label of the marking, ideally one short word. Optional but recommended; if + not specified, the UI will display the ``type``. The label may be localized in the UI. + * ``time``: The epoch time of marking. Defaults to the event fire time if not specified. Plugins may set a time + in the past if it makes sense for the event. + + .. versionadded:: 1.9.0 + .. _sec-events-available_events-gcode_processing: GCODE processing @@ -870,4 +885,3 @@ PrinterProfileModified * ``identifier``: the identifier of the modified printer profile .. versionadded:: 1.3.12 - diff --git a/docs/features/accesscontrol.rst b/docs/features/accesscontrol.rst index f9118f8b3..872681077 100644 --- a/docs/features/accesscontrol.rst +++ b/docs/features/accesscontrol.rst @@ -110,7 +110,7 @@ The subnet to use is usually the IP address range of your LAN, which sounds scar actually isn't. Just `figure out your PC's IP address and subnet mask `_ and then combine both with a / in between. -On OctoPi (or another Linux distribution) you can use the follwing command: +On OctoPi (or another Linux distribution) you can use the following command: .. code-block:: @@ -202,7 +202,7 @@ further down there's also a dedicated list of steps for OctoPi specifically. 4. Restart OctoPrint, check that everything works. -This will automatically log you in as the user you specified whenver you connect to +This will automatically log you in as the user you specified whenever you connect to OctoPrint from an address in the address range (e.g. a device on your local network). OctoPi specific steps diff --git a/docs/features/custom_controls.rst b/docs/features/custom_controls.rst index 522d392cb..a499b74c4 100644 --- a/docs/features/custom_controls.rst +++ b/docs/features/custom_controls.rst @@ -44,7 +44,7 @@ a GCODE script including user input. - name: Example for multiple commands children: - name: Move X (static) - confirm: You are about to move the X axis right by 10mm with 3000mm/s. + confirm: You are about to move the X axis right by 10mm with 3000mm/min. commands: - G91 - G1 X10 F3000 diff --git a/docs/features/gcode_scripts.rst b/docs/features/gcode_scripts.rst index aa8fb1329..bccce9e66 100644 --- a/docs/features/gcode_scripts.rst +++ b/docs/features/gcode_scripts.rst @@ -84,6 +84,8 @@ All GCODE scripts have access to the following template variables through the te to the corresponding temperature in degrees Celsius. Note that not all tools your printer has must necessarily be present here, neither must the heated bed - it depends on whether OctoPrint has values for a tool or the bed. Also note that ``actual`` and ``target`` might be ``None``. + * ``last_fanspeed``: Last fan speed set. It contains the value taken from command (M106 and M107) sent through OctoPrint. + The value might be ``None`` if no fan speed has been set. * ``script``: An object wrapping the script's type (``gcode``) and name (e.g. ``afterPrintCancelled``) as ``script.type`` and ``script.name`` respectively. * ``plugins``: An object containing variables provided by plugins (e.g ``plugins.myplugin.myvariable``) @@ -99,6 +101,7 @@ There are a few additional template variables available for the following specif "Log position on pause" under Settings > Serial > Advanced options! * ``pause_temperature``: Last known temperature values when the print was paused. See ``last_temperature`` above for the structure to expect here. + * ``pause_fanspeed``: Last known fan speed value when the print was paused. See ``last_fanspeed`` above for the structure to expect here. * ``afterPrintCancelled`` @@ -109,6 +112,7 @@ There are a few additional template variables available for the following specif "Log position on cancel" under Settings > Serial > Advanced options! * ``cancel_temperature``: Last known temperature values when the print was cancelled. See ``last_temperature`` above for the structure to expect here. + * ``cancel_fanspeed``: Last known fan speed value when the print was cancelled. See ``last_fanspeed`` above for the structure to expect here. * ``beforeToolChange`` and ``afterToolChange`` diff --git a/docs/images/bundledplugins-pluginmanager-installing.png b/docs/images/bundledplugins-pluginmanager-installing.png index d97eaf39c..a27398a00 100644 Binary files a/docs/images/bundledplugins-pluginmanager-installing.png and b/docs/images/bundledplugins-pluginmanager-installing.png differ diff --git a/docs/images/bundledplugins-pluginmanager-mainscreen.png b/docs/images/bundledplugins-pluginmanager-mainscreen.png index fa432c7bc..f2b7c35f0 100644 Binary files a/docs/images/bundledplugins-pluginmanager-mainscreen.png and b/docs/images/bundledplugins-pluginmanager-mainscreen.png differ diff --git a/docs/images/bundledplugins-pluginmanager-repofilters.png b/docs/images/bundledplugins-pluginmanager-repofilters.png index ab62e4a3c..1138afbe7 100644 Binary files a/docs/images/bundledplugins-pluginmanager-repofilters.png and b/docs/images/bundledplugins-pluginmanager-repofilters.png differ diff --git a/docs/images/template-plugin-types-main.png b/docs/images/template-plugin-types-main.png index 3b4267faf..2c98a3bce 100644 Binary files a/docs/images/template-plugin-types-main.png and b/docs/images/template-plugin-types-main.png differ diff --git a/docs/images/template-plugin-types-settings.png b/docs/images/template-plugin-types-settings.png index 2ad2b5dd2..7b377c1cf 100644 Binary files a/docs/images/template-plugin-types-settings.png and b/docs/images/template-plugin-types-settings.png differ diff --git a/docs/images/template_plugin_types.ep b/docs/images/template_plugin_types.ep index d036b24cc..f56ea6fd3 100644 --- a/docs/images/template_plugin_types.ep +++ b/docs/images/template_plugin_types.ep @@ -306,4 +306,4 @@