Ignore empty segments that aren't filler segments

This commit is contained in:
Kim Silkebækken 2012-11-16 12:49:54 +01:00
parent 2ea555b2dd
commit cbf8d16ed8
1 changed files with 4 additions and 1 deletions

View File

@ -15,8 +15,11 @@ class Powerline:
def __init__(self, segments):
'''Create a new Powerline.
Segments that have empty contents and aren't filler segments are
dropped from the segment array.
'''
self.segments = segments
self.segments = [segment for segment in segments if segment.contents or segment.filler]
def render(self, renderer, width=None):
'''Render all the segments with the specified renderer.