Commit dbf3e7f0 authored by Kliment's avatar Kliment

Close gcode file explicitly after reading

parent df051e60
......@@ -942,7 +942,9 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
fn=self.filename
try:
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:
wx.CallAfter(self.printbtn.Enable)
......@@ -992,8 +994,10 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if name.lower().endswith(".stl"):
self.skein(name)
else:
self.f=[i.replace("\n","").replace("\r","") for i in open(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),))
wx.CallAfter(self.printbtn.SetLabel, "Print")
wx.CallAfter(self.pausebtn.SetLabel, "Pause")
......
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