Fixed file close for source code text

This commit is contained in:
leyghisbb 2020-08-30 11:17:54 +02:00
parent 7b5e689728
commit b7d3235e80

View File

@ -27,9 +27,8 @@ class MyEffect(inkex.Effect):
for path in matched_files:
file = open(path)
for word in file.read().split():
file.close()
yield word
file.close()
def add_text(self, node):
#Add the text to the node
word_generator = self.text_generation()
@ -69,4 +68,4 @@ class MyEffect(inkex.Effect):
rect=etree.SubElement(flowRegion,inkex.addNS('rect','svg'),rattribs)
self.add_text(flowRoot)
MyEffect().run()
MyEffect().run()