def align_layout( self, text, width, segs, wrap, align ):
        out = []
        for l in segs:
            sc = line_width(l)
            if sc == width or align=='left':
                out.append(l)
                continue

            if align == 'right':
                out.append([(width-sc, None)] + l)
                continue
            assert align == 'center'
            out.append([((width-sc+1) // 2, None)] + l)
        return out
Convert the layout segs to an aligned layout.
dataset/ETHPy150Open AnyMesh/anyMesh-Python/example/urwid/text_layout.py/StandardTextLayout.align_layout