Python urwid.BigText() Examples

The following are 6 code examples of urwid.BigText(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module urwid , or try the search function .
Example #1
Source File: widgets.py    From pycopia with Apache License 2.0 6 votes vote down vote up
def build(self):
        menulist = []
        # big title
        bt = urwid.BigText("Storage Editor", urwid.HalfBlock5x4Font())
        bt = urwid.Padding(bt, "center", None)
        # primary tables for editing
        self.primlist = [TableItemWidget(s) for s in self._PRIMARY_TABLES]
        for b in self.primlist:
            urwid.connect_signal(b, 'activate', self._select)
        pmenu = urwid.GridFlow(self.primlist, 20, 2, 1, "left")
        # heading blurbs
        subhead = urwid.AttrMap(urwid.Text("Select an object type to view or edit."), "subhead")
        supportsubhead = urwid.AttrMap(urwid.Text("Select a supporting object to view or edit."), "subhead")
        # secondary/support tables
        self.seclist = [TableItemWidget(s) for s in self._SUPPORT_TABLES]
        for b in self.seclist:
            urwid.connect_signal(b, 'activate', self._select)
        smenu = urwid.GridFlow(self.seclist, 25, 1, 0, "left")
        divider = urwid.Divider("-", top=1, bottom=1)
        menulist = [bt, divider, subhead, pmenu, divider, supportsubhead, smenu]
        listbox = urwid.ListBox(urwid.SimpleListWalker(menulist))
        return urwid.Frame(listbox) 
Example #2
Source File: app.py    From toot with GNU General Public License v3.0 6 votes vote down vote up
def build_intro(self):
        font = urwid.font.Thin6x6Font()

        # NB: Padding with width="clip" will convert the fixed BigText widget
        # to a flow widget so it can be used in a Pile.

        big_text = "Toot {}".format(__version__)
        big_text = urwid.BigText(("intro_bigtext", big_text), font)
        big_text = urwid.Padding(big_text, align="center", width="clip")

        intro = urwid.Pile([
            big_text,
            urwid.Divider(),
            urwid.Text([
                "Maintained by ",
                ("intro_smalltext", "@ihabunek"),
                " and contributors"
            ], align="center"),
            urwid.Divider(),
            urwid.Text(("intro_smalltext", "Loading toots..."), align="center"),
        ])

        return urwid.Filler(intro) 
Example #3
Source File: main.py    From pycopia with Apache License 2.0 5 votes vote down vote up
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) 
Example #4
Source File: screens.py    From tildemush with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, exit=lambda _:True):
        bt = urwid.BigText('WELCOME TO TILDEMUSH', urwid.font.HalfBlock5x4Font())
        bt = urwid.Padding(bt, 'center', None)
        bt = urwid.Filler(bt, 'middle', None, 7)
        ftr = ColorText('~ press any key to jack in ~', align='center')
        self.base = urwid.Frame(body=bt, footer=ftr)
        super().__init__(self.base, exit=exit) 
Example #5
Source File: manager_ui.py    From sisyphus with Mozilla Public License 2.0 5 votes vote down vote up
def setup_view(self):
        self.logger_box = urwid.SimpleListWalker([])

        self._state_overview = urwid.Text("Starting")
        # ListBox
        self.job_box = urwid.ListBox(urwid.SimpleListWalker([]))

        w = urwid.Pile([urwid.AttrWrap(self.job_box, 'body')])

        # Frame
        hdr = urwid.Text("Sisyphus | CWD: %s | Call: %s | Press h for help | press q or esc to quit" %
                         (os.path.abspath('.'), ' '.join(sys.argv)), wrap='clip')
        self.header = hdr = urwid.AttrWrap(hdr, 'header')
        hdr = urwid.Pile([hdr,
                          (10, urwid.AttrWrap(urwid.ListBox(self.logger_box), 'body')),
                          urwid.AttrWrap(self._state_overview, 'note'),
                          ])

        self.setup_menu_view()
        self.main_view = self.menu_view
        self.job_view = urwid.Frame(header=hdr, body=w)

        # Exit message
        exit = urwid.BigText(('exit', " Quit? "), font=urwid.Thin6x6Font())
        self.exit_view = urwid.Overlay(exit, w, 'center', None, 'middle', None)

        self.question_text = urwid.Text("  ")
        self.question_queue = Queue()
        self.question_sem = Semaphore()
        self.question_view = urwid.Overlay(self.question_text, self.main_view,
                                           'center', ('relative', 80), 'middle', None)

        help = urwid.Text(help_text)
        self.help_view = urwid.Frame(header=self.header, body=urwid.ListBox([help]))

        self.setup_object_view()

        self.history = []
        self.stop_job_view_update = False
        self.current_jobs = [] 
Example #6
Source File: test_container.py    From anyMesh-Python with MIT License 5 votes vote down vote up
def test_overlay(self):
        self.wstest(urwid.Overlay(
            urwid.BigText("hello",urwid.Thin6x6Font()),
            urwid.SolidFill(),
            'center', None, 'middle', None))
        self.wstest(urwid.Overlay(
            urwid.Text("hello"), urwid.SolidFill(),
            'center',  ('relative', 100), 'middle', None))