Commit a20c1fe4 authored by Kliment Yanev's avatar Kliment Yanev

POtential fix for wx unicode decode errors

parent d73709ff
...@@ -221,7 +221,7 @@ class printcore(): ...@@ -221,7 +221,7 @@ class printcore():
def send_now(self,command,wait=0): def send_now(self,command,wait=0):
"""Sends a command to the printer ahead of the command queue, without a checksum """Sends a command to the printer ahead of the command queue, without a checksum
""" """
if(self.online): if(self.online or force):
if(self.printing): if(self.printing):
self.priqueue+=[command] self.priqueue+=[command]
else: else:
......
...@@ -74,7 +74,10 @@ class Tee(object): ...@@ -74,7 +74,10 @@ class Tee(object):
def __del__(self): def __del__(self):
sys.stdout = self.stdout sys.stdout = self.stdout
def write(self, data): def write(self, data):
try:
self.target(data) self.target(data)
except:
pass
self.stdout.write(data.encode("utf-8")) self.stdout.write(data.encode("utf-8"))
def flush(self): def flush(self):
self.stdout.flush() self.stdout.flush()
...@@ -1546,7 +1549,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -1546,7 +1549,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
print pronsole.totalelength(self.f), _("mm of filament used in this print\n") print pronsole.totalelength(self.f), _("mm of filament used in this print\n")
print _("the print goes from %f mm to %f mm in X\nand is %f mm wide\n") % (Xmin, Xmax, Xtot) print _("the print goes from %f mm to %f mm in X\nand is %f mm wide\n") % (Xmin, Xmax, Xtot)
if webavail: if webavail:
self.webInterface.AddLog("the print goes from %f mm to %f mm in X\nand is %f mm wide\n") % (Xmin, Xmax, Xtot) self.webInterface.AddLog(_("the print goes from %f mm to %f mm in X\nand is %f mm wide\n") % (Xmin, Xmax, Xtot))
print _("the print goes from %f mm to %f mm in Y\nand is %f mm wide\n") % (Ymin, Ymax, Ytot) print _("the print goes from %f mm to %f mm in Y\nand is %f mm wide\n") % (Ymin, Ymax, Ytot)
print _("the print goes from %f mm to %f mm in Z\nand is %f mm high\n") % (Zmin, Zmax, Ztot) print _("the print goes from %f mm to %f mm in Z\nand is %f mm high\n") % (Zmin, Zmax, Ztot)
print _("Estimated duration (pessimistic): "), pronsole.estimate_duration(self.f) print _("Estimated duration (pessimistic): "), pronsole.estimate_duration(self.f)
......
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