From 1cb6aeab0d86ce79ecbb26ecc705902a0b360b93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Silkeb=C3=A6kken?= Date: Thu, 6 Dec 2012 15:00:44 +0100 Subject: [PATCH] Create renderer property for Powerline class --- powerline/core.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/powerline/core.py b/powerline/core.py index b0c8bd3d..6b7c7d04 100644 --- a/powerline/core.py +++ b/powerline/core.py @@ -8,9 +8,10 @@ class Powerline(object): Segments that aren't filler segments and whose contents aren't None are dropped from the segment array. ''' + self.renderer = None # FIXME This should be assigned here based on the current configuration self.segments = [segment for segment in segments if segment['contents'] is not None or segment['filler']] def render(self, renderer, width=None): - r = renderer(self.segments) + self.renderer = renderer(self.segments) - return r.render(width) + return self.renderer.render(width)