Skip to content

Commit

Permalink
Get rid of out_val variable in Property.export()
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSpen210 committed Dec 23, 2015
1 parent c973a66 commit 3aa534f
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/property_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,25 +606,20 @@ def export(self):
Recursively calls itself for all child properties.
If the Property is marked invalid, it will immediately return.
"""
out_val = '"' + str(self.real_name) + '"'
if isinstance(self.value, list):
if self.name is None:
# If the name is None, we just output the chilren
# without a "Name" { } surround. These Property
# objects represent the root.
yield from (
line
for prop in self.value
for line in prop.export()
)
for prop in self.value:
yield from prop.export()
else:
yield out_val + '\n'
yield '\t{\n'
yield from (
'\t'+line
'\t' + line
for prop in self.value
for line in prop.export()
)
yield '\t}\n'
else:
yield out_val + ' "' + str(self.value) + '"\n'
yield '"' + self.real_name + '" "' + str(self.value) + '"\n'

0 comments on commit 3aa534f

Please sign in to comment.