def init_widget(): banner = urwid.BigText(markup=("programpresentation", "Windows Exploder"), font=urwid.HalfBlock5x4Font()) banner = urwid.Padding(w=banner, align="center", width="clip") signature = urwid.Text(markup=("programpresentation", "V.0.1 by Olav Fønstelien"), align="center") divider = [urwid.Divider()] * 5 return urwid.SimpleListWalker(divider + [banner, signature])
def build(self): bt = urwid.BigText("Test Case Manager", urwid.HalfBlock5x4Font()) bt = urwid.Padding(bt, "center", None) # Primary functions menulist = [ widgets.MenuItemWidget("Run Test Code", self.do_run), widgets.MenuItemWidget("Run Test Job", self.do_job), ] pmenu = urwid.GridFlow(menulist, 20, 2, 1, "left") # heading blurb subhead = urwid.AttrMap(urwid.Text("Choose your desired activity."), "subhead") divider = urwid.Divider(u"-", top=1, bottom=1) formlist = [bt, divider, subhead, pmenu] listbox = urwid.ListBox(urwid.SimpleListWalker(formlist)) return urwid.Frame(listbox)
def __init__(self, parent): self.parent = parent help_commands = [ ('F1 or H', 'Display Help'), ('F2', 'Decrease refresh time'), ('F3', 'Increase refresh time'), ('F4 or P', 'Pause'), ('F5 or R', 'Refresh screen'), ('F6 or Enter or +/-', 'Fold/Unfold'), ('F7 or D', 'Display task detail'), ('F8 or C', 'Cancel task'), ('F10 or Q', 'Quit program') ] items = [ urwid.Padding(urwid.BigText('EsTop', urwid.HalfBlock5x4Font()), width='clip'), urwid.Divider('-'), urwid.Text('A Task manager for Elasticsearch'), urwid.Divider('-'), ] for key, desc in help_commands: item = urwid.Columns( [ (20, urwid.Text(key)), urwid.Text(desc) ] ) items.append(urwid.AttrMap(item, None, 'reveal focus')) listbox = urwid.ListBox(urwid.SimpleListWalker(items)) self.txt_footer = urwid.Text( [ 'Press ', ('key', 'Enter'), ' to close', ] ) self.frm_main = urwid.Frame( listbox, footer=urwid.AttrWrap(self.txt_footer, 'footer') ) self.__super.__init__(urwid.LineBox(self.frm_main, title='Help'))
def __init__(self, label, on_press=None): w = CBigText(label, urwid.HalfBlock5x4Font()) self._label = w w = urwid.AttrMap(w, None, 'focus') self.__amap = w w = urwid.Padding(w, align='center', width='clip') w = urwid.Filler(w, valign='middle', bottom=1) w = urwid.BoxAdapter(w, height=5) urwid.WidgetWrap.__init__(self, w) if on_press: urwid.connect_signal(self, 'click', on_press) self.set_label(label) self.__loop = None urwid.connect_signal(self, 'click', self.blink_start)
def make_intro_display(self): bigtext = urwid.BigText("Config", urwid.HalfBlock5x4Font()) bigtext = urwid.Padding(bigtext, "center", None) text = urwid.Text('Customize how you want to organize your files') goto_main = urwid.Button(u'Customize') urwid.connect_signal(goto_main, 'click', self.main_display) exit = urwid.Button(u'Exit') urwid.connect_signal(exit, 'click', self.exit) body = [bigtext, urwid.Text(u'\n'), text, urwid.AttrMap(goto_main, None, focus_map='save'), urwid.AttrMap(exit, None, focus_map='selected')] self.top = urwid.ListBox(urwid.SimpleFocusListWalker(body)) self.main_widget = urwid.Padding(self.top, left=0, right=0) self.intro_display = self.main_widget.original_widget
def __init__(self): output = urwid.BigText('', urwid.HalfBlock5x4Font()) self.output = output top_row = urwid.Padding(output, align='right', width='clip') top_row = urwid.AttrMap(top_row, 'output') top_row = urwid.Filler(top_row, top=1) top_row = urwid.BoxAdapter(top_row, height=5) _btn = lambda btn: CButton(btn, on_press=self.button_keypress) _row = lambda btn: _btn(btn) if btn != '---' else urwid.Text('') rows = [urwid.Columns(map(_row, row)) for row in LAYOUT] self.buttons = [ btn for row in rows for cols in row.contents for btn in cols if isinstance(btn, CButton) ] self.buttons_map = dict((btn.get_label(), btn) for btn in self.buttons) self.widget = urwid.Filler(urwid.Pile([top_row] + rows)) self.reset(reset_c=True, reset=True, reset_p=True) self.update_output()
def build(self): """ Composes child views and components into a single object to be rendered. Parameters ---------- None Returns ------- None Raises ------ None """ self.bigtext = urwid.BigText("", urwid.HalfBlock5x4Font()) bt = urwid.Padding(self.bigtext, 'center', None) self.attribute = urwid.AttrWrap(bt, 'bigtextgood') bt = urwid.Filler(self.attribute, 'bottom', None, 7) bt = urwid.BoxAdapter(urwid.LineBox(bt, "Error Rate"), 7) return bt
def build(self): """ Creates the subwidgets of the component and stiches them together for the final render. Parameters ---------- None Returns ------- None Raises ------ None """ self.bigtext = urwid.BigText("", urwid.HalfBlock5x4Font()) bt = urwid.Padding(self.bigtext, 'center', None) self.attribute = urwid.AttrWrap(bt, 'bigtextgood') bt = urwid.Filler(self.attribute, 'bottom', None, 7) bt = urwid.BoxAdapter(urwid.LineBox(bt, "Running Time (s)"), 7) return bt
def display_errors(self, errors, folder=False): body = [] big_text = urwid.BigText("Error!", urwid.HalfBlock5x4Font()) big_text = urwid.Padding(big_text, 'center', None) body.append(big_text) body.append(urwid.Text(u'\n')) for error in errors: the_error = urwid.Text(('error', error)) body.append(the_error) body.append(urwid.Text(u'\n\n')) go_back = urwid.Button(u'Go Back') if folder: urwid.connect_signal(go_back, 'click', self.back_to_main_display) else: urwid.connect_signal(go_back, 'click', self.back_to_new_extension_display) body.append(urwid.AttrMap(go_back, None, focus_map='selected')) self.main_widget.original_widget = urwid.ListBox( urwid.SimpleListWalker(body))
def showbig(text, font=urwid.HalfBlock5x4Font()): bt = urwid.ShowBig(text, font) pd = urwid.Padding(bt, width="clip") show_widget(pd)
################################################################################################################ ################################################################################################################ SLIDES = [ Slide("Titulo",urwid.AttrMap(urwid.Filler(urwid.AttrMap(urwid.Text(('banner', u" Suite Postdigital "), align='center'), 'streak')), 'bg')), Slide("Titulo2",urwid.AttrMap(urwid.Filler(urwid.AttrMap(urwid.Text(('banner', u" Suite Postdigital \n"), align='center'), 'streak')), 'bg')), Slide("Titulo3",urwid.AttrMap(urwid.Filler(urwid.AttrMap(urwid.Text(('banner', u" Suite Postdigital \n \n "), align='center'), 'streak')), 'bg')), Slide("Titulo4",urwid.AttrMap(urwid.Filler(urwid.AttrMap(urwid.Text(('banner', u" Suite Postdigital \n \n o cómo post-componer música"), align='center'), 'streak')), 'bg')), Slide("Titulo5",urwid.AttrMap(urwid.Filler(urwid.AttrMap(urwid.Text(('banner', u" Suite Postdigital \n \n o cómo post-componer música \n después de Spotify"), align='center'), 'streak')), 'bg')), Slide("Titulo6",urwid.AttrMap(urwid.Filler(urwid.AttrMap(urwid.Text(('banner', u" Suite Postdigital \n \n o cómo post-componer música \n después de Spotify \n"), align='center'), 'streak')), 'bg')), Slide("Titulo7",urwid.AttrMap(urwid.Filler(urwid.AttrMap(urwid.Text(('banner', u" Suite Postdigital \n \n o cómo post-componer música \n después de Spotify \n \n"), align='center'), 'streak')), 'bg')), Slide("Titulo8",urwid.AttrMap(urwid.Filler(urwid.AttrMap(urwid.Text(('banner', u" Suite Postdigital \n \n o cómo post-componer música \n después de Spotify \n \n por"), align='center'), 'streak')), 'bg')), Slide("Titulo9",urwid.AttrMap(urwid.Filler(urwid.AttrMap(urwid.Text(('banner', u" Suite Postdigital \n \n o cómo post-componer música \n después de Spotify \n \n por \n"), align='center'), 'streak')), 'bg')), Slide("Titulo10",urwid.AttrMap(urwid.Filler(urwid.AttrMap(urwid.Text(('banner', u" Suite Postdigital \n \n o cómo post-componer música \n después de Spotify \n \n por \n \n"), align='center'), 'streak')), 'bg')), Slide("Titulo11",urwid.AttrMap(urwid.Filler(urwid.AttrMap(urwid.Text(('banner', u" Suite Postdigital \n \n o cómo post-componer música \n después de Spotify \n \n por \n \n Enrique Tomás"), align='center'), 'streak')), 'bg')), Slide("pronounciation", urwid.Overlay(urwid.BigText( u"Parte 1 Blockchain:\n Los mineros", urwid.HalfBlock5x4Font()), urwid.SolidFill(" "), urwid.CENTER, None, urwid.MIDDLE, None)), FadingSlide("", urwid.AttrWrap(urwid.SolidFill(" "), FB_f), SLIDE_FOOTER_f, FADE_PALETTE0), FadingSlide("welcome", make_logo_slide(PYTHON_LOGO_f, PYCON_LOGO_f, URWID_LOGO_f), fade_palette=FADE_PALETTE1, auto_forward=True), Slide("welcome", make_logo_slide(PYTHON_LOGO, PYCON_LOGO, URWID_LOGO)), Slide("pronounciation", urwid.Overlay(urwid.BigText( u"Parte 1 Blockchain:\n Los mineros", urwid.HalfBlock5x4Font()), urwid.SolidFill(" "), urwid.CENTER, None, urwid.MIDDLE, None)), Slide("text", urwid.Filler(urwid.Text(LOREM_IPSUM))), Slide("text alignment", urwid.Filler(urwid.Columns([ urwid.AttrWrap(urwid.Text(LOREM_IPSUM),SLG), urwid.AttrWrap(urwid.Text(LOREM_IPSUM, urwid.CENTER),SLG), urwid.AttrWrap(urwid.Text(LOREM_IPSUM, urwid.RIGHT),SLG), ], 2))),