Close gcode file explicitly after reading
parent
df051e600f
commit
dbf3e7f0a2
|
@ -942,7 +942,9 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
|
||||||
fn=self.filename
|
fn=self.filename
|
||||||
try:
|
try:
|
||||||
self.filename=self.filename.replace(".stl","_export.gcode").replace(".STL","_export.gcode")
|
self.filename=self.filename.replace(".stl","_export.gcode").replace(".STL","_export.gcode")
|
||||||
self.f=[i.replace("\n","").replace("\r","") for i in open(self.filename)]
|
of=open(self.filename)
|
||||||
|
self.f=[i.replace("\n","").replace("\r","") for i in of]
|
||||||
|
of.close
|
||||||
if self.p.online:
|
if self.p.online:
|
||||||
wx.CallAfter(self.printbtn.Enable)
|
wx.CallAfter(self.printbtn.Enable)
|
||||||
|
|
||||||
|
@ -992,8 +994,10 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
|
||||||
if name.lower().endswith(".stl"):
|
if name.lower().endswith(".stl"):
|
||||||
self.skein(name)
|
self.skein(name)
|
||||||
else:
|
else:
|
||||||
self.f=[i.replace("\n","").replace("\r","") for i in open(name)]
|
|
||||||
self.filename=name
|
self.filename=name
|
||||||
|
of=open(self.filename)
|
||||||
|
self.f=[i.replace("\n","").replace("\r","") for i in of]
|
||||||
|
of.close
|
||||||
self.status.SetStatusText("Loaded "+name+", %d lines"%(len(self.f),))
|
self.status.SetStatusText("Loaded "+name+", %d lines"%(len(self.f),))
|
||||||
wx.CallAfter(self.printbtn.SetLabel, "Print")
|
wx.CallAfter(self.printbtn.SetLabel, "Print")
|
||||||
wx.CallAfter(self.pausebtn.SetLabel, "Pause")
|
wx.CallAfter(self.pausebtn.SetLabel, "Pause")
|
||||||
|
|
Loading…
Reference in New Issue