Mercurial > libervia-backend
diff sat_frontends/primitivus/widget.py @ 2624:56f94936df1e
code style reformatting using black
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 27 Jun 2018 20:14:46 +0200 |
parents | 26edcf3a30eb |
children | 003b8b4b56a7 |
line wrap: on
line diff
--- a/sat_frontends/primitivus/widget.py Wed Jun 27 07:51:29 2018 +0200 +++ b/sat_frontends/primitivus/widget.py Wed Jun 27 20:14:46 2018 +0200 @@ -18,6 +18,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. from sat.core import log as logging + log = logging.getLogger(__name__) import urwid from urwid_satext import sat_widgets @@ -27,7 +28,7 @@ class PrimitivusWidget(urwid.WidgetWrap): """Base widget for Primitivus""" - def __init__(self, w, title=''): + def __init__(self, w, title=""): self._title = title self._title_dynamic = None self._original_widget = w @@ -57,9 +58,9 @@ title_elts.append(self._title) if self._title_dynamic: title_elts.append(self._title_dynamic) - if len(all_profiles)>1 and profiles: - title_elts.append(u'[{}]'.format(u', '.join(profiles))) - return sat_widgets.SurroundedText(u' '.join(title_elts)) + if len(all_profiles) > 1 and profiles: + title_elts.append(u"[{}]".format(u", ".join(profiles))) + return sat_widgets.SurroundedText(u" ".join(title_elts)) @title.setter def title(self, value): @@ -83,9 +84,8 @@ """True if the decoration is visible""" return isinstance(self._w, sat_widgets.LabelLine) - def keypress(self, size, key): - if key == a_key['DECORATION_HIDE']: #user wants to (un)hide widget decoration + if key == a_key["DECORATION_HIDE"]: # user wants to (un)hide widget decoration show = not self.decorationVisible self.showDecoration(show) else: @@ -96,7 +96,9 @@ def showDecoration(self, show=True): """Show/Hide the decoration around the window""" - self._w = self._getDecoration(self._original_widget) if show else self._original_widget + self._w = ( + self._getDecoration(self._original_widget) if show else self._original_widget + ) def getMenu(self): raise NotImplementedError