Merge branch 'experimental' of git://github.com/kliment/Printrun into split-gui

master
Guillaume Seguin 2012-09-06 18:07:08 +02:00
commit 7301d7e847
1 changed files with 4 additions and 1 deletions

View File

@ -49,7 +49,10 @@ def dosify(name):
return os.path.split(name)[1].split(".")[0][:8]+".g"
def parse_temperature_report(report, key):
return float(filter(lambda x: x.startswith(key), report.split())[0].split(":")[1].split("/")[0])
if key in report:
return float(filter(lambda x: x.startswith(key), report.split())[0].split(":")[1].split("/")[0])
else:
return -1.0
def format_time(timestamp):
return datetime.datetime.fromtimestamp(timestamp).strftime("%H:%M:%S")