# Path: conjureup/app_config.py
# class AppConfig:
#     def __setattr__(self, name, value):
#     def _internal_state_key(self):
#     def all_steps(self):
#     def has_bundle_modifications(self):
#     async def save(self):
#     async def restore(self):


from ubuntui.ev import EventLoop
from ubuntui.utils import Color, Padding
from ubuntui.widgets.buttons import menu_btn, quit_btn
from urwid import Columns, Filler, Pile, Text, WidgetWrap
from conjureup.app_config import app
from __future__ import unicode_literals




class VariantView(WidgetWrap):

    def __init__(self, cb):
        self.cb = cb
        self.fname_id_map = {}
        self.current_focus = 2
        _pile = [
            Padding.line_break(""),
            Padding.center_90(self.build_menuable_items()),
            Padding.line_break(""),
            Padding.center_20(self.buttons())
        ]
        super().__init__(Filler(Pile(_pile), valign="top"))

    def _swap_focus(self):
        if self._w.body.focus_position == 2:
            self._w.body.focus_position = 4
        else:
            self._w.body.focus_position = 2

    def keypress(self, size, key):
        if key in ['tab', 'shift tab']:
            self._swap_focus()
        return super().keypress(size, key)


# Path: conjureup/app_config.py
# class AppConfig:
#     def __setattr__(self, name, value):
#     def _internal_state_key(self):
#     def all_steps(self):
#     def has_bundle_modifications(self):
#     async def save(self):
#     async def restore(self):


# Path: conjureup/ui/views/variant.py
from ubuntui.ev import EventLoop
from ubuntui.utils import Color, Padding
from ubuntui.widgets.buttons import menu_btn, quit_btn
from urwid import Columns, Filler, Pile, Text, WidgetWrap
from conjureup.app_config import app

from __future__ import unicode_literals




class VariantView(WidgetWrap):

    def __init__(self, cb):
        self.cb = cb
        self.fname_id_map = {}
        self.current_focus = 2
        _pile = [
            Padding.line_break(""),
            Padding.center_90(self.build_menuable_items()),
            Padding.line_break(""),
            Padding.center_20(self.buttons())
        ]
        super().__init__(Filler(Pile(_pile), valign="top"))

    def _swap_focus(self):
        if self._w.body.focus_position == 2:
            self._w.body.focus_position = 4
        else:
            self._w.body.focus_position = 2

    def keypress(self, size, key):
        if key in ['tab', 'shift tab']:
            self._swap_focus()
        return super().keypress(size, key)


    def buttons(self):