Commit 1289d3c2 authored by Guillaume Seguin's avatar Guillaume Seguin

Pythonic file handling in stlplater.export_to

parent c3799528
......@@ -314,7 +314,7 @@ class StlPlater(Plater):
self.s.drawmodel(model, 2)
def export_to(self, name):
sf = open(name.replace(".", "_") + ".scad", "w")
with open(name.replace(".", "_") + ".scad", "w") as sf:
facets = []
for model in self.models.values():
r = model.rot
......@@ -335,7 +335,6 @@ class StlPlater(Plater):
if any(o):
model = model.translate(o)
facets += model.facets
sf.close()
stltool.emitstl(name, facets, "plater_export")
print _("Wrote plate to %s") % name
......
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