Python urwid.BarGraph() Examples

The following are 3 code examples of urwid.BarGraph(). 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: gui.py    From wsstat with MIT License 5 votes vote down vote up
def __init__(self):
        self.walker = urwid.SimpleFocusListWalker(contents=self.log_messages)
        self.list_box = urwid.ListBox(self.walker)

        self.graph = urwid.BarGraph(
            attlist=['graph bg background', 'graph bg 1', 'graph bg 2'],
            satt={
                (1, 0): 'graph bg 1 smooth',
                (2, 0): 'graph bg 2 smooth'
            }
        )

        self.graph_widget = urwid.LineBox(self.graph, title=self.graph_title)

        self.default_widget = urwid.Columns([
            urwid.LineBox(
                self.list_box,
                title="Logger"
            ),
            self.graph_widget
        ])

        self.logger_widget = urwid.LineBox(
            self.list_box,
            title="Logger"
        ) 
Example #2
Source File: test_graphics.py    From anyMesh-Python with MIT License 5 votes vote down vote up
def sbgtest(self, desc, data, top, exp ):
        urwid.set_encoding('utf-8')
        g = urwid.BarGraph( ['black','red','blue'],
                None, {(1,0):'red/black', (2,1):'blue/red'})
        g.set_data( data, top )
        rval = g.calculate_display((5,3))
        assert rval == exp, "%s expected %r, got %r"%(desc,exp,rval) 
Example #3
Source File: test_container.py    From anyMesh-Python with MIT License 5 votes vote down vote up
def test_bargraph(self):
        self.wstest(urwid.BarGraph(['foo','bar']))