Change to make strip() in EvTable more specific for fixing align

This commit is contained in:
Tehom 2016-11-03 14:03:22 -04:00
parent 4d3ea8df07
commit b3d432e0c6

View file

@ -575,9 +575,9 @@ class EvCell(object):
hfill_char = self.hfill_char
width = self.width
if align == "l":
return [(line.lstrip() if line.startswith(" ") and not line.startswith(" ") else line) + hfill_char * (width - m_len(line)) for line in data]
return [(line.lstrip(" ") if line.startswith(" ") and not line.startswith(" ") else line) + hfill_char * (width - m_len(line)) for line in data]
elif align == "r":
return [hfill_char * (width - m_len(line)) + (line.rstrip() if line.endswith(" ") and not line.endswith(" ") else line) for line in data]
return [hfill_char * (width - m_len(line)) + (line.rstrip(" ") if line.endswith(" ") and not line.endswith(" ") else line) for line in data]
else: # center, 'c'
return [self._center(line, self.width, self.hfill_char) for line in data]