From beff99888bf1b25f2595238f38bbef80c3d39992 Mon Sep 17 00:00:00 2001 From: me Date: Fri, 31 Jan 2020 12:11:51 +0200 Subject: [PATCH] extract add_suffix() method --- bumblebee/output.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bumblebee/output.py b/bumblebee/output.py index 89a0fd1..4f8fc6b 100644 --- a/bumblebee/output.py +++ b/bumblebee/output.py @@ -367,6 +367,13 @@ class WidgetDrawer(object): if self._prefix: self._full_text = u"{}{}".format(self._prefix, self._full_text) + def add_suffix(self, widget, padding): + """add suffix to full_text""" + self._suffix = self._theme.suffix(widget, padding) + + if self._suffix: + self._full_text = u"{}{}".format(self._full_text, self._suffix) + def draw(self, widget, module=None, engine=None): """ Keep the same argument signature as I3BarOutput.draw() @@ -392,10 +399,7 @@ class WidgetDrawer(object): self.add_prefix(widget, padding) - self._suffix = self._theme.suffix(widget, padding) - - if self._suffix: - self._full_text = u"{}{}".format(self._full_text, self._suffix) + self.add_suffix(widget, padding) width = self._theme.minwidth(widget)