Compare commits

...
29 Commits
Author SHA1 Message Date
Gina Häußge ec04364b47 Preparing release of 1.2.18rc1 2016-11-22 12:47:29 +01:00
Gina Häußge a88cd9fcfc Copy settings in on_settings_load so we don't mutate them 2016-11-21 13:44:26 +01:00
Gina Häußge 59e4394cdd Allow type specific default values for restricted settings
See #1567
2016-11-21 13:43:53 +01:00
Gina Häußge bc82a18a03 Merge branch 'rc/maintenance' into maintenance 2016-11-08 15:25:05 +01:00
Gina Häußge 6976ac9edd Preparing release of 1.2.17 2016-11-08 11:31:16 +01:00
Gina Häußge 2952b2622e Do not hiccup on ipv6 addresses in the HTTP Host header
Fixed port extraction. Now supports hostname, hostname + port,
ipv4, ipv4 + port, ipv6, ipv6 + port

Fixes #1571
2016-11-07 16:17:16 +01:00
Gina Häußge 7efdeced62 Merge branch 'rc/maintenance' into maintenance 2016-10-17 14:23:43 +02:00
Gina Häußge 2f79d9d226 Preparing release of 1.2.17rc4 2016-10-17 12:25:51 +02:00
Gina Häußge 88f8077b77 Plugin JS files might be empty, need to handle that
Otherwise webassets will explode with empty file list on bundle creation.
2016-10-17 12:16:53 +02:00
Gina Häußge 696904bc49 Support M1{09|90} R<temp> in virtual printer too 2016-10-17 10:41:39 +02:00
Gina Häußge cd578dc2e1 Checking M109/M190 for R should actually check for R and not S
Thanks @FHeilmann
2016-10-17 10:29:16 +02:00
Gina Häußge e15956883a Add support for R parameter in M109/M190 2016-10-14 18:19:08 +02:00
Gina Häußge 3f8dde75d5 Persist settings after changing default printer profile
Fixes #1541
2016-10-14 16:23:47 +02:00
Gina Häußge bc5044b125 Fix target temperature propagation from comm layer
When setting the tracked target temperature from a sent temperature
command, the changes in tracked temperature were not propagated
from the comm layer to registered callbacks.

But since the standard printer also didn't make a copy of the mutable
dict of tool temperatures, those were in fact updated even without
propagation in the printer implementation when the values in the
comm layer got updated, whereas the bed temperature - an immutable
tupel - was not.

Two wrongs sometimes do in fact make a right. In this case that led
to target temperature changes on the tools immediately reflecting
in printer.get_current_temperatures after the command was sent,
but changes to the bed target taking until the next M105 response
to propagate.

Decoupling the data structures and adding propagation commands
to the comm layer solves this issue.

Fixes #1543
2016-10-14 16:01:03 +02:00
Gina Häußge c863562d12 Limit cura profile importer to .ini files and clarified support again 2016-10-14 11:58:39 +02:00
Gina Häußge 27fb397681 ffmpeg: Only modify the -framerate parameter for setting video fps
-r only allows a limited set of target framerates according to the mpeg2
 standard, but -framerate allows to specify how long each frame should
 be shown, giving us full control over "virtual" fps without causing errors
 when the user selects a non-standard frame rate
2016-10-13 19:23:15 +02:00
Gina Häußge eabff453cd Preparing release of 1.2.17rc3 2016-10-13 16:12:57 +02:00
Gina Häußge 6cd6b98c2b Core JS needs to go after plugin JS, or we might run into race conditions 2016-10-13 16:11:13 +02:00
Gina Häußge 91ef5480b1 Preparing release of 1.2.17rc2 2016-10-13 12:12:09 +02:00
Gina Häußge 419f3370a2 Split JS/CSS/LESS assets between core+bundled plugins and external plugins
That way a JS error in an external plugin won't nuke the whole UI, which IMHO
is worth the additional requests needed to load the split up files.

See #1544 for an example of such a situation.
2016-10-13 12:07:00 +02:00
Gina Häußge 1370c7a9cc Inject plugin_info object into plugin implementations as well 2016-10-13 12:03:05 +02:00
Gina Häußge 982d121d3b Revert "Preparing release of 1.2.17"
This reverts commit 28de87441f.
2016-10-12 18:36:41 +02:00
Gina Häußge 67634e4f7c Merge branch 'improve/loggingHandlers' into maintenance 2016-10-12 18:15:12 +02:00
Gina Häußge 3d26e478e3 Fix a bug causing the update of OctoPrint to not work under certain circumstances
The bug only manifests if a user had installed 1.2.16 earlier and never once hit "Save" in the
settings before attempting to update to 1.2.17. With 1.2.16 the updater script and settings for
OctoPrint's own update mechanism were changed to prefer "checkout_folder" instead of
"update_folder". In earlier versions however "update_folder" was still used. Saving settings
even once (even without any changes!) will migrate the data. But if that's not done a
KeyError will be raised when trying to retrieve "update_folder" from the check config, with
"checkout_folder" as its fallback.

Rather stupid error really.
2016-10-12 18:13:46 +02:00
Gina Häußge 28de87441f Preparing release of 1.2.17 2016-10-12 16:50:22 +02:00
Gina Häußge 688a998dd2 Use CleaningTimedRotatingFileHandler in bundled plugins 2016-10-11 10:54:16 +02:00
Gina Häußge 343631b3c6 Custom SerialLoggingHandler
Does roll overs on next connections to the printer
2016-10-11 10:53:37 +02:00
Gina Häußge 139b2277d1 Fix missing absolute import declarations 2016-10-10 19:45:34 +02:00
Gina Häußge e8123a6ab1 Custom logging handler that cleans files on startup 2016-10-10 19:27:18 +02:00
28 changed files with 598 additions and 220 deletions

No files matched your search

+33 -2
View File
@@ -1,6 +1,24 @@
# OctoPrint Changelog
## 1.2.17rc1 (2016-10-06)
## 1.2.18rc1 (2016-11-22)
### Improvements
* Allow arbitrary frame rates for creating timelapses. Before, the entered fps value was also directly used as frame rate for the actual video, which could cause problems with any frame rates not specified in the MPEG2 standard. Now OctoPrint will use a standard frame rate for the rendered video and render the timelapse stills into the finished movie with the configured frame rate.
* Limited Cura profile importer to `.ini` files and clarified the supported versions
* Add support for the `R` parameter for `M109` and `M190`
### Bug fixes
* [#1541](https://github.com/foosel/OctoPrint/issues/1541) - Fix selecting the printer profile to use by default
* [#1543](https://github.com/foosel/OctoPrint/issues/1543) - Fix target temperature propagation from communication layer
* [#1567](https://github.com/foosel/OctoPrint/issues/1567) - Fix issue with restricted settings getting parsed to the wrong data structure in the frontend if loaded anonymously first.
* [#1571](https://github.com/foosel/OctoPrint/issues/1571) - Fix parsing of port number from HTTP Host header for IPv6 addresses
* Fix issue with settings restriction causing internal settings defaults to be changed.
([Commits](https://github.com/foosel/OctoPrint/compare/1.2.17...1.2.18))
## 1.2.17 (2016-11-08)
### Improvements
@@ -8,6 +26,8 @@
* Log full stack trace on socket connection errors when debug logging for `octoprint.server.util.sockjs` is enabled
* ``SettingsPlugin``s may now mark configuration paths as restricted so that they are not returned on the REST API
* Updated LESS.js version
* Improved the `serial.log` logging handler to roll over serial log on new connections to the printer instead of continuously appending to the same file. Please note that `serial.log` is a debugging tool only and should *not* be left enabled unless you are trying to troubleshoot something in your printer communication.
* Split JS/CSS/LESS asset bundles according into asset bundles for core + bundled plugins ("packed_core.{js|css|less}") and third party plugins ("packed_plugins.{js|css|less}"). That will allow the core UI to still function properly even if an installed third party plugin produces invalid JS and therefore causes a parser error for the whole plugin JS file. See [#1544](https://github.com/foosel/OctoPrint/issues/1544) for an example of such a situation.
### Bug fixes
@@ -16,8 +36,19 @@
* Fixed issue causing ``remember_me`` cookie not to be deleted properly on logout
* Fixed broken filter toggling on ``ItemListHelper`` class used for various lists throughout the web interface
* Fixed an issue with the preliminary page never reporting that the server is now up if the page generated during preliminary caching had no cache headers set (e.g. because it contained the first run setup wizard)
* Fixed a bug causing the update of OctoPrint to not work under certain circumstances: If 1.2.16 was installed and the settings were *never* saved via the "Settings" dialog's "Save", the update of OctoPrint would fail due to a `KeyError` in the updater. Reason is a renamed property, properly switched to when saving the settings.
* Fixed the logging subsystem to properly clean up after itself.
* Fixed a wrong order in loading JS files on the client introduced in 1.2.17rc2 to make the UI more resilient against broken plugin JS.
* Properly handle empty JS file list from plugins. Solves a 500 on OctoPrint instances without any third party plugins installed generated during web asset bundling introduced in 1.2.17rc2.
([Commits](https://github.com/foosel/OctoPrint/compare/1.2.16...1.2.17rc1))
### More information
* [Commits](https://github.com/foosel/OctoPrint/compare/1.2.16...1.2.17)
* Release Candidates:
* [1.2.17rc1](https://github.com/foosel/OctoPrint/releases/tag/1.2.17rc1)
* [1.2.17rc2](https://github.com/foosel/OctoPrint/releases/tag/1.2.17rc2)
* [1.2.17rc3](https://github.com/foosel/OctoPrint/releases/tag/1.2.17rc3)
* [1.2.17rc4](https://github.com/foosel/OctoPrint/releases/tag/1.2.17rc4)
## 1.2.16 (2016-09-23)
+3 -6
View File
@@ -33,32 +33,28 @@ thanks to everyone who contributed!
* Gary Deen
* Gary N McKinney
* George Robles
* Gregor Lütolf
* J. Eckert
* Jason Galarneau
* Joe Korzeniewski
* Josh Daniels
* Joshua David Gregory
* Kaile Riser
* Kale Stedman
* Kazuhiro Ogura
* Korneel Bullens
* Lamin Kivelä
* M Khorakiwala
* Makespace Madrid
* Mark Lane
* Mark Qvist
* Mark Walker
* Masayoshi Mitsui
* Michael Aumock
* Michael McDargh Sr
* Miles Flavel
* Nikolai Langer
* Noe Ruiz
* Patrick McGinnis
* Peter Grace
* Peter Schmehl
* PRINT3Dforum.com
* Robert Gusek
* Roger Strolz
* Roy Cortes
* Samer Najia
@@ -67,10 +63,11 @@ thanks to everyone who contributed!
* Shane Ekerbicer
* Simon Hallam
* Stefan Krister
* Stephane Schittly
* Steven Pearson
* Sven Mueller
* Terrance Shaw
* Thomas Hatley
* Trent Shumay
and 933 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
and 989 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
+2
View File
@@ -299,6 +299,8 @@ An overview of these properties follows.
The plugin's name, as taken from either the ``__plugin_name__`` control property or the package info.
``self._plugin_version``
The plugin's version, as taken from either the ``__plugin_version__`` control property or the package info.
``self._plugin_info``
The :class:`octoprint.plugin.core.PluginInfo` object associated with the plugin.
``self._basefolder``
The plugin's base folder where it's installed. Can be used to refer to files relative to the plugin's installation
location, e.g. included scripts, templates or assets.
+2
View File
@@ -1,4 +1,6 @@
#!/usr/bin/env python
from __future__ import absolute_import
import sys
from octoprint.daemon import Daemon
from octoprint.server import Server
+4
View File
@@ -0,0 +1,4 @@
# coding=utf-8
from __future__ import absolute_import
from . import handlers
+83
View File
@@ -0,0 +1,83 @@
# coding=utf-8
from __future__ import absolute_import
import logging.handlers
import os
import re
import time
class CleaningTimedRotatingFileHandler(logging.handlers.TimedRotatingFileHandler):
def __init__(self, *args, **kwargs):
logging.handlers.TimedRotatingFileHandler.__init__(self, *args, **kwargs)
# clean up old files on handler start
if self.backupCount > 0:
for s in self.getFilesToDelete():
os.remove(s)
class SerialLogHandler(logging.handlers.RotatingFileHandler):
_do_rollover = False
_suffix_template = "%Y-%m-%d_%H-%M-%S"
_file_pattern = re.compile(r"^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}$")
@classmethod
def on_open_connection(cls):
cls._do_rollover = True
def __init__(self, *args, **kwargs):
logging.handlers.RotatingFileHandler.__init__(self, *args, **kwargs)
self.cleanupFiles()
def emit(self, record):
logging.handlers.RotatingFileHandler.emit(self, record)
def shouldRollover(self, record):
return self.__class__._do_rollover
def getFilesToDelete(self):
"""
Determine the files to delete when rolling over.
"""
dirName, baseName = os.path.split(self.baseFilename)
fileNames = os.listdir(dirName)
result = []
prefix = baseName + "."
plen = len(prefix)
for fileName in fileNames:
if fileName[:plen] == prefix:
suffix = fileName[plen:]
if self.__class__._file_pattern.match(suffix):
result.append(os.path.join(dirName, fileName))
result.sort()
if len(result) < self.backupCount:
result = []
else:
result = result[:len(result) - self.backupCount]
return result
def cleanupFiles(self):
if self.backupCount > 0:
for path in self.getFilesToDelete():
os.remove(path)
def doRollover(self):
self.__class__._do_rollover = False
if self.stream:
self.stream.close()
self.stream = None
if os.path.exists(self.baseFilename):
# figure out creation date/time to use for file suffix
t = time.localtime(os.stat(self.baseFilename).st_mtime)
dfn = self.baseFilename + "." + time.strftime(self.__class__._suffix_template, t)
if os.path.exists(dfn):
os.remove(dfn)
os.rename(self.baseFilename, dfn)
self.cleanupFiles()
if not self.delay:
self.stream = self._open()
+1
View File
@@ -902,6 +902,7 @@ class PluginManager(object):
identifier=name,
plugin_name=plugin.name,
plugin_version=plugin.version,
plugin_info=plugin,
basefolder=os.path.realpath(plugin.location),
logger=logging.getLogger(self.logging_prefix + name),
))
+23 -3
View File
@@ -820,14 +820,17 @@ class SettingsPlugin(OctoPrintPlugin):
to retrieve the data in the correct format.
The default implementation will also replace any paths that have been restricted by your plugin through
:func:`~octoprint.plugin.SettingsPlugin.get_settings_restricted_paths` with ``None`` values where necessary.
:func:`~octoprint.plugin.SettingsPlugin.get_settings_restricted_paths` with either the provided
default value (if one was provided), an empty dictionary (as fallback for restricted dictionaries), an
empty list (as fallback for restricted lists) or ``None`` values where necessary.
Make sure to do your own restriction if you decide to fully overload this method.
:return: the current settings of the plugin, as a dictionary
"""
from flask.ext.login import current_user
import copy
data = self._settings.get_all_data()
data = copy.deepcopy(self._settings.get_all_data(merged=True))
if self.config_version_key in data:
del data[self.config_version_key]
@@ -849,8 +852,25 @@ class SettingsPlugin(OctoPrintPlugin):
node = node[entry]
key = path[-1]
default_value_available = False
default_value = None
if isinstance(key, (list, tuple)):
# key, default_value tuple
key, default_value = key
default_value_available = True
if key in node:
node[key] = None
if default_value_available:
if callable(default_value):
default_value = default_value()
node[key] = default_value
else:
if isinstance(node[key], dict):
node[key] = dict()
elif isinstance(node[key], (list, tuple)):
node[key] = []
else:
node[key] = None
conditions = dict(user=lambda: current_user is not None and not current_user.is_anonymous(),
admin=lambda: current_user is not None and not current_user.is_anonymous() and current_user.is_admin(),
+2 -1
View File
@@ -46,7 +46,8 @@ class CuraPlugin(octoprint.plugin.SlicerPlugin,
def on_startup(self, host, port):
# setup our custom logger
cura_logging_handler = logging.handlers.RotatingFileHandler(self._settings.get_plugin_logfile_path(postfix="engine"), maxBytes=2*1024*1024)
from octoprint.logging.handlers import CleaningTimedRotatingFileHandler
cura_logging_handler = CleaningTimedRotatingFileHandler(self._settings.get_plugin_logfile_path(postfix="engine"), when="D", backupCount=3)
cura_logging_handler.setFormatter(logging.Formatter("%(asctime)s %(message)s"))
cura_logging_handler.setLevel(logging.DEBUG)
@@ -77,7 +77,7 @@
<div class="input-prepend">
<span class="btn fileinput-button">
<span>{{ _('Browse...') }}</span>
<input id="settings-cura-import" type="file" name="file" data-url="{{ url_for("plugin.cura.import_cura_profile") }}">
<input id="settings-cura-import" type="file" name="file" data-url="{{ url_for("plugin.cura.import_cura_profile") }}" accept=".ini">
</span>
<span class="add-on" data-bind="text: fileName"></span>
</div>
@@ -111,10 +111,10 @@
</form>
<small>{% trans %}
You can import your existing profile <code>.ini</code> files from Cura (version up to and
including 15.04) here. Please be aware that neither the <code>.json</code> profile format
from Cura versions starting with 15.06 is supported, nor are the custom Cura profile formats
that third party tools like e.g. Repetier create.
You can import your existing profile <code>.ini</code> files from <strong>Cura 15.04.x or older</strong>
here. Anything but those are <strong>not supported</strong>. That especiallymeans that <code>.json</code>
profiles from Cura 15.06.x and <code>.curaprofile</code> profiles from Cura 2.x will not work, and neither
will custom Cura profile formats that third party tools like e.g. Repetier create.
{% endtrans %}</small>
</div>
<div class="modal-footer">
@@ -65,7 +65,8 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
##~~ StartupPlugin
def on_startup(self, host, port):
console_logging_handler = logging.handlers.RotatingFileHandler(self._settings.get_plugin_logfile_path(postfix="console"), maxBytes=2*1024*1024)
from octoprint.logging.handlers import CleaningTimedRotatingFileHandler
console_logging_handler = CleaningTimedRotatingFileHandler(self._settings.get_plugin_logfile_path(postfix="console"), when="D", backupCount=3)
console_logging_handler.setFormatter(logging.Formatter("%(asctime)s %(message)s"))
console_logging_handler.setLevel(logging.DEBUG)
@@ -35,7 +35,7 @@ def perform_update(target, check, target_version):
update_script = check["update_script"]
update_branch = check.get("update_branch", "")
force_exact_version = check.get("force_exact_version", False)
folder = check.get("update_folder", check["checkout_folder"])
folder = check.get("update_folder", check.get("checkout_folder")) # either should be set, tested above
pre_update_script = check.get("pre_update_script", None)
post_update_script = check.get("post_update_script", None)
@@ -237,10 +237,12 @@ class VirtualPrinter(object):
#print "Send: %s" % (data.rstrip())
if 'M104' in data or 'M109' in data:
self._parseHotendCommand(data)
wait = support_r = 'M109' in data
self._parseHotendCommand(data, wait=wait, support_r=support_r)
if 'M140' in data or 'M190' in data:
self._parseBedCommand(data)
wait = support_r = 'M190' in data
self._parseBedCommand(data, wait=wait, support_r=support_r)
if 'M105' in data:
self._processTemperatureQuery()
@@ -523,7 +525,8 @@ class VirtualPrinter(object):
output = "ok " + output
self._output(output)
def _parseHotendCommand(self, line):
def _parseHotendCommand(self, line, wait=False, support_r=False):
only_wait_if_higher = True
tool = 0
toolMatch = re.search('T([0-9]+)', line)
if toolMatch:
@@ -538,21 +541,32 @@ class VirtualPrinter(object):
try:
self.targetTemp[tool] = float(re.search('S([0-9]+)', line).group(1))
except:
pass
if support_r:
try:
self.targetTemp[tool] = float(re.search('R([0-9]+)', line).group(1))
only_wait_if_higher = False
except:
pass
if "M109" in line:
self._waitForHeatup("tool%d" % tool)
if wait:
self._waitForHeatup("tool%d" % tool, only_wait_if_higher)
if settings().getBoolean(["devel", "virtualPrinter", "repetierStyleTargetTemperature"]):
self._output("TargetExtr%d:%d" % (tool, self.targetTemp[tool]))
def _parseBedCommand(self, line):
def _parseBedCommand(self, line, wait=False, support_r=False):
only_wait_if_higher = True
try:
self.bedTargetTemp = float(re.search('S([0-9]+)', line).group(1))
except:
pass
if support_r:
try:
self.bedTargetTemp = float(re.search('R([0-9]+)', line).group(1))
only_wait_if_higher = False
except:
pass
if "M190" in line:
self._waitForHeatup("bed")
if wait:
self._waitForHeatup("bed", only_wait_if_higher)
if settings().getBoolean(["devel", "virtualPrinter", "repetierStyleTargetTemperature"]):
self._output("TargetBed:%d" % self.bedTargetTemp)
@@ -717,19 +731,19 @@ class VirtualPrinter(object):
self._sdPrinter = None
self._output("Done printing file")
def _waitForHeatup(self, heater):
def _waitForHeatup(self, heater, only_wait_if_higher):
delta = 1
delay = 1
try:
if heater.startswith("tool"):
toolNum = int(heater[len("tool"):])
while not self._killed and (self.temp[toolNum] < self.targetTemp[toolNum] - delta or self.temp[toolNum] > self.targetTemp[toolNum] + delta):
while not self._killed and (self.temp[toolNum] < self.targetTemp[toolNum] - delta or (not only_wait_if_higher and self.temp[toolNum] > self.targetTemp[toolNum] + delta)):
self._simulateTemps(delta=delta)
self._output("T:%0.2f" % self.temp[toolNum])
time.sleep(delay)
elif heater == "bed":
while not self._killed and (self.bedTemp < self.bedTargetTemp - delta or self.bedTemp > self.bedTargetTemp + delta):
while not self._killed and (self.bedTemp < self.bedTargetTemp - delta or (not only_wait_if_higher and self.bedTemp > self.bedTargetTemp + delta)):
self._simulateTemps(delta=delta)
self._output("B:%0.2f" % self.bedTemp)
time.sleep(delay)
+1
View File
@@ -228,6 +228,7 @@ class PrinterProfileManager(object):
if make_default:
settings().set(["printerProfiles", "default"], identifier)
settings().save()
if self._current is not None and self._current["id"] == identifier:
self.select(identifier)
+6 -2
View File
@@ -194,6 +194,10 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
if self._comm is not None:
self._comm.close()
self._printerProfileManager.select(profile)
from octoprint.logging.handlers import SerialLogHandler
SerialLogHandler.on_open_connection()
self._comm = comm.MachineCom(port, baudrate, callbackObject=self, printerProfileManager=self._printerProfileManager)
def disconnect(self):
@@ -288,7 +292,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
def set_temperature(self, heater, value):
if not PrinterInterface.valid_heater_regex.match(heater):
raise ValueError("heater must match \"tool[0-9]+\" or \"bed\": {heater}".format(type=heater))
raise ValueError("heater must match \"tool[0-9]+\" or \"bed\": {heater}".format(heater=heater))
if not isinstance(value, (int, long, float)) or value < 0:
raise ValueError("value must be a valid number >= 0: {value}".format(value=value))
@@ -911,7 +915,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
self._addLog(to_unicode(message, "utf-8", errors="replace"))
def on_comm_temperature_update(self, temp, bedTemp):
self._addTemperatureData(temp, bedTemp)
self._addTemperatureData(copy.deepcopy(temp), copy.deepcopy(bedTemp))
def on_comm_state_change(self, state):
"""
+55 -22
View File
@@ -564,6 +564,9 @@ class Server(object):
"formatters": {
"simple": {
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
},
"serial": {
"format": "%(asctime)s - %(message)s"
}
},
"handlers": {
@@ -574,18 +577,18 @@ class Server(object):
"stream": "ext://sys.stdout"
},
"file": {
"class": "logging.handlers.TimedRotatingFileHandler",
"class": "octoprint.logging.handlers.CleaningTimedRotatingFileHandler",
"level": "DEBUG",
"formatter": "simple",
"when": "D",
"backupCount": "1",
"backupCount": 6,
"filename": os.path.join(settings().getBaseFolder("logs"), "octoprint.log")
},
"serialFile": {
"class": "logging.handlers.RotatingFileHandler",
"class": "octoprint.logging.handlers.SerialLogHandler",
"level": "DEBUG",
"formatter": "simple",
"maxBytes": 2 * 1024 * 1024, # let's limit the serial log to 2MB in size
"formatter": "serial",
"backupCount": 3,
"filename": os.path.join(settings().getBaseFolder("logs"), "serial.log")
}
},
@@ -633,7 +636,6 @@ class Server(object):
if settings().getBoolean(["serial", "log"]):
# enable debug logging to serial.log
logging.getLogger("SERIAL").setLevel(logging.DEBUG)
logging.getLogger("SERIAL").debug("Enabling serial logging")
def _setup_app(self, app):
from octoprint.server.util.flask import ReverseProxiedEnvironment, OctoPrintFlaskRequest, OctoPrintFlaskResponse
@@ -1013,7 +1015,8 @@ class Server(object):
enable_gcodeviewer = settings().getBoolean(["gcodeViewer", "enabled"])
preferred_stylesheet = settings().get(["devel", "stylesheet"])
dynamic_assets = util.flask.collect_plugin_assets(
dynamic_core_assets = util.flask.collect_core_assets(enable_gcodeviewer=enable_gcodeviewer)
dynamic_plugin_assets = util.flask.collect_plugin_assets(
enable_gcodeviewer=enable_gcodeviewer,
preferred_stylesheet=preferred_stylesheet
)
@@ -1049,11 +1052,15 @@ class Server(object):
"js/lib/loglevel.min.js",
"js/lib/sockjs-0.3.4.min.js"
]
js_app = dynamic_assets["js"] + [
"js/app/dataupdater.js",
"js/app/helpers.js",
"js/app/main.js",
]
js_core = dynamic_core_assets["js"] + \
dynamic_plugin_assets["bundled"]["js"] + \
["js/app/dataupdater.js",
"js/app/helpers.js",
"js/app/main.js"]
js_plugins = dynamic_plugin_assets["external"]["js"]
if len(js_plugins) == 0:
js_plugins = ["empty"]
js_app = js_plugins + js_core
css_libs = [
"css/bootstrap.min.css",
@@ -1064,13 +1071,21 @@ class Server(object):
"css/jquery.fileupload-ui.css",
"css/pnotify.min.css"
]
css_app = list(dynamic_assets["css"])
if len(css_app) == 0:
css_app = ["empty"]
css_core = list(dynamic_core_assets["css"]) + list(dynamic_plugin_assets["bundled"]["css"])
if len(css_core) == 0:
css_core = ["empty"]
css_plugins = list(dynamic_plugin_assets["external"]["css"])
if len(css_plugins) == 0:
css_plugins = ["empty"]
css_app = css_core + css_plugins
less_app = list(dynamic_assets["less"])
if len(less_app) == 0:
less_app = ["empty"]
less_core = list(dynamic_core_assets["less"]) + list(dynamic_plugin_assets["bundled"]["less"])
if len(less_core) == 0:
less_core = ["empty"]
less_plugins = list(dynamic_plugin_assets["external"]["less"])
if len(less_plugins) == 0:
less_plugins = ["empty"]
less_app = less_core + less_plugins
from webassets.filter import register_filter, Filter
from webassets.filter.cssrewrite.base import PatternRewriter
@@ -1091,7 +1106,7 @@ class Server(object):
return "{import_with_options}\"{import_url}\";".format(**locals())
class JsDelimiterBundle(Filter):
class JsDelimiterBundler(Filter):
name = "js_delimiter_bundler"
options = {}
def input(self, _in, out, **kwargs):
@@ -1099,24 +1114,42 @@ class Server(object):
out.write("\n;\n")
register_filter(LessImportRewrite)
register_filter(JsDelimiterBundle)
register_filter(JsDelimiterBundler)
# JS
js_libs_bundle = Bundle(*js_libs, output="webassets/packed_libs.js", filters="js_delimiter_bundler")
if settings().getBoolean(["devel", "webassets", "minify"]):
js_core_bundle = Bundle(*js_core, output="webassets/packed_core.js", filters="rjsmin, js_delimiter_bundler")
js_plugins_bundle = Bundle(*js_plugins, output="webassets/packed_plugins.js", filters="rjsmin, js_delimiter_bundler")
js_app_bundle = Bundle(*js_app, output="webassets/packed_app.js", filters="rjsmin, js_delimiter_bundler")
else:
js_core_bundle = Bundle(*js_core, output="webassets/packed_core.js", filters="js_delimiter_bundler")
js_plugins_bundle = Bundle(*js_plugins, output="webassets/packed_plugins.js", filters="js_delimiter_bundler")
js_app_bundle = Bundle(*js_app, output="webassets/packed_app.js", filters="js_delimiter_bundler")
# CSS
css_libs_bundle = Bundle(*css_libs, output="webassets/packed_libs.css")
css_core_bundle = Bundle(*css_core, output="webassets/packed_core.css", filters="cssrewrite")
css_plugins_bundle = Bundle(*css_plugins, output="webassets/packed_plugins.css", filters="cssrewrite")
css_app_bundle = Bundle(*css_app, output="webassets/packed_app.css", filters="cssrewrite")
all_less_bundle = Bundle(*less_app, output="webassets/packed_app.less", filters="cssrewrite, less_importrewrite")
# LESS
less_core_bundle = Bundle(*less_core, output="webassets/packed_core.less", filters="cssrewrite, less_importrewrite")
less_plugins_bundle = Bundle(*less_plugins, output="webassets/packed_plugins.less", filters="cssrewrite, less_importrewrite")
less_app_bundle = Bundle(*less_app, output="webassets/packed_app.less", filters="cssrewrite, less_importrewrite")
# asset registration
assets.register("js_libs", js_libs_bundle)
assets.register("js_core", js_core_bundle)
assets.register("js_plugins", js_plugins_bundle)
assets.register("js_app", js_app_bundle)
assets.register("css_libs", css_libs_bundle)
assets.register("css_core", css_core_bundle)
assets.register("css_plugins", css_plugins_bundle)
assets.register("css_app", css_app_bundle)
assets.register("less_app", all_less_bundle)
assets.register("less_core", less_core_bundle)
assets.register("less_plugins", less_plugins_bundle)
assets.register("less_app", less_app_bundle)
def _start_intermediary_server(self, s):
import BaseHTTPServer
+69 -12
View File
@@ -232,6 +232,15 @@ class ReverseProxiedEnvironment(object):
to_wsgi_format = lambda header: "HTTP_" + header.upper().replace("-", "_")
return map(to_wsgi_format, values)
@staticmethod
def valid_ip(address):
import netaddr
try:
netaddr.IPAddress(address)
return True
except:
return False
def __init__(self,
header_prefix=None,
header_scheme=None,
@@ -286,11 +295,43 @@ class ReverseProxiedEnvironment(object):
if host is None:
return None, None
default_port = "443" if scheme == "https" else "80"
host = host.strip()
if ":" in host:
server, port = host.split(":", 1)
# we might have an ipv6 address here, or a port, or both
if host[0] == "[":
# that looks like an ipv6 address with port, e.g. [fec1::1]:80
address_end = host.find("]")
if address_end == -1:
# no ], that looks like a seriously broken address
return None, None
# extract server ip, skip enclosing [ and ]
server = host[1:address_end]
tail = host[address_end + 1:]
# now check if there's also a port
if len(tail) and tail[0] == ":":
# port included as well
port = tail[1:]
else:
# no port, use default one
port = default_port
elif self.__class__.valid_ip(host):
# ipv6 address without port
server = host
port = default_port
else:
# ipv4 address with port
server, port = host.rsplit(":", 1)
else:
server = host
port = "443" if scheme == "https" else "80"
port = default_port
return server, port
@@ -348,7 +389,12 @@ class ReverseProxiedEnvironment(object):
# default port for scheme, can be skipped
environ["HTTP_HOST"] = environ["SERVER_NAME"]
else:
environ["HTTP_HOST"] = environ["SERVER_NAME"] + ":" + environ["SERVER_PORT"]
server_name_component = environ["SERVER_NAME"]
if ":" in server_name_component and self.__class__.valid_ip(server_name_component):
# this is an ipv6 address, we need to wrap that in [ and ] before appending the port
server_name_component = "[" + server_name_component + "]"
environ["HTTP_HOST"] = server_name_component + ":" + environ["SERVER_PORT"]
# call wrapped app with rewritten environment
return environ
@@ -1134,12 +1180,8 @@ class SettingsCheckUpdater(webassets.updater.BaseUpdater):
cache_value = webassets.utils.hash_func(json.dumps(settings().effective_yaml))
ctx.cache.set(cache_key, cache_value)
##~~ plugin assets collector
def collect_plugin_assets(enable_gcodeviewer=True, preferred_stylesheet="css"):
logger = logging.getLogger(__name__ + ".collect_plugin_assets")
supported_stylesheets = ("css", "less")
##~~ core assets collector
def collect_core_assets(enable_gcodeviewer=True, preferred_stylesheet="css"):
assets = dict(
js=[],
css=[],
@@ -1178,9 +1220,24 @@ def collect_plugin_assets(enable_gcodeviewer=True, preferred_stylesheet="css"):
elif preferred_stylesheet == "css":
assets["css"].append('css/octoprint.css')
return assets
##~~ plugin assets collector
def collect_plugin_assets(enable_gcodeviewer=True, preferred_stylesheet="css"):
logger = logging.getLogger(__name__ + ".collect_plugin_assets")
supported_stylesheets = ("css", "less")
assets = dict(bundled=dict(js=[], css=[], less=[]),
external=dict(js=[], css=[], less=[]))
asset_plugins = octoprint.plugin.plugin_manager().get_implementations(octoprint.plugin.AssetPlugin)
for implementation in asset_plugins:
name = implementation._identifier
is_bundled = implementation._plugin_info.bundled
asset_key = "bundled" if is_bundled else "external"
try:
all_assets = implementation.get_assets()
basefolder = implementation.get_asset_folder()
@@ -1198,13 +1255,13 @@ def collect_plugin_assets(enable_gcodeviewer=True, preferred_stylesheet="css"):
for asset in all_assets["js"]:
if not asset_exists("js", asset):
continue
assets["js"].append('plugin/{name}/{asset}'.format(**locals()))
assets[asset_key]["js"].append('plugin/{name}/{asset}'.format(**locals()))
if preferred_stylesheet in all_assets:
for asset in all_assets[preferred_stylesheet]:
if not asset_exists(preferred_stylesheet, asset):
continue
assets[preferred_stylesheet].append('plugin/{name}/{asset}'.format(**locals()))
assets[asset_key][preferred_stylesheet].append('plugin/{name}/{asset}'.format(**locals()))
else:
for stylesheet in supported_stylesheets:
if not stylesheet in all_assets:
@@ -1213,7 +1270,7 @@ def collect_plugin_assets(enable_gcodeviewer=True, preferred_stylesheet="css"):
for asset in all_assets[stylesheet]:
if not asset_exists(stylesheet, asset):
continue
assets[stylesheet].append('plugin/{name}/{asset}'.format(**locals()))
assets[asset_key][stylesheet].append('plugin/{name}/{asset}'.format(**locals()))
break
return assets
+4 -11
View File
@@ -1,11 +1,4 @@
{% assets "js_libs" %}
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
{% endassets %}
{% assets "js_app" %}
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
{% endassets %}
{% if g.locale %}
<script type="text/javascript" src="{{ url_for('localeJs', locale=g.locale, domain='messages') }}"></script>
{% endif %}
{% assets "js_libs" %}<script type="text/javascript" src="{{ ASSET_URL }}"></script>{% endassets %}
{% assets "js_plugins" %}<script type="text/javascript" src="{{ ASSET_URL }}"></script>{% endassets %}
{% assets "js_core" %}<script type="text/javascript" src="{{ ASSET_URL }}"></script>{% endassets %}
{% if g.locale %}<script type="text/javascript" src="{{ url_for('localeJs', locale=g.locale, domain='messages') }}"></script>{% endif %}
+5 -12
View File
@@ -1,13 +1,6 @@
{% assets "css_libs" %}
<link href="{{ ASSET_URL }}" rel="stylesheet" media="screen">
{% endassets %}
{% assets "css_app" %}
<link href="{{ ASSET_URL }}" rel="stylesheet" media="screen">
{% endassets %}
{% assets "less_app" %}
<link href="{{ ASSET_URL }}" rel="stylesheet/less" type="text/css" media="screen">
{% endassets %}
{% assets "css_libs" %}<link href="{{ ASSET_URL }}" rel="stylesheet" media="screen">{% endassets %}
{% assets "css_core" %}<link href="{{ ASSET_URL }}" rel="stylesheet" media="screen">{% endassets %}
{% assets "css_plugins" %}<link href="{{ ASSET_URL }}" rel="stylesheet" media="screen">{% endassets %}
{% assets "less_core" %}<link href="{{ ASSET_URL }}" rel="stylesheet/less" type="text/css" media="screen">{% endassets %}
{% assets "less_plugins" %}<link href="{{ ASSET_URL }}" rel="stylesheet/less" type="text/css" media="screen">{% endassets %}
<script src="{{ url_for('static', filename='js/lib/less.min.js') }}" type="text/javascript"></script>
+2 -1
View File
@@ -1,4 +1,5 @@
# coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
@@ -735,7 +736,7 @@ class TimelapseRenderJob(object):
command = [
ffmpeg, '-framerate', str(fps), '-loglevel', 'error', '-i', '"{}"'.format(input), '-vcodec', 'mpeg2video',
'-threads', str(threads), '-pix_fmt', 'yuv420p', '-r', str(fps), '-y', '-b', str(bitrate),
'-threads', str(threads), '-pix_fmt', 'yuv420p', '-r', "25", '-y', '-b', str(bitrate),
'-f', 'vob']
filter_string = cls._create_filter_string(hflip=hflip,
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: OctoPrint\n"
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
"POT-Creation-Date: 2016-09-09 11:35+0200\n"
"PO-Revision-Date: 2016-09-09 11:48+0100\n"
"POT-Creation-Date: 2016-11-22 12:42+0100\n"
"PO-Revision-Date: 2016-11-22 12:43+0100\n"
"Last-Translator: Gina Häußge <osd@foosel.net>\n"
"Language: de\n"
"Language-Team: German (http://www.transifex.com/projects/p/octoprint/"
@@ -193,23 +193,22 @@ msgstr "Vorhandene Datei überschreiben"
msgid ""
"\n"
" You can import your existing profile <code>.ini</code> files "
"from Cura (version up to and\n"
" including 15.04) here. Please be aware that neither the <code>."
"json</code> profile format\n"
" from Cura versions starting with 15.06 is supported, nor are the "
"custom Cura profile formats\n"
" that third party tools like e.g. Repetier create.\n"
"from <strong>Cura 15.04.x or older</strong>\n"
" here. Anything but those are <strong>not supported</strong>. "
"That especiallymeans that <code>.json</code>\n"
" profiles from Cura 15.06.x and <code>.curaprofile</code> "
"profiles from Cura 2.x will not work, and neither\n"
" will custom Cura profile formats that third party tools like e."
"g. Repetier create.\n"
" "
msgstr ""
"\n"
" Hier kannst Du Deine existierenden Profildateien (<code>.ini</code>) aus "
"Cura importieren (Versionen bis\n"
" einschließlich 15.04). Bitte beachte, dass weder die <code>.json</code> "
"Profile aus\n"
" Curaversionen ab 15.06 unterstützt werden, noch andere "
"Thirdpartyprofilformate von\n"
" Tools wie z.B. Repetier Host.\n"
" "
"Du kannst hier deine vorhandenen <code>.ini</code> Profildateien von "
"<strong>Cura 15.04.x oder älter</strong> importieren. Andere Profilformate "
"als diese sind <strong>nicht unterstützt</strong>. Das beinhaltet "
"insbesondere, dass <code>.json</code> Profile von Cura 15.06.x und <code>."
"curaprofile</code> Profile von Cura 2.x nicht funktionieren werden, ebenso "
"wenig wie Cura-Profildateien, die von Third-Party-Tools wie z.B. Repetier "
"erstellt wurden."
#: src/octoprint/plugins/cura/templates/cura_settings.jinja2:121
#: src/octoprint/templates/dialogs/settings/accesscontrol.jinja2:80
@@ -227,7 +226,7 @@ msgstr "Abbrechen"
msgid "Confirm"
msgstr "Bestätigen"
#: src/octoprint/plugins/pluginmanager/__init__.py:116
#: src/octoprint/plugins/pluginmanager/__init__.py:117
msgid "Plugin Manager"
msgstr "Pluginmanager"
@@ -754,7 +753,7 @@ msgid "Software Update"
msgstr "Software Update"
#: src/octoprint/plugins/softwareupdate/__init__.py:752
#: src/octoprint/server/views.py:217
#: src/octoprint/server/views.py:220
#: src/octoprint/static/js/app/viewmodels/appearance.js:11
#: src/octoprint/static/js/app/viewmodels/appearance.js:13
#: src/octoprint/static/js/app/viewmodels/appearance.js:18
@@ -1077,108 +1076,108 @@ msgstr ""
msgid "Version cache TTL"
msgstr "TTL des Versionscaches"
#: src/octoprint/server/views.py:125
#: src/octoprint/server/views.py:128
msgid "Plugins"
msgstr "Plugins"
#: src/octoprint/server/views.py:183
#: src/octoprint/server/views.py:186
msgid "Connection"
msgstr "Verbindung"
#: src/octoprint/server/views.py:184
#: src/octoprint/server/views.py:187
#: src/octoprint/templates/sidebar/state.jinja2:1
msgid "State"
msgstr "Status"
#: src/octoprint/server/views.py:185
#: src/octoprint/server/views.py:188
msgid "Files"
msgstr "Dateien"
#: src/octoprint/server/views.py:191
#: src/octoprint/server/views.py:194
msgid "Temperature"
msgstr "Temperatur"
#: src/octoprint/server/views.py:192
#: src/octoprint/server/views.py:195
msgid "Control"
msgstr "Steuerung"
#: src/octoprint/server/views.py:193
#: src/octoprint/server/views.py:196
msgid "Terminal"
msgstr "Terminal"
#: src/octoprint/server/views.py:196
#: src/octoprint/server/views.py:199
msgid "GCode Viewer"
msgstr "GCode Viewer"
#: src/octoprint/server/views.py:198
#: src/octoprint/server/views.py:201
#: src/octoprint/templates/sidebar/state.jinja2:4
msgid "Timelapse"
msgstr "Zeitraffer"
#: src/octoprint/server/views.py:203
#: src/octoprint/server/views.py:206
msgid "Printer"
msgstr "Drucker"
#: src/octoprint/server/views.py:205
#: src/octoprint/server/views.py:208
msgid "Serial Connection"
msgstr "Serielle Verbindung"
#: src/octoprint/server/views.py:206
#: src/octoprint/server/views.py:209
#: src/octoprint/templates/dialogs/settings/printerprofiles.jinja2:1
msgid "Printer Profiles"
msgstr "Druckerprofile"
#: src/octoprint/server/views.py:207
#: src/octoprint/server/views.py:210
msgid "Temperatures"
msgstr "Temperaturen"
#: src/octoprint/server/views.py:208
#: src/octoprint/server/views.py:211
msgid "Terminal Filters"
msgstr "Terminalfilter"
#: src/octoprint/server/views.py:209
#: src/octoprint/server/views.py:212
msgid "GCODE Scripts"
msgstr "GCODE Scripts"
#: src/octoprint/server/views.py:211 src/octoprint/server/views.py:213
#: src/octoprint/server/views.py:214 src/octoprint/server/views.py:216
msgid "Features"
msgstr "Funktionen"
#: src/octoprint/server/views.py:214
#: src/octoprint/server/views.py:217
msgid "Webcam"
msgstr "Webcam"
#: src/octoprint/server/views.py:215
#: src/octoprint/server/views.py:218
msgid "API"
msgstr "API"
#: src/octoprint/server/views.py:219
#: src/octoprint/server/views.py:222
#: src/octoprint/templates/dialogs/settings/folders.jinja2:2
msgid "Folders"
msgstr "Verzeichnisse"
#: src/octoprint/server/views.py:220
#: src/octoprint/server/views.py:223
msgid "Appearance"
msgstr "Aussehen"
#: src/octoprint/server/views.py:221
#: src/octoprint/server/views.py:224
#: src/octoprint/templates/dialogs/settings/logs.jinja2:2
msgid "Logs"
msgstr "Logs"
#: src/octoprint/server/views.py:222
#: src/octoprint/server/views.py:225
msgid "Server"
msgstr "Server"
#: src/octoprint/server/views.py:225
#: src/octoprint/server/views.py:228
msgid "Access Control"
msgstr "Zugangsbeschränkung"
#: src/octoprint/server/views.py:231
#: src/octoprint/server/views.py:234
msgid "Access"
msgstr "Zugriff"
#: src/octoprint/server/views.py:232
#: src/octoprint/server/views.py:235
msgid "Interface"
msgstr "Interface"
@@ -3511,3 +3510,24 @@ msgstr "Ungerenderte Zeitrafferaufnahme löschen"
#: src/octoprint/templates/tabs/timelapse.jinja2:99
msgid "Render timelapse"
msgstr "Zeitrafferaufnahme rendern"
#~ msgid ""
#~ "\n"
#~ " You can import your existing profile <code>.ini</code> files "
#~ "from Cura (version up to and\n"
#~ " including 15.04) here. Please be aware that neither the "
#~ "<code>.json</code> profile format\n"
#~ " from Cura versions starting with 15.06 is supported, nor are "
#~ "the custom Cura profile formats\n"
#~ " that third party tools like e.g. Repetier create.\n"
#~ " "
#~ msgstr ""
#~ "\n"
#~ " Hier kannst Du Deine existierenden Profildateien (<code>.ini</code>) "
#~ "aus Cura importieren (Versionen bis\n"
#~ " einschließlich 15.04). Bitte beachte, dass weder die <code>.json</"
#~ "code> Profile aus\n"
#~ " Curaversionen ab 15.06 unterstützt werden, noch andere "
#~ "Thirdpartyprofilformate von\n"
#~ " Tools wie z.B. Repetier Host.\n"
#~ " "
+2
View File
@@ -1,4 +1,6 @@
# coding=utf-8
from __future__ import absolute_import
"""
This module bundles commonly used utility methods or helper classes that are used in multiple places withing
OctoPrint's source code.
+13 -4
View File
@@ -48,6 +48,7 @@ regex_float = re.compile(regex_float_pattern)
regexes_parameters = dict(
floatP=re.compile("(^|[^A-Za-z])[Pp](?P<value>%s)" % regex_float_pattern),
floatR=re.compile("(^|[^A-Za-z])[Rr](?P<value>%s)" % regex_float_pattern),
floatS=re.compile("(^|[^A-Za-z])[Ss](?P<value>%s)" % regex_float_pattern),
floatZ=re.compile("(^|[^A-Za-z])[Zz](?P<value>%s)" % regex_float_pattern),
intN=re.compile("(^|[^A-Za-z])[Nn](?P<value>%s)" % regex_int_pattern),
@@ -2121,7 +2122,7 @@ class MachineCom(object):
return None, # Don't send bed commands if we don't have a heated bed
_gcode_M190_queuing = _gcode_M140_queuing
def _gcode_M104_sent(self, cmd, cmd_type=None, wait=False):
def _gcode_M104_sent(self, cmd, cmd_type=None, wait=False, support_r=False):
toolNum = self._currentTool
toolMatch = regexes_parameters["intT"].search(cmd)
@@ -2133,6 +2134,9 @@ class MachineCom(object):
self._currentTool = toolNum
match = regexes_parameters["floatS"].search(cmd)
if not match and support_r:
match = regexes_parameters["floatR"].search(cmd)
if match:
try:
target = float(match.group("value"))
@@ -2141,11 +2145,15 @@ class MachineCom(object):
self._temp[toolNum] = (actual, target)
else:
self._temp[toolNum] = (None, target)
self._callback.on_comm_temperature_update(self._temp, self._bedTemp)
except ValueError:
pass
def _gcode_M140_sent(self, cmd, cmd_type=None, wait=False):
def _gcode_M140_sent(self, cmd, cmd_type=None, wait=False, support_r=False):
match = regexes_parameters["floatS"].search(cmd)
if not match and support_r:
match = regexes_parameters["floatR"].search(cmd)
if match:
try:
target = float(match.group("value"))
@@ -2154,6 +2162,7 @@ class MachineCom(object):
self._bedTemp = (actual, target)
else:
self._bedTemp = (None, target)
self._callback.on_comm_temperature_update(self._temp, self._bedTemp)
except ValueError:
pass
@@ -2161,13 +2170,13 @@ class MachineCom(object):
self._heatupWaitStartTime = time.time()
self._long_running_command = True
self._heating = True
self._gcode_M104_sent(cmd, cmd_type, wait=True)
self._gcode_M104_sent(cmd, cmd_type, wait=True, support_r=True)
def _gcode_M190_sent(self, cmd, cmd_type=None):
self._heatupWaitStartTime = time.time()
self._long_running_command = True
self._heating = True
self._gcode_M140_sent(cmd, cmd_type, wait=True)
self._gcode_M140_sent(cmd, cmd_type, wait=True, support_r=True)
def _gcode_M110_sending(self, cmd, cmd_type=None):
newLineNumber = None
+89 -1
View File
@@ -143,7 +143,95 @@ class ReverseProxiedEnvironmentTest(unittest.TestCase):
"HTTP_HOST": "example.com",
"SERVER_NAME": "example.com",
"SERVER_PORT": "80"
})
}),
# host = none, default port -> server & port used for reconstruction (ipv4)
({
"HTTP_HOST": None,
"SERVER_NAME": "127.0.0.1",
"SERVER_PORT": "80"
}, {
"HTTP_HOST": "127.0.0.1",
"SERVER_NAME": "127.0.0.1",
"SERVER_PORT": "80"
}),
# host = none, non standard port -> server & port used for reconstruction (ipv4)
({
"HTTP_HOST": None,
"SERVER_NAME": "127.0.0.1",
"SERVER_PORT": "444"
}, {
"HTTP_HOST": "127.0.0.1:444",
"SERVER_NAME": "127.0.0.1",
"SERVER_PORT": "444"
}),
# host = none, default port -> server & port used for reconstruction (ipv6)
({
"HTTP_HOST": None,
"SERVER_NAME": "fec1::1",
"SERVER_PORT": "80"
}, {
"HTTP_HOST": "fec1::1",
"SERVER_NAME": "fec1::1",
"SERVER_PORT": "80"
}),
# host = none, non standard port -> server & port used for reconstruction (ipv6)
({
"HTTP_HOST": None,
"SERVER_NAME": "fec1::1",
"SERVER_PORT": "444"
}, {
"HTTP_HOST": "[fec1::1]:444",
"SERVER_NAME": "fec1::1",
"SERVER_PORT": "444"
}),
# host set, server and port not, default port -> server & port derived from host (ipv4)
({
"HTTP_HOST": "127.0.0.1",
"SERVER_NAME": None,
"SERVER_PORT": None
}, {
"HTTP_HOST": "127.0.0.1",
"SERVER_NAME": "127.0.0.1",
"SERVER_PORT": "80"
}),
# host set, server and port not, non standard port -> server & port derived from host (ipv4)
({
"HTTP_HOST": "127.0.0.1:444",
"SERVER_NAME": None,
"SERVER_PORT": None
}, {
"HTTP_HOST": "127.0.0.1:444",
"SERVER_NAME": "127.0.0.1",
"SERVER_PORT": "444"
}),
# host set, server and port not, default port -> server & port derived from host (ipv6)
({
"HTTP_HOST": "fec1::1",
"SERVER_NAME": None,
"SERVER_PORT": None
}, {
"HTTP_HOST": "fec1::1",
"SERVER_NAME": "fec1::1",
"SERVER_PORT": "80"
}),
# host set, server and port not, non standard port -> server & port derived from host (ipv6)
({
"HTTP_HOST": "[fec1::1]:444",
"SERVER_NAME": None,
"SERVER_PORT": None
}, {
"HTTP_HOST": "[fec1::1]:444",
"SERVER_NAME": "fec1::1",
"SERVER_PORT": "444"
}),
)
@unpack
def test_stock(self, environ, expected):
Binary file not shown.
+64 -44
View File
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: OctoPrint\n"
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
"POT-Creation-Date: 2016-09-09 11:35+0200\n"
"PO-Revision-Date: 2016-09-09 11:48+0100\n"
"POT-Creation-Date: 2016-11-22 12:42+0100\n"
"PO-Revision-Date: 2016-11-22 12:43+0100\n"
"Last-Translator: Gina Häußge <osd@foosel.net>\n"
"Language: de\n"
"Language-Team: German (http://www.transifex.com/projects/p/octoprint/"
@@ -193,23 +193,22 @@ msgstr "Vorhandene Datei überschreiben"
msgid ""
"\n"
" You can import your existing profile <code>.ini</code> files "
"from Cura (version up to and\n"
" including 15.04) here. Please be aware that neither the <code>."
"json</code> profile format\n"
" from Cura versions starting with 15.06 is supported, nor are the "
"custom Cura profile formats\n"
" that third party tools like e.g. Repetier create.\n"
"from <strong>Cura 15.04.x or older</strong>\n"
" here. Anything but those are <strong>not supported</strong>. "
"That especiallymeans that <code>.json</code>\n"
" profiles from Cura 15.06.x and <code>.curaprofile</code> "
"profiles from Cura 2.x will not work, and neither\n"
" will custom Cura profile formats that third party tools like e."
"g. Repetier create.\n"
" "
msgstr ""
"\n"
" Hier kannst Du Deine existierenden Profildateien (<code>.ini</code>) aus "
"Cura importieren (Versionen bis\n"
" einschließlich 15.04). Bitte beachte, dass weder die <code>.json</code> "
"Profile aus\n"
" Curaversionen ab 15.06 unterstützt werden, noch andere "
"Thirdpartyprofilformate von\n"
" Tools wie z.B. Repetier Host.\n"
" "
"Du kannst hier deine vorhandenen <code>.ini</code> Profildateien von "
"<strong>Cura 15.04.x oder älter</strong> importieren. Andere Profilformate "
"als diese sind <strong>nicht unterstützt</strong>. Das beinhaltet "
"insbesondere, dass <code>.json</code> Profile von Cura 15.06.x und <code>."
"curaprofile</code> Profile von Cura 2.x nicht funktionieren werden, ebenso "
"wenig wie Cura-Profildateien, die von Third-Party-Tools wie z.B. Repetier "
"erstellt wurden."
#: src/octoprint/plugins/cura/templates/cura_settings.jinja2:121
#: src/octoprint/templates/dialogs/settings/accesscontrol.jinja2:80
@@ -227,7 +226,7 @@ msgstr "Abbrechen"
msgid "Confirm"
msgstr "Bestätigen"
#: src/octoprint/plugins/pluginmanager/__init__.py:116
#: src/octoprint/plugins/pluginmanager/__init__.py:117
msgid "Plugin Manager"
msgstr "Pluginmanager"
@@ -754,7 +753,7 @@ msgid "Software Update"
msgstr "Software Update"
#: src/octoprint/plugins/softwareupdate/__init__.py:752
#: src/octoprint/server/views.py:217
#: src/octoprint/server/views.py:220
#: src/octoprint/static/js/app/viewmodels/appearance.js:11
#: src/octoprint/static/js/app/viewmodels/appearance.js:13
#: src/octoprint/static/js/app/viewmodels/appearance.js:18
@@ -1077,108 +1076,108 @@ msgstr ""
msgid "Version cache TTL"
msgstr "TTL des Versionscaches"
#: src/octoprint/server/views.py:125
#: src/octoprint/server/views.py:128
msgid "Plugins"
msgstr "Plugins"
#: src/octoprint/server/views.py:183
#: src/octoprint/server/views.py:186
msgid "Connection"
msgstr "Verbindung"
#: src/octoprint/server/views.py:184
#: src/octoprint/server/views.py:187
#: src/octoprint/templates/sidebar/state.jinja2:1
msgid "State"
msgstr "Status"
#: src/octoprint/server/views.py:185
#: src/octoprint/server/views.py:188
msgid "Files"
msgstr "Dateien"
#: src/octoprint/server/views.py:191
#: src/octoprint/server/views.py:194
msgid "Temperature"
msgstr "Temperatur"
#: src/octoprint/server/views.py:192
#: src/octoprint/server/views.py:195
msgid "Control"
msgstr "Steuerung"
#: src/octoprint/server/views.py:193
#: src/octoprint/server/views.py:196
msgid "Terminal"
msgstr "Terminal"
#: src/octoprint/server/views.py:196
#: src/octoprint/server/views.py:199
msgid "GCode Viewer"
msgstr "GCode Viewer"
#: src/octoprint/server/views.py:198
#: src/octoprint/server/views.py:201
#: src/octoprint/templates/sidebar/state.jinja2:4
msgid "Timelapse"
msgstr "Zeitraffer"
#: src/octoprint/server/views.py:203
#: src/octoprint/server/views.py:206
msgid "Printer"
msgstr "Drucker"
#: src/octoprint/server/views.py:205
#: src/octoprint/server/views.py:208
msgid "Serial Connection"
msgstr "Serielle Verbindung"
#: src/octoprint/server/views.py:206
#: src/octoprint/server/views.py:209
#: src/octoprint/templates/dialogs/settings/printerprofiles.jinja2:1
msgid "Printer Profiles"
msgstr "Druckerprofile"
#: src/octoprint/server/views.py:207
#: src/octoprint/server/views.py:210
msgid "Temperatures"
msgstr "Temperaturen"
#: src/octoprint/server/views.py:208
#: src/octoprint/server/views.py:211
msgid "Terminal Filters"
msgstr "Terminalfilter"
#: src/octoprint/server/views.py:209
#: src/octoprint/server/views.py:212
msgid "GCODE Scripts"
msgstr "GCODE Scripts"
#: src/octoprint/server/views.py:211 src/octoprint/server/views.py:213
#: src/octoprint/server/views.py:214 src/octoprint/server/views.py:216
msgid "Features"
msgstr "Funktionen"
#: src/octoprint/server/views.py:214
#: src/octoprint/server/views.py:217
msgid "Webcam"
msgstr "Webcam"
#: src/octoprint/server/views.py:215
#: src/octoprint/server/views.py:218
msgid "API"
msgstr "API"
#: src/octoprint/server/views.py:219
#: src/octoprint/server/views.py:222
#: src/octoprint/templates/dialogs/settings/folders.jinja2:2
msgid "Folders"
msgstr "Verzeichnisse"
#: src/octoprint/server/views.py:220
#: src/octoprint/server/views.py:223
msgid "Appearance"
msgstr "Aussehen"
#: src/octoprint/server/views.py:221
#: src/octoprint/server/views.py:224
#: src/octoprint/templates/dialogs/settings/logs.jinja2:2
msgid "Logs"
msgstr "Logs"
#: src/octoprint/server/views.py:222
#: src/octoprint/server/views.py:225
msgid "Server"
msgstr "Server"
#: src/octoprint/server/views.py:225
#: src/octoprint/server/views.py:228
msgid "Access Control"
msgstr "Zugangsbeschränkung"
#: src/octoprint/server/views.py:231
#: src/octoprint/server/views.py:234
msgid "Access"
msgstr "Zugriff"
#: src/octoprint/server/views.py:232
#: src/octoprint/server/views.py:235
msgid "Interface"
msgstr "Interface"
@@ -3511,3 +3510,24 @@ msgstr "Ungerenderte Zeitrafferaufnahme löschen"
#: src/octoprint/templates/tabs/timelapse.jinja2:99
msgid "Render timelapse"
msgstr "Zeitrafferaufnahme rendern"
#~ msgid ""
#~ "\n"
#~ " You can import your existing profile <code>.ini</code> files "
#~ "from Cura (version up to and\n"
#~ " including 15.04) here. Please be aware that neither the "
#~ "<code>.json</code> profile format\n"
#~ " from Cura versions starting with 15.06 is supported, nor are "
#~ "the custom Cura profile formats\n"
#~ " that third party tools like e.g. Repetier create.\n"
#~ " "
#~ msgstr ""
#~ "\n"
#~ " Hier kannst Du Deine existierenden Profildateien (<code>.ini</code>) "
#~ "aus Cura importieren (Versionen bis\n"
#~ " einschließlich 15.04). Bitte beachte, dass weder die <code>.json</"
#~ "code> Profile aus\n"
#~ " Curaversionen ab 15.06 unterstützt werden, noch andere "
#~ "Thirdpartyprofilformate von\n"
#~ " Tools wie z.B. Repetier Host.\n"
#~ " "
+36 -35
View File
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: OctoPrint 1.2.16.dev44+ge19ecb0\n"
"Project-Id-Version: OctoPrint 1.2.17.dev41+ga88cd9f\n"
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
"POT-Creation-Date: 2016-09-09 11:35+0200\n"
"POT-Creation-Date: 2016-11-22 12:42+0100\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"
@@ -183,12 +183,13 @@ msgstr ""
msgid ""
"\n"
" You can import your existing profile <code>.ini</code> files "
"from Cura (version up to and\n"
" including 15.04) here. Please be aware that neither the "
"<code>.json</code> profile format\n"
" from Cura versions starting with 15.06 is supported, nor are "
"the custom Cura profile formats\n"
" that third party tools like e.g. Repetier create.\n"
"from <strong>Cura 15.04.x or older</strong>\n"
" here. Anything but those are <strong>not supported</strong>. "
"That especiallymeans that <code>.json</code>\n"
" profiles from Cura 15.06.x and <code>.curaprofile</code> "
"profiles from Cura 2.x will not work, and neither\n"
" will custom Cura profile formats that third party tools like "
"e.g. Repetier create.\n"
" "
msgstr ""
@@ -208,7 +209,7 @@ msgstr ""
msgid "Confirm"
msgstr ""
#: src/octoprint/plugins/pluginmanager/__init__.py:116
#: src/octoprint/plugins/pluginmanager/__init__.py:117
msgid "Plugin Manager"
msgstr ""
@@ -672,7 +673,7 @@ msgid "Software Update"
msgstr ""
#: src/octoprint/plugins/softwareupdate/__init__.py:752
#: src/octoprint/server/views.py:217
#: src/octoprint/server/views.py:220
#: src/octoprint/static/js/app/viewmodels/appearance.js:11
#: src/octoprint/static/js/app/viewmodels/appearance.js:13
#: src/octoprint/static/js/app/viewmodels/appearance.js:18
@@ -947,108 +948,108 @@ msgstr ""
msgid "Version cache TTL"
msgstr ""
#: src/octoprint/server/views.py:125
#: src/octoprint/server/views.py:128
msgid "Plugins"
msgstr ""
#: src/octoprint/server/views.py:183
#: src/octoprint/server/views.py:186
msgid "Connection"
msgstr ""
#: src/octoprint/server/views.py:184
#: src/octoprint/server/views.py:187
#: src/octoprint/templates/sidebar/state.jinja2:1
msgid "State"
msgstr ""
#: src/octoprint/server/views.py:185
#: src/octoprint/server/views.py:188
msgid "Files"
msgstr ""
#: src/octoprint/server/views.py:191
#: src/octoprint/server/views.py:194
msgid "Temperature"
msgstr ""
#: src/octoprint/server/views.py:192
#: src/octoprint/server/views.py:195
msgid "Control"
msgstr ""
#: src/octoprint/server/views.py:193
#: src/octoprint/server/views.py:196
msgid "Terminal"
msgstr ""
#: src/octoprint/server/views.py:196
#: src/octoprint/server/views.py:199
msgid "GCode Viewer"
msgstr ""
#: src/octoprint/server/views.py:198
#: src/octoprint/server/views.py:201
#: src/octoprint/templates/sidebar/state.jinja2:4
msgid "Timelapse"
msgstr ""
#: src/octoprint/server/views.py:203
#: src/octoprint/server/views.py:206
msgid "Printer"
msgstr ""
#: src/octoprint/server/views.py:205
#: src/octoprint/server/views.py:208
msgid "Serial Connection"
msgstr ""
#: src/octoprint/server/views.py:206
#: src/octoprint/server/views.py:209
#: src/octoprint/templates/dialogs/settings/printerprofiles.jinja2:1
msgid "Printer Profiles"
msgstr ""
#: src/octoprint/server/views.py:207
#: src/octoprint/server/views.py:210
msgid "Temperatures"
msgstr ""
#: src/octoprint/server/views.py:208
#: src/octoprint/server/views.py:211
msgid "Terminal Filters"
msgstr ""
#: src/octoprint/server/views.py:209
#: src/octoprint/server/views.py:212
msgid "GCODE Scripts"
msgstr ""
#: src/octoprint/server/views.py:211 src/octoprint/server/views.py:213
#: src/octoprint/server/views.py:214 src/octoprint/server/views.py:216
msgid "Features"
msgstr ""
#: src/octoprint/server/views.py:214
#: src/octoprint/server/views.py:217
msgid "Webcam"
msgstr ""
#: src/octoprint/server/views.py:215
#: src/octoprint/server/views.py:218
msgid "API"
msgstr ""
#: src/octoprint/server/views.py:219
#: src/octoprint/server/views.py:222
#: src/octoprint/templates/dialogs/settings/folders.jinja2:2
msgid "Folders"
msgstr ""
#: src/octoprint/server/views.py:220
#: src/octoprint/server/views.py:223
msgid "Appearance"
msgstr ""
#: src/octoprint/server/views.py:221
#: src/octoprint/server/views.py:224
#: src/octoprint/templates/dialogs/settings/logs.jinja2:2
msgid "Logs"
msgstr ""
#: src/octoprint/server/views.py:222
#: src/octoprint/server/views.py:225
msgid "Server"
msgstr ""
#: src/octoprint/server/views.py:225
#: src/octoprint/server/views.py:228
msgid "Access Control"
msgstr ""
#: src/octoprint/server/views.py:231
#: src/octoprint/server/views.py:234
msgid "Access"
msgstr ""
#: src/octoprint/server/views.py:232
#: src/octoprint/server/views.py:235
msgid "Interface"
msgstr ""