fix metadata tag removal bug

Signed-off-by: Mattias Andrée <maandree@operamail.com>
This commit is contained in:
Mattias Andrée 2012-11-14 18:39:15 +01:00
parent c53bf606b3
commit eea422233e

View file

@ -763,6 +763,8 @@ class PonysayTool():
keys = [key for key in data] keys = [key for key in data]
keys.sort() keys.sort()
for key in keys: for key in keys:
if self.data[key] is None:
continue
if (key == 'comment') or (len(self.data[key].strip()) == 0): if (key == 'comment') or (len(self.data[key].strip()) == 0):
continue continue
values = self.data[key].strip() values = self.data[key].strip()
@ -949,6 +951,8 @@ class TextArea: # TODO support small screens
current = leftlines[row] current = leftlines[row]
if len(datalines[row].strip()) == 0: if len(datalines[row].strip()) == 0:
if current is not 'comment': if current is not 'comment':
if current != last:
self.datamap[current] = None
continue continue
if current == last: if current == last:
self.datamap[current] += '\n' + datalines[row] self.datamap[current] += '\n' + datalines[row]