Retain whitespace when importing notes. Bug #2357

svn: r11023
This commit is contained in:
Gary Burton 2008-09-05 19:33:48 +00:00
parent 5392e83761
commit 83edeb4a62

View File

@ -362,15 +362,18 @@ class Reader:
def __readahead(self): def __readahead(self):
while len(self.current_list) < 5: while len(self.current_list) < 5:
line = self.ifile.readline() linetmp = self.ifile.readline()
self.index += 1 self.index += 1
if not line: if not linetmp:
self.eof = True self.eof = True
return return
try: try:
# the space ensures no trailing whitespace on last parm # the space ensures no trailing whitespace on last parm
line = line.strip(' \n\r').split(None, 2) + [''] line = linetmp.strip(' \n\r').split(None, 2) + ['']
# however keep trailing whitespace on notes only
if line[1] in ['CONT', 'CONC'] or line[2].startswith('NOTE'):
line = linetmp.strip('\n\r').split(None, 2) + ['']
level = int(line[0]) level = int(line[0])
except: except:
continue continue