more pythonic way
This commit is contained in:
parent
bdfd3974d5
commit
54bccbe084
|
@ -172,9 +172,8 @@ class Material():
|
||||||
self.data[part][name_section][items[0]] = items[1:]
|
self.data[part][name_section][items[0]] = items[1:]
|
||||||
|
|
||||||
def read(self,file=None):
|
def read(self,file=None):
|
||||||
f=open(file,'r')
|
with open(file,'r') as f:
|
||||||
c=f.readlines()
|
c=f.readlines()
|
||||||
f.close()
|
|
||||||
for p in self.parts:
|
for p in self.parts:
|
||||||
self.parse_data(part=p, content=c)
|
self.parse_data(part=p, content=c)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue