def __init__(self, app, cb): self.app = app self.text = Text("deploying...") _pile = [ Padding.center_79(self.text), Padding.line_break(""), Padding.center_20(self.buttons()) ] super().__init__(Filler(Pile(_pile), valign="middle"))
def __init__(self, app, cb): self.app = app self.text = Text("deploying...") _pile = [ Padding.center_79(self.text), Padding.line_break(""), Padding.center_20(self.buttons()) ] super().__init__(Filler(Pile(_pile), valign="middle"))
def __init__(self, common, provider, cb): self.common = common self.provider = provider self.text = Text(self.provider.to_yaml()) _pile = [ Padding.center_79(self.text), Padding.line_break(""), Padding.center_20(self.buttons()) ] super().__init__(Filler(Pile(_pile), valign="middle"))
def __init__(self, common, cb): self.common = common self.cb = cb _pile = [ Padding.center_90(Text("Choose a solution to get started:")), Padding.center_90(Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}")), Padding.center_90(self.build_menuable_items()), Padding.line_break(""), Padding.center_20(self.buttons()) ] super().__init__(ListBox(_pile))
def __init__(self, app, steps, cb=None): """ init Arguments: cb: process step callback """ self.app = app self.table = Table() self.cb = cb self.steps_queue = steps for step_model in self.steps_queue: step_widget = self.add_step_widget(step_model) self.table.addColumns( step_model.path, [ ('fixed', 3, step_widget['icon']), step_widget['description'], ] ) # Need to still prompt for the user to submit # even though no questions are asked if len(step_widget['additional_input']) == 0: self.table.addRow( Padding.right_20( Color.button_primary( submit_btn(on_press=self.submit, user_data=(step_model, step_widget)), focus_map='button_primary focus')), False) for i in step_widget['additional_input']: self.table.addRow(Padding.line_break(""), False) self.table.addColumns( step_model.path, [ ('weight', 0.5, Padding.left(i['label'], left=5)), ('weight', 1, Color.string_input( i['input'], focus_map='string_input focus')), ], force=True ) self.table.addRow( Padding.right_20( Color.button_primary( submit_btn( on_press=self.submit, user_data=(step_model, step_widget)), focus_map='button_primary focus')), False) self.table.addRow(Padding.line_break(""), False) self.table.addRow(Padding.center_20( Color.button_primary( done_btn(on_press=self.done, label="View Summary"), focus_map='button_primary focus'))) super().__init__(Padding.center_80(self.table.render()))
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 __init__(self, common, cb): self.common = common self.cb = cb _pile = [ Padding.center_90(Text("Choose a solution to get started:")), Padding.center_90(Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}")), Padding.center_90(self.build_menuable_items()), Padding.line_break(""), Padding.center_20(self.buttons()) ] super().__init__(ListBox(_pile))
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 __init__(self, app, msg, cb): self.app = app self.msg = msg self.cb = cb _pile = [ Padding.center_60(Instruction("LXD Configuration is required")), Padding.center_60(HR()), Padding.center_60(self.build_info()), Padding.line_break(""), Padding.center_20(self.buttons()) ] super().__init__(Filler(Pile(_pile), valign="middle"))
def _build_widget(self): total_items = [Padding.center_60(HR())] for spell in self.spells: total_items.append( Padding.center_60( Color.body(menu_btn(label=spell['name'], on_press=self.submit, user_data=spell), focus_map='menu_button focus'))) total_items.append(Padding.center_60(HR())) total_items.append(Padding.center_20(self._build_buttons())) return Filler(Pile(total_items), valign='top')
def __init__(self, app, cloud, schema, cb): self.app = app self.cloud = cloud self.input_items = schema self.cb = cb _pile = [ Padding.center_60(Instruction( "Enter your {} credentials:".format(self.cloud.upper()))), Padding.center_60(HR()), Padding.center_60(self.build_inputs()), Padding.line_break(""), Padding.center_20(self.buttons()) ] super().__init__(Filler(Pile(_pile), valign="top"))
def _build_widget(self): total_items = [ Padding.center_60(Instruction("Choose a Cloud")), Padding.center_60(HR()) ] for item in self.clouds: total_items.append( Padding.center_60( Color.body(menu_btn(label=item, on_press=self.submit), focus_map='menu_button focus'))) total_items.append(Padding.center_60(HR())) total_items.append(Padding.center_20(self._build_buttons())) return Filler(Pile(total_items), valign='top')
def __init__(self, app, msg, cb): self.app = app self.msg = msg self.cb = cb _pile = [ Padding.center_60(Instruction( "Please configure networking for LXD" )), Padding.center_60(HR()), Padding.center_60(self.build_info()), Padding.line_break(""), Padding.center_20(self.buttons()) ] super().__init__(Filler(Pile(_pile), valign="middle"))
def __init__(self, app, cb): self.app = app self.input_items = NETWORK self.cb = cb _pile = [ # Padding.center_60(Instruction( # "Enter LXD information:")), Padding.center_60( Instruction("Please configure networking for LXD")), Padding.center_60(HR()), Padding.center_60(self.build_info()), Padding.line_break(""), Padding.center_20(self.buttons()) ] super().__init__(Filler(Pile(_pile), valign="middle"))
def _build_widget(self): total_items = [ Padding.center_60(Text(self.title, align="center")), Padding.center_60( Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)) ] for item in self.radio_items.keys(): opt = self.radio_items[item] col = Columns([opt]) total_items.append(Padding.center_60(col)) total_items.append( Padding.center_60( Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1))) total_items.append(Padding.center_20(self._build_buttons())) return Filler(Pile(total_items), valign='middle')
def _build_widget(self): total_items = [ Padding.center_60(Text(self.title, align="center")), Padding.center_60( Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)) ] for item in self.radio_items.keys(): opt = self.radio_items[item] col = Columns([opt]) total_items.append(Padding.center_60(col)) total_items.append( Padding.center_60( Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1))) total_items.append(Padding.center_20(self._build_buttons())) return Filler(Pile(total_items), valign='middle')
def __init__(self, app, steps, cb=None): """ init Arguments: cb: process step callback """ self.app = app self.cb = cb self.steps = steps self.step_pile = Pile( [Padding.center_90(HR()), Padding.line_break("")] + [Padding.center_90(s) for s in self.steps] + [Padding.line_break(""), Padding.center_20(self.buttons())]) super().__init__(Filler(self.step_pile, valign="top"))
def __init__(self, error): body = [ Padding.center_60( Text("Oops, there was a problem with your install:", align="center")), Padding.center_95( Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)), Padding.center_85(Text("Reason:")), Padding.center_80(Color.error_major(Text(error))), Padding.line_break(""), Padding.line_break(""), Padding.center_95( Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)), Padding.center_20(self._build_buttons()) ] super().__init__(Filler(Pile(body), valign="middle"))
def __init__(self, app, cb): self.app = app self.input_items = NETWORK self.cb = cb _pile = [ # Padding.center_60(Instruction( # "Enter LXD information:")), Padding.center_60(Instruction( "Please configure networking for LXD" )), Padding.center_60(HR()), Padding.center_60(self.build_info()), Padding.line_break(""), Padding.center_20(self.buttons()) ] super().__init__(Filler(Pile(_pile), valign="middle"))
def __init__(self, app, steps, cb=None): """ init Arguments: cb: process step callback """ self.app = app self.cb = cb self.steps = steps self.step_pile = Pile( [Padding.center_90(HR()), Padding.line_break("")] + [Padding.center_90(s) for s in self.steps] + [Padding.line_break(""), Padding.center_20(self.buttons())] ) super().__init__(Filler(self.step_pile, valign="top"))
def _build_widget(self): total_items = [ Padding.center_60(HR()) ] for spell in self.spells: total_items.append(Padding.center_60( Color.body( menu_btn(label=spell, on_press=self.submit), focus_map='menu_button focus' ) )) total_items.append( Padding.center_60(HR())) total_items.append(Padding.center_20(self._build_buttons())) return Filler(Pile(total_items), valign='top')
def _build_widget(self): total_items = [ Padding.center_60(Instruction("Choose a Cloud")), Padding.center_60(HR()) ] for item in self.clouds: total_items.append(Padding.center_60( Color.body( menu_btn(label=item, on_press=self.submit), focus_map='menu_button focus' ) )) total_items.append( Padding.center_60(HR())) total_items.append(Padding.center_20(self._build_buttons())) return Filler(Pile(total_items), valign='top')
def buttons(self): self.button = Color.button_primary( done_btn(on_press=self.done, label="View Summary"), focus_map='button_primary focus') return Padding.center_20(self.button)