Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > c8c18b36840d2165c44ac1566dcd5553 > files > 122

python-urwid-1.1.1-5.mga4.x86_64.rpm

import urwid

class MultiPudding(urwid.Widget):
    _sizing = frozenset(['flow', 'box'])

    def rows(self, size, focus=False):
        return 1

    def render(self, size, focus=False):
        if len(size) == 1:
            (maxcol,) = size
            maxrow = 1
        else:
            (maxcol, maxrow) = size
        num_pudding = maxcol / len("Pudding")
        return urwid.TextCanvas(["Pudding" * num_pudding] * maxrow,
                                maxcol=maxcol)