8c0f25c2623b — Alain Leufroy 2 years ago
widget: coding-style
1 files changed, 2 insertions(+), 4 deletions(-)

M lairucrem/widgets/mainwidget.py
M lairucrem/widgets/mainwidget.py +2 -4
@@ 147,6 147,7 @@ class packer(delegate_to_widget_mixin('_
 
     def _update_container(self):
         """update the main container depending on the given size"""
+        assert self._orientation
         if self._orientation == 'horizontal':
             self._original_widget = urwid.Columns(self._widgets)
         elif self._orientation == 'vertical':

          
@@ 155,10 156,7 @@ class packer(delegate_to_widget_mixin('_
 
     def _guess_orientation(self, size):
         cols = size[0]
-        if cols > 160:
-            self._orientation = 'horizontal'
-        elif cols < 160:
-            self._orientation = 'vertical'
+        self._orientation = 'horizontal' if cols > 160 else 'vertical'
 
     def keypress(self, size, key):
         """Process pressed key"""