1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 06:46:15 +01:00

compact empty lines

This commit is contained in:
Ludwig Nussel 2010-06-23 13:58:53 +02:00
parent da0ccd5d8c
commit 4187a18de7

View File

@ -317,15 +317,20 @@ class OscConfigParser(ConfigParser.SafeConfigParser):
# XXX: simplify!
def __str__(self):
ret = []
first = True
for line in self._sections._lines:
if line.type == 'section':
if first:
first = False
else:
ret.append('')
ret.append('[%s]' % line.name)
for sline in line._lines:
if sline.name == '__name__':
continue
if sline.type == 'option':
ret.append(sline.frmt % (sline.name, sline.value))
else:
elif str(sline) != '':
ret.append(str(sline))
else:
ret.append(str(line))