@@ 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"""