Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ab84ed7e4 | ||
|
|
3f7bc1ebb5 | ||
|
|
57b8d0b88e | ||
|
|
458ab91f91 | ||
|
|
ab8ad72bc3 | ||
|
|
e9b6d22932 | ||
|
|
57b085ff5c | ||
|
|
0cfc08748b | ||
|
|
0188745d05 | ||
|
|
5246e2ccb4 | ||
|
|
f1d4cb670a | ||
|
|
9dd1e95eae | ||
|
|
6083943e03 | ||
|
|
a8ba43308e | ||
|
|
4511d8667b | ||
|
|
af3a63fd9b | ||
|
|
93e54f57e0 | ||
|
|
e33b3b5883 | ||
|
|
b150989286 |
No files matched your search
@@ -1,6 +1,10 @@
|
||||
name: Test install of branches and latest release twice per day
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 */12 * * *'
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
name: Trigger docker build
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- released
|
||||
- prereleased
|
||||
|
||||
jobs:
|
||||
trigger:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🚀 Repository Dispatch
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
token: ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
||||
repository: OctoPrint/docker
|
||||
event-type: octoprint-release
|
||||
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "event-name": "${{ github.event_name }}", "event-type": "${{ github.event.action }}"}'
|
||||
+5
-5
@@ -24,13 +24,13 @@ maintenance 1.4.1 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
|
||||
fix/.* 1.4.1 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
|
||||
improve/.* 1.4.1 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
|
||||
|
||||
# staging/maintenance is currently the branch for preparation of 1.4.1rc3
|
||||
# staging/maintenance is currently the branch for preparation of 1.4.1rc5
|
||||
# so is regressionfix/...
|
||||
staging/maintenance 1.4.1rc3 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev
|
||||
regressionfix/.* 1.4.1rc3 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev
|
||||
staging/maintenance 1.4.1rc5 458ab91f915307857941f839a1b743430b8786a4 pep440-dev
|
||||
regressionfix/.* 1.4.1rc5 458ab91f915307857941f839a1b743430b8786a4 pep440-dev
|
||||
|
||||
# staging/devel is currently inactive (but has the 1.4.1rc3 namespace)
|
||||
staging/devel 1.4.1rc3 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev
|
||||
# staging/devel is currently inactive (but has the 1.4.1rc4 namespace)
|
||||
staging/devel 1.4.1rc4 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev
|
||||
|
||||
# every other branch is a development branch and thus gets resolved to 1.5.0-dev for now
|
||||
.* 1.5.0 2da7aa358d950b4567aaab8f18d6b5779193e077 pep440-dev
|
||||
+2
-2
@@ -12,12 +12,12 @@ thanks to everyone who contributed!
|
||||
* BigTreeTech
|
||||
* Boris Hussein
|
||||
* Brad Jackson
|
||||
* BuildBee
|
||||
* Christian Petropolis
|
||||
* Christian Wolf
|
||||
* D Brian Kimmel
|
||||
* DeltaMaker 3D Printers
|
||||
* Dennis Breining
|
||||
* Dorian Gray
|
||||
* Eric Betts
|
||||
* Ernesto Martinez
|
||||
* Franziska Kunsmann
|
||||
@@ -66,4 +66,4 @@ thanks to everyone who contributed!
|
||||
* Sven Mueller
|
||||
* Ulrich Kempken
|
||||
|
||||
and 1886 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [Github Sponsors](https://github.com/users/foosel/sponsorship)!
|
||||
and 1932 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [Github Sponsors](https://github.com/users/foosel/sponsorship)!
|
||||
@@ -22,9 +22,9 @@ below.
|
||||
* ``git clone https://github.com/OctoPrint/OctoPrint.git``
|
||||
|
||||
* Enter the checked out source folder: ``cd OctoPrint``
|
||||
* Create virtual environments in the checked out source folder for both Python 2.7 and Python 3.7 to use for
|
||||
installing and running OctoPrint and its dependencies (this avoids potential versioning issues for the dependencies
|
||||
with system wide installed instances):
|
||||
* Create virtual environments in the checked out source folder for both Python 2 and Python 3 to use for
|
||||
installing and running OctoPrint and its dependencies. Creating virtual environments avoids potential versioning
|
||||
issues for the dependencies with system wide installed instances:
|
||||
|
||||
* PY2: ``virtualenv --python=python2 venv2``
|
||||
* PY3: ``virtualenv --python=python3 venv3``
|
||||
@@ -52,46 +52,42 @@ below.
|
||||
When the virtual environment is activated you can then:
|
||||
|
||||
* run the OctoPrint server via ``octoprint serve``
|
||||
* run the test suite from the checked out source folder via ``nosetests --with-doctest``
|
||||
* build the documentation from the ``docs`` sub folder of the checked out sources via ``sphinx-build -b html . _build``
|
||||
* run the test suite from the checked out source folder via ``pytest``
|
||||
|
||||
To switch the activated virtual environment, simply activate the new environment as described above.
|
||||
|
||||
To deactivate the virtual environment and return to the system's default Python: ``deactivate``.
|
||||
|
||||
If you also want to be able to build the documentation that resides in the ``docs`` subfolder, you need to activate
|
||||
the *Python 3* environment and install the docs dependencies as well:
|
||||
|
||||
* ``source venv3/bin/activate`` (Linux, macOS) or ``source venv3/Scripts/activate`` (Git Bash under Windows, see below)
|
||||
* ``pip install -e .[develop,plugins,docs]``
|
||||
|
||||
You can then build the documentation:
|
||||
|
||||
* ``sphinx-build -b html . _build``
|
||||
|
||||
.. _sec-development-environment-source-linux:
|
||||
|
||||
Linux
|
||||
.....
|
||||
|
||||
.. todo::
|
||||
|
||||
This guide is not yet adapted to the concurrent use of Python 2.7 and 3.7 environments during development.
|
||||
|
||||
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
|
||||
location, please substitute accordingly.
|
||||
|
||||
First make sure you have python including its header files, pip, setuptools, virtualenv, git and some build requirements
|
||||
First make sure you have python 2 and 3 including their header files, pip, setuptools, virtualenv, git and some build requirements
|
||||
installed:
|
||||
|
||||
* On apt based distributions (e.g. Debian, Ubuntu, ...):
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo apt-get install python python-pip python-dev python-setuptools python-virtualenv git libyaml-dev build-essential
|
||||
|
||||
* On zypper based distributions (example below for SLES 12 SP2):
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo zypper ar https://download.opensuse.org/repositories/devel:/languages:/python/SLE_12_SP2/ python_devel
|
||||
sudo zypper ref
|
||||
sudo zypper in python python-pip python-devel python-setuptools python-virtualenv git libyaml-devel
|
||||
sudo zypper in -t pattern Basis-Devel
|
||||
sudo apt-get install python python-pip python-dev python-setuptools python-virtualenv python3 python3-virtualenv python3-dev git libyaml-dev build-essential
|
||||
|
||||
.. todo::
|
||||
|
||||
Using a Linux distribution that doesn't use ``apt`` or ``zypper``? Please send a
|
||||
Using a Linux distribution that doesn't use ``apt``? Please send a
|
||||
`Pull Request <https://github.com/OctoPrint/OctoPrint/blob/master/CONTRIBUTING.md#pull-requests>`_ to get the necessary
|
||||
steps into this guide!
|
||||
|
||||
@@ -100,36 +96,42 @@ Then:
|
||||
.. code-block:: none
|
||||
|
||||
cd ~/devel
|
||||
git clone -b devel https://github.com/OctoPrint/OctoPrint.git
|
||||
git clone https://github.com/OctoPrint/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv venv
|
||||
source ./venv/bin/activate
|
||||
virtualenv --python=python2 venv2
|
||||
virtualenv --python=python3 venv3
|
||||
source ./venv2/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop,plugins]
|
||||
source ./venv3/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop,plugins,docs]
|
||||
|
||||
You can then start OctoPrint via ``~/devel/OctoPrint/venv/bin/octoprint`` or just ``octoprint`` if you activated the virtual
|
||||
environment.
|
||||
You can then start OctoPrint via ``octoprint`` after activating one of the two virtual environments.
|
||||
|
||||
.. _sec-development-environment-windows:
|
||||
|
||||
Windows
|
||||
.......
|
||||
|
||||
.. todo::
|
||||
|
||||
This guide is not yet adapted to the concurrent use of Python 2.7 and 3.7 environments during development.
|
||||
|
||||
This assumes you'll host your OctoPrint development checkout at ``C:\Devel\OctoPrint``. If you want to use a different
|
||||
location, please substitute accordingly.
|
||||
|
||||
First download & install:
|
||||
|
||||
* `Python 2.7.15 Windows x86 MSI installer <https://www.python.org/downloads/release/python-2715/>`_
|
||||
* `Git for Windows <https://git-for-windows.github.io/>`_
|
||||
* `Latest *stable* Python 2.7 and Python 3.8 releases from python.org <https://www.python.org/downloads/windows/>`_
|
||||
(at the time of writing those are ``2.7.18`` and ``3.8.4``)
|
||||
|
||||
* make sure to have the installer add Python to the ``PATH`` and have it install ``pip`` too
|
||||
* it's recommended to install Python 2.7 into ``C:\Python27`` and Python 3 into ``C:\Python38`` - if you select
|
||||
different install locations please substitute accordingly
|
||||
|
||||
* `Microsoft Visual C++ Compiler for Python 2.7 <http://www.microsoft.com/en-us/download/details.aspx?id=44266>`_
|
||||
* `Git for Windows <https://git-for-windows.github.io/>`_
|
||||
* `Build Tools For Visual Studio 2019 <https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019>`_
|
||||
|
||||
* install "C++ build tools" and ensure the latest versions of "MSVCv142 - VS 2019 C++ x64/x86 build tools" and
|
||||
"Windows 10 SDK" are checked.
|
||||
|
||||
Open the Git Bash you just installed and in that:
|
||||
|
||||
@@ -139,10 +141,14 @@ Open the Git Bash you just installed and in that:
|
||||
cd /c/Devel
|
||||
git clone https://github.com/OctoPrint/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv venv
|
||||
source ./venv/Scripts/activate
|
||||
virtualenv --python=C:\Python27\python.exe venv2
|
||||
virtualenv --python=C:\Python38\python.exe venv3
|
||||
source ./venv2/Scripts/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop,plugins]
|
||||
source ./venv3/Scripts/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop,plugins,docs]
|
||||
|
||||
.. _sec-development-environment-mac:
|
||||
|
||||
@@ -156,7 +162,9 @@ Mac OS X
|
||||
|
||||
.. todo::
|
||||
|
||||
This guide is not yet adapted to the concurrent use of Python 2.7 and 3.7 environments during development.
|
||||
This guide is not yet adapted to the concurrent use of Python 2 and 3 environments during development. Please send a
|
||||
`Pull Request <https://github.com/OctoPrint/OctoPrint/blob/master/CONTRIBUTING.md#pull-requests>`_ to get the necessary
|
||||
steps into this guide!
|
||||
|
||||
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
|
||||
location, please substitute accordingly.
|
||||
@@ -196,10 +204,6 @@ You'll need a user account with administrator privileges.
|
||||
IDE Setup
|
||||
---------
|
||||
|
||||
.. todo::
|
||||
|
||||
This guide is not yet adapted to the concurrent use of Python 2.7 and 3.7 environments during development.
|
||||
|
||||
.. todo::
|
||||
|
||||
Using another IDE than the ones below? Please send a
|
||||
@@ -212,18 +216,23 @@ PyCharm
|
||||
.......
|
||||
|
||||
- "File" > "Open ...", select OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
- **(Linux, Windows)** "File" > "Settings ..." > "Project: OctoPrint" > "Project Interpreter" > "Add local ...", select OctoPrint venv
|
||||
folder (e.g. ``~/devel/OctoPrint/venv`` or ``C:\Devel\OctoPrint\venv``)
|
||||
- **(macOS)** "PyCharm" > "Preferences ..." > "Project: OctoPrint" > "Project Interpreter" > "Add ..." >
|
||||
"Virtualenv Environment > "Existing Environment", select OctoPrint venv folder (e.g. ``~/devel/OctoPrint/venv``)
|
||||
- Register virtual environments:
|
||||
|
||||
- **(Linux, Windows)** "File" > "Settings ..." > "Project: OctoPrint" > "Project Interpreter" > "Add local ...",
|
||||
select OctoPrint ``venv2`` folder (e.g. ``~/devel/OctoPrint/venv2`` or ``C:\Devel\OctoPrint\venv2``).
|
||||
- **(macOS)** "PyCharm" > "Preferences ..." > "Project: OctoPrint" > "Project Interpreter" > "Add ..." >
|
||||
"Virtualenv Environment > "Existing Environment", select OctoPrint ``venv2`` folder (e.g. ``~/devel/OctoPrint/venv2``).
|
||||
|
||||
Repeat for the ``venv3`` folder.
|
||||
|
||||
- Right click "src" in project tree, mark as source folder
|
||||
- Add Run/Debug Configuration, select "Python":
|
||||
|
||||
* Name: OctoPrint server
|
||||
* Module name: ``octoprint``
|
||||
* Module parameters: ``serve --debug``
|
||||
* Parameters: ``serve --debug``
|
||||
* Project: ``OctoPrint``
|
||||
* Python interpreter: the ``venv`` local virtual environment
|
||||
* Python interpreter: Project Default
|
||||
* Working directory: the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
* If you want build artifacts to be cleaned up on run (recommended): "Before Launch" > "+" > "Run external tool" > "+"
|
||||
|
||||
@@ -239,29 +248,38 @@ PyCharm
|
||||
* Parameters: ``-m pip install -e .[develop,plugins]``
|
||||
* Working directory: ``$ProjectFileDir$``
|
||||
|
||||
Note that sadly that seems to cause some hiccups on current PyCharm versions due to ``$PyInterpreterDirectory$``
|
||||
being empty sometimes, so if this fails to run on your installation, you should update your dependencies manually
|
||||
for now.
|
||||
|
||||
- Add Run/Debug Configuration, select "Python tests" and therein "pytest":
|
||||
|
||||
* Name: OctoPrint pytest
|
||||
* Name: OctoPrint tests
|
||||
* Target: Custom
|
||||
* Project: ``OctoPrint``
|
||||
* Python interpreter: the ``venv`` local virtual environment
|
||||
* Python interpreter: Project Default
|
||||
* Working directory: the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
* Just like with the run configuration for the server you can also have the dependencies auto-update on run of
|
||||
the tests, see above on how to set this up.
|
||||
|
||||
- Add Run/Debug Configuration, select "Python docs" and therein "Sphinx task"
|
||||
- Add Run/Debug Configuration, select "Python":
|
||||
|
||||
* Name: OctoPrint docs
|
||||
* Command: ``html``
|
||||
* Input: the ``docs`` folder in the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint/docs`` or
|
||||
``C:\Devel\OctoPrint\docs``)
|
||||
* Output: the ``docs/_build`` folder in the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint/docs/_build`` or
|
||||
``C:\Devel\OctoPrint\docs\_build``)
|
||||
* Module name: ``sphinx.cmd.build``
|
||||
* Parameters: ``-v -T -E ./docs ./docs/_build -b html``
|
||||
* Project: ``OctoPrint``
|
||||
* Python interpreter: the ``venv`` local virtual environment
|
||||
* Python interpreter: ``venv3`` environment (the docs build requires Python 3)
|
||||
* Working directory: the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
* Just like with the run configuration for the server you can also have the dependencies auto-update when building
|
||||
the documentation, see above on how to set this up.
|
||||
|
||||
Note that this requires you to also have installed the additional ``docs`` dependencies into the Python 3 venv as
|
||||
described above via ``pip install -e .[develop,plugins,docs]``.
|
||||
|
||||
To switch between Python 2 and 3, all you need to do now is change the Project Default Interpreter and restart
|
||||
OctoPrint. On current PyCharm versions you can do that right from a small selection field in the footer of the IDE.
|
||||
Otherwise go through Settings.
|
||||
|
||||
.. note::
|
||||
|
||||
Make sure you are running a PyCharm version of 2016.1 or later, or manually fix
|
||||
|
||||
@@ -13,8 +13,8 @@ from octoprint.util.version import get_octoprint_version_string, is_released_oct
|
||||
from flask import jsonify
|
||||
from flask_babel import gettext
|
||||
|
||||
SENTRY_URL_SERVER = "https://829e2245ec4d4693a0b708523004c4eb@o118517.ingest.sentry.io/1373987"
|
||||
SENTRY_URL_COREUI = "https://fcbbcf95f5514b59866c5e7360fba1fe@o118517.ingest.sentry.io/1374096"
|
||||
SENTRY_URL_SERVER = "https://9a2cb386ed8640e8a7fa0276f613be69@o118517.ingest.sentry.io/1373987"
|
||||
SENTRY_URL_COREUI = "https://2350156be0954d299dd07a4cef2650b2@o118517.ingest.sentry.io/1374096"
|
||||
|
||||
SETTINGS_DEFAULTS = dict(enabled=False,
|
||||
enabled_unreleased=False,
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
<small class="prop" data-bind="visible: $data.stats !== undefined" title="{{ _('Active instances past month')|edq }}"><i class="fa fa-server"></i> <span data-bind="text: $data.stats !== undefined ? formatNumberK($data.stats.instances_month) : 0"></span></small>
|
||||
<small class="prop" data-bind="visible: $data.github !== undefined && $data.github.stars !== undefined" title="{{ _('Github stars')|edq }}"><i class="fa fa-star"></i> <span data-bind="text: ($data.github !== undefined && $data.github.stars !== undefined) ? formatNumberK($data.github.stars) : 0"></span></small>
|
||||
<small class="prop" data-bind="visible: $data.github !== undefined && $data.github.last_push !== undefined" title="{{ _('Last push to main branch')|edq }}"><i class="fa fa-refresh"></i> <span data-bind="text: ($data.github !== undefined && $data.github.last_push !== undefined) ? $data.github.last_push.substring(0, 10) : ''"></span></small>
|
||||
<small class="prop" data-bind="visible: $data.github !== undefined && $data.github.latest_release != undefined" title="{{ _('Latest release & date')|edq }}"><i class="fa fa-tag"></i> <span data-bind="text: $data.github !== undefined && $data.github.latest_release !== undefined ? $data.github.latest_release.tag : ''"></span> (<span data-bind="text: $data.github !== undefined && $data.github.latest_release !== undefined ? $data.github.latest_release.date.substring(0, 10) : ''"></span>)</small>
|
||||
<small class="prop" data-bind="visible: $data.github !== undefined && $data.github.latest_release != undefined && $data.github.latest_release.tag && $data.github.latest_release.date" title="{{ _('Latest release & date')|edq }}"><i class="fa fa-tag"></i> <span data-bind="text: $data.github !== undefined && $data.github.latest_release !== undefined && $data.github.latest_release.tag ? $data.github.latest_release.tag : ''"></span> (<span data-bind="text: $data.github !== undefined && $data.github.latest_release !== undefined && $data.github.latest_release.date ? $data.github.latest_release.date.substring(0, 10) : ''"></span>)</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -267,6 +267,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
|
||||
logging.getLogger("SERIAL").info("serial.log is currently not enabled, you can enable it via Settings > Serial Connection > Log communication to serial.log")
|
||||
|
||||
self._comm = comm.MachineCom(port, baudrate, callbackObject=self, printerProfileManager=self._printerProfileManager)
|
||||
self._comm.start()
|
||||
|
||||
def disconnect(self, *args, **kwargs):
|
||||
"""
|
||||
@@ -1505,7 +1506,9 @@ class StateMonitor(object):
|
||||
self._last_update = monotonic_time()
|
||||
self._change_event.clear()
|
||||
except Exception:
|
||||
logging.getLogger(__name__).exception("Looks like something crashed inside the state update worker. Please report this on the OctoPrint issue tracker (make sure to include logs!)")
|
||||
logging.getLogger(__name__).exception("Looks like something crashed inside the state update worker. "
|
||||
"Please report this on the OctoPrint issue tracker (make sure "
|
||||
"to include logs!)")
|
||||
|
||||
def get_current_data(self):
|
||||
with self._progress_lock:
|
||||
|
||||
@@ -63,7 +63,12 @@ def _create_lastmodified(path, recursive):
|
||||
return max(lms)
|
||||
|
||||
else:
|
||||
storage, path_in_storage = path.split("/", 1)
|
||||
if "/" in path:
|
||||
storage, path_in_storage = path.split("/", 1)
|
||||
else:
|
||||
storage = path
|
||||
path_in_storage = None
|
||||
|
||||
try:
|
||||
return fileManager.last_modified(storage, path=path_in_storage, recursive=recursive)
|
||||
except Exception:
|
||||
|
||||
@@ -117,9 +117,12 @@ class PrinterStateConnection(octoprint.vendor.sockjs.tornado.SockJSConnection,
|
||||
self._remoteAddress = None
|
||||
self._user = self._userManager.anonymous_user_factory()
|
||||
|
||||
self._throttleFactor = 1
|
||||
self._lastCurrent = 0
|
||||
self._baseRateLimit = 0.5
|
||||
self._throttle_factor = 1
|
||||
self._last_current = 0
|
||||
self._base_rate_limit = 0.5
|
||||
|
||||
self._held_back_current = None
|
||||
self._held_back_mutex = threading.RLock()
|
||||
|
||||
self._register_hooks = self._pluginManager.get_hooks("octoprint.server.sockjs.register")
|
||||
self._authed_hooks = self._pluginManager.get_hooks("octoprint.server.sockjs.authed")
|
||||
@@ -222,18 +225,27 @@ class PrinterStateConnection(octoprint.vendor.sockjs.tornado.SockJSConnection,
|
||||
except ValueError:
|
||||
self._logger.warning("Got invalid throttle factor from client {}, ignoring: {!r}".format(self._remoteAddress, message["throttle"]))
|
||||
else:
|
||||
self._throttleFactor = throttle
|
||||
self._logger.debug("Set throttle factor for client {} to {}".format(self._remoteAddress, self._throttleFactor))
|
||||
self._throttle_factor = throttle
|
||||
self._logger.debug("Set throttle factor for client {} to {}".format(self._remoteAddress, self._throttle_factor))
|
||||
|
||||
def on_printer_send_current_data(self, data):
|
||||
if not self._user.has_permission(Permissions.STATUS):
|
||||
return
|
||||
|
||||
# make sure we rate limit the updates according to our throttle factor
|
||||
now = time.time()
|
||||
if now < self._lastCurrent + self._baseRateLimit * self._throttleFactor:
|
||||
return
|
||||
self._lastCurrent = now
|
||||
with self._held_back_mutex:
|
||||
if self._held_back_current is not None:
|
||||
self._held_back_current.cancel()
|
||||
self._held_back_current = None
|
||||
|
||||
now = time.time()
|
||||
delta = self._last_current + self._base_rate_limit * self._throttle_factor - now
|
||||
if delta > 0:
|
||||
self._held_back_current = threading.Timer(delta, lambda: self.on_printer_send_current_data(data))
|
||||
self._held_back_current.start()
|
||||
return
|
||||
|
||||
self._last_current = now
|
||||
|
||||
# add current temperature, log and message backlogs to sent data
|
||||
with self._temperatureBacklogMutex:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<span class="search-clear" data-bind="click: clearSearchQuery"><i class="fa fa-remove"></i></span>
|
||||
</div>
|
||||
</form>
|
||||
<div class="gcode_files" data-bind="visible: $root.loginState.hasPermissionKo($root.access.permissions.FILES_LIST)">
|
||||
<div class="gcode_files" data-test-id="files-list" data-bind="visible: $root.loginState.hasPermissionKo($root.access.permissions.FILES_LIST)">
|
||||
<div class="entry back clickable" data-bind="visible: currentPath() != '', click: function() { $root.navigateUp(); }" style="display: none">
|
||||
<div class="back-arrow"><i class="fa fa-arrow-left"></i> {{ _('Back') }}</div>
|
||||
<div class="back-path"><small class="muted">{{ _('Currently in') }} <span data-bind="text: currentPath"></span></small></div>
|
||||
@@ -67,18 +67,18 @@
|
||||
<span class="btn btn-primary fileinput-button span6" style="margin-bottom: 10px">
|
||||
<i class="fa fa-upload"></i>
|
||||
<span>{{ _('Upload') }}</span>
|
||||
<input id="gcode_upload" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button">
|
||||
<input id="gcode_upload" data-test-id="upload-local" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button">
|
||||
</span>
|
||||
<span class="btn btn-primary fileinput-button span6" data-bind="enable: $root.isSdReady() && !$root.isPrinting(), css: {disabled: !$root.isSdReady() || $root.isPrinting()}" style="margin-bottom: 10px">
|
||||
<i class="fa fa-upload"></i>
|
||||
<span>{{ _('Upload to SD') }}</span>
|
||||
<input id="gcode_upload_sd" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button" data-bind="enable: isSdReady()">
|
||||
<input id="gcode_upload_sd" data-test-id="upload-sd" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button" data-bind="enable: isSdReady()">
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="btn btn-primary fileinput-button span12" style="margin-bottom: 10px">
|
||||
<i class="icon-upload-alt icon-white"></i>
|
||||
<span>{{ _('Upload') }}</span>
|
||||
<input id="gcode_upload" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button">
|
||||
<input id="gcode_upload" data-test-id="upload-local" accept="{{ ",".join(supportedExtensions) }}" type="file" name="file" class="fileinput-button">
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
<button class="btn btn-block control-box" data-bind="enable: isOperational() && !isPrinting(), click: function() { $root.sendRetractCommand() }">{{ _('Retract') }}</button>
|
||||
|
||||
<!-- Flow rate -->
|
||||
<div id="control-jog-feedrate" class="jog-panel">
|
||||
<div id="control-jog-flowrate" class="jog-panel">
|
||||
<label>{{ _('Flow rate modifier:') }} <a class="text-info" href="javascript:void(0)" data-bind="popover: {placement: 'top', trigger: 'hover', title: '{{ _('Please note!') }}', content: '{{ _('The flow rate 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="fa fa-info-circle"></i></a></label>
|
||||
<div class="input-append control-box">
|
||||
<input type="number" class="input-mini" min="1" step="1" data-bind="value: flowRate, event: { blur: resetFlowRateDisplay, focus: cancelFlowRateDisplayReset }, css: { pulsate_text_opacity: flowRateResetter() !== undefined }">
|
||||
|
||||
Binary file not shown.
@@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OctoPrint\n"
|
||||
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
|
||||
"POT-Creation-Date: 2020-07-14 21:42+0200\n"
|
||||
"POT-Creation-Date: 2020-08-04 10:26+0200\n"
|
||||
"PO-Revision-Date: 2020-07-14 21:42+0200\n"
|
||||
"Last-Translator: Gina Häußge <osd@foosel.net>\n"
|
||||
"Language: de\n"
|
||||
|
||||
+38
-16
@@ -648,12 +648,17 @@ class MachineCom(object):
|
||||
self._monitoring_active = True
|
||||
self.monitoring_thread = threading.Thread(target=self._monitor, name="comm._monitor")
|
||||
self.monitoring_thread.daemon = True
|
||||
self.monitoring_thread.start()
|
||||
|
||||
# sending thread
|
||||
self._send_queue_active = True
|
||||
self.sending_thread = threading.Thread(target=self._send_loop, name="comm.sending_thread")
|
||||
self.sending_thread.daemon = True
|
||||
|
||||
def start(self):
|
||||
# doing this here instead of __init__ combats a race condition where
|
||||
# self._comm in the printer interface is still None on first pushs from
|
||||
# the comm layer during detection
|
||||
self.monitoring_thread.start()
|
||||
self.sending_thread.start()
|
||||
|
||||
def __del__(self):
|
||||
@@ -959,7 +964,7 @@ class MachineCom(object):
|
||||
self._send_queue_active = False
|
||||
|
||||
if self._serial is not None:
|
||||
if not is_error:
|
||||
if not is_error and self._state in self.OPERATIONAL_STATES:
|
||||
self.sendGcodeScript("beforePrinterDisconnected")
|
||||
if wait:
|
||||
if timeout is not None:
|
||||
@@ -990,15 +995,17 @@ class MachineCom(object):
|
||||
self._logger.exception("Error while trying to close serial port")
|
||||
is_error = True
|
||||
|
||||
# if we are printing, this will also make sure of firing PRINT_FAILED
|
||||
if is_error:
|
||||
self._changeState(self.STATE_CLOSED_WITH_ERROR)
|
||||
else:
|
||||
self._changeState(self.STATE_CLOSED)
|
||||
else:
|
||||
deactivate_monitoring_and_send_queue()
|
||||
|
||||
self._serial = None
|
||||
|
||||
# if we are printing, this will also make sure of firing PRINT_FAILED
|
||||
if is_error:
|
||||
self._changeState(self.STATE_CLOSED_WITH_ERROR)
|
||||
else:
|
||||
self._changeState(self.STATE_CLOSED)
|
||||
|
||||
if settings().getBoolean(["feature", "sdSupport"]):
|
||||
self._sdFileList = []
|
||||
|
||||
@@ -1677,6 +1684,10 @@ class MachineCom(object):
|
||||
self._changeState(self.STATE_DETECT_SERIAL)
|
||||
self._perform_detection_step(init=True)
|
||||
|
||||
if not self._state in (self.STATE_CONNECTING, self.STATE_DETECT_SERIAL):
|
||||
# we got cancelled during connection, bail
|
||||
return
|
||||
|
||||
# Start monitoring the serial port
|
||||
self._log("Connected to: %s, starting monitor" % self._serial)
|
||||
|
||||
@@ -2403,19 +2414,30 @@ class MachineCom(object):
|
||||
self._detection_candidates))))
|
||||
|
||||
def attempt_handshake():
|
||||
timeout = self._get_communication_timeout_interval()
|
||||
if self._serial.timeout != timeout:
|
||||
self._serial.timeout = timeout
|
||||
self._timeout = self._ok_timeout = monotonic_time() + timeout
|
||||
|
||||
log("Handshake attempt #{} with timeout {}s".format(self._detection_retry + 1, timeout))
|
||||
|
||||
self._detection_retry += 1
|
||||
self._do_send_without_checksum(b"", log=False) # new line to reset things
|
||||
self.sayHello(tags={"trigger:detection", })
|
||||
timeout = self._get_communication_timeout_interval()
|
||||
|
||||
log("Handshake attempt #{} with timeout {}s".format(self._detection_retry, timeout))
|
||||
try:
|
||||
if self._serial.timeout != timeout:
|
||||
self._serial.timeout = timeout
|
||||
self._timeout = self._ok_timeout = monotonic_time() + timeout
|
||||
except Exception:
|
||||
self._log("Unexpected error while setting timeout {}: {}".format(timeout, get_exception_string()))
|
||||
self._logger.exception("Unexpected error while setting timeout {}".format(timeout))
|
||||
else:
|
||||
self._do_send_without_checksum(b"", log=False) # new line to reset things
|
||||
self.sayHello(tags={"trigger:detection", })
|
||||
|
||||
while len(self._detection_candidates) > 0 or self._detection_retry < self.DETECTION_RETRIES:
|
||||
if self._state not in (self.STATE_DETECT_SERIAL,):
|
||||
return
|
||||
|
||||
if self._detection_retry < self.DETECTION_RETRIES:
|
||||
if self._serial is None:
|
||||
self._detection_retry = self.DETECTION_RETRIES
|
||||
continue
|
||||
|
||||
attempt_handshake()
|
||||
return
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
M117 I'm just a test upload during E2E
|
||||
G28 X0 Y0
|
||||
M117 That is all folks!
|
||||
@@ -0,0 +1,24 @@
|
||||
import { prepare_server, login, await_coreui } from "../util/util"
|
||||
|
||||
context('Upload tests', () => {
|
||||
const username = 'admin';
|
||||
const password = 'test';
|
||||
|
||||
beforeEach(() => {
|
||||
prepare_server();
|
||||
|
||||
// login
|
||||
login(username, password);
|
||||
|
||||
cy.visit('/');
|
||||
await_coreui();
|
||||
});
|
||||
|
||||
it("uploads file to local via button", () => {
|
||||
cy.get('[data-test-id=upload-local]')
|
||||
.attachFile("e2e-test.gcode");
|
||||
cy.wait("@files");
|
||||
cy.get('[data-test-id=files-list]')
|
||||
.contains("e2e-test.gcode");
|
||||
});
|
||||
});
|
||||
Generated
+13
@@ -428,6 +428,14 @@
|
||||
"resolved": "https://registry.npmjs.org/cypress-commands/-/cypress-commands-1.1.0.tgz",
|
||||
"integrity": "sha512-Q8Jr25pHJQFXwln6Hp8O+Hgs8Z506Y2wA9F1Te2cTajjc5L9gtt9WPOcw1Ogh+OgyqaMHF+uq31vdfImRTio5Q=="
|
||||
},
|
||||
"cypress-file-upload": {
|
||||
"version": "4.0.7",
|
||||
"resolved": "https://registry.npmjs.org/cypress-file-upload/-/cypress-file-upload-4.0.7.tgz",
|
||||
"integrity": "sha512-rFFmnoZ2bWyWFpSV09AhkSUgYEiVy70pcQ6nf/mGTMTrVHvKCCCIfRu3TbgVYHbgBq+0hqjfjQrtz4IbgH7qZA==",
|
||||
"requires": {
|
||||
"mime": "2.4.6"
|
||||
}
|
||||
},
|
||||
"cypress-plugin-retries": {
|
||||
"version": "1.5.2",
|
||||
"resolved": "https://registry.npmjs.org/cypress-plugin-retries/-/cypress-plugin-retries-1.5.2.tgz",
|
||||
@@ -1083,6 +1091,11 @@
|
||||
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
|
||||
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
|
||||
},
|
||||
"mime": {
|
||||
"version": "2.4.6",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz",
|
||||
"integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA=="
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.44.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"dependencies": {
|
||||
"cypress": "^4.9.0",
|
||||
"cypress-commands": "^1.1.0",
|
||||
"cypress-file-upload": "^4.0.7",
|
||||
"cypress-plugin-retries": "^1.5.2",
|
||||
"cypress-terminal-report": "^1.4.1",
|
||||
"cypress-wait-until": "^1.7.1"
|
||||
|
||||
@@ -1,27 +1,2 @@
|
||||
// ***********************************************
|
||||
// This example commands.js shows you how to
|
||||
// create various custom commands and overwrite
|
||||
// existing commands.
|
||||
//
|
||||
// For more comprehensive examples of custom
|
||||
// commands please read more here:
|
||||
// https://on.cypress.io/custom-commands
|
||||
// ***********************************************
|
||||
//
|
||||
//
|
||||
// -- This is a parent command --
|
||||
// Cypress.Commands.add("login", (email, password) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a child command --
|
||||
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This is a dual command --
|
||||
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
|
||||
//
|
||||
//
|
||||
// -- This will overwrite an existing command --
|
||||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
||||
|
||||
import 'cypress-wait-until';
|
||||
import 'cypress-file-upload';
|
||||
Binary file not shown.
@@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OctoPrint\n"
|
||||
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
|
||||
"POT-Creation-Date: 2020-07-14 21:42+0200\n"
|
||||
"POT-Creation-Date: 2020-08-04 10:26+0200\n"
|
||||
"PO-Revision-Date: 2020-07-14 21:42+0200\n"
|
||||
"Last-Translator: Gina Häußge <osd@foosel.net>\n"
|
||||
"Language: de\n"
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OctoPrint 1.4.1rc3.dev14+gc5baa05b5.dirty\n"
|
||||
"Project-Id-Version: OctoPrint 1.4.1rc5.dev1+g57b8d0b88.dirty\n"
|
||||
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
|
||||
"POT-Creation-Date: 2020-07-14 21:42+0200\n"
|
||||
"POT-Creation-Date: 2020-08-04 10:26+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
||||
Reference in new issue
Block a user