# 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/widgets/selectors.py
# class MenuSelectButtonList(SelectList):
#     option_type = ValuedMenuSelectButton
#     wrapable = True
# 
#     def __init__(self, opts=None, default=None, *args, **kwargs):
#         super().__init__(opts, *args, **kwargs)
#         if default:
#             self.select_item_by_value(default)
#         else:
#             self.select_first()


from ubuntui.utils import Padding
from ubuntui.widgets.hr import HR
from conjureup.app_config import app
from conjureup.ui.views.base import BaseView, SchemaFormView
from conjureup.ui.widgets.selectors import MenuSelectButtonList



class NewCredentialView(SchemaFormView):
    title = "New Credential Creation"

    def __init__(self, *args, **kwargs):
        cloud_type = app.provider.cloud_type.upper()
        self.subtitle = "Enter your {} credentials".format(cloud_type)
        super().__init__(*args, **kwargs)


class CredentialPickerView(BaseView):
    title = "Choose a Credential"
    subtitle = "Please select an existing credential, " \
               "or choose to add a new one."
    footer = 'Please press [ENTER] on highlighted credential to proceed.'

    def __init__(self, credentials, default, submit_cb, back_cb):
        self.credentials = credentials
        self.default = default

# 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/widgets/selectors.py
# class MenuSelectButtonList(SelectList):
#     option_type = ValuedMenuSelectButton
#     wrapable = True
# 
#     def __init__(self, opts=None, default=None, *args, **kwargs):
#         super().__init__(opts, *args, **kwargs)
#         if default:
#             self.select_item_by_value(default)
#         else:
#             self.select_first()


# Path: conjureup/ui/views/credentials.py
from ubuntui.utils import Padding
from ubuntui.widgets.hr import HR
from conjureup.app_config import app
from conjureup.ui.views.base import BaseView, SchemaFormView
from conjureup.ui.widgets.selectors import MenuSelectButtonList




class NewCredentialView(SchemaFormView):
    title = "New Credential Creation"

    def __init__(self, *args, **kwargs):
        cloud_type = app.provider.cloud_type.upper()
        self.subtitle = "Enter your {} credentials".format(cloud_type)
        super().__init__(*args, **kwargs)


class CredentialPickerView(BaseView):
    title = "Choose a Credential"
    subtitle = "Please select an existing credential, " \
               "or choose to add a new one."
    footer = 'Please press [ENTER] on highlighted credential to proceed.'

    def __init__(self, credentials, default, submit_cb, back_cb):
        self.credentials = credentials
        self.default = default

        self.submit_cb = submit_cb