Commit bdc2f9b1 authored by Guillaume Seguin's avatar Guillaume Seguin

Move parse_temperature_report to printrun_utils

parent 14cec4bc
......@@ -175,3 +175,8 @@ def hexcolor_to_float(color, components):
div = 16 ** ndigits - 1
return tuple(round(float(int(color[i:i + ndigits], 16)) / div, 2)
for i in range(0, numel, ndigits))
tempreport_exp = re.compile("([TB]\d*):([-+]?\d*\.?\d*)(?: ?\/)?([-+]?\d*\.?\d*)")
def parse_temperature_report(report):
matches = tempreport_exp.findall(report)
return dict((m[0], (m[1], m[2])) for m in matches)
......@@ -35,7 +35,7 @@ from . import pronsole
from . import printcore
from printrun.printrun_utils import install_locale, setup_logging, \
hexcolor_to_float
hexcolor_to_float, parse_temperature_report
install_locale('pronterface')
try:
......@@ -59,13 +59,8 @@ from printrun.excluder import Excluder
from pronsole import dosify, wxSetting, HiddenSetting, StringSetting, SpinSetting, FloatSpinSetting, BooleanSetting, StaticTextSetting
from printrun import gcoder
tempreport_exp = re.compile("([TB]\d*):([-+]?\d*\.?\d*)(?: ?\/)?([-+]?\d*\.?\d*)")
tempreading_exp = re.compile("(^T:| T:)")
def parse_temperature_report(report):
matches = tempreport_exp.findall(report)
return dict((m[0], (m[1], m[2])) for m in matches)
class Tee(object):
def __init__(self, target):
self.stdout = sys.stdout
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment