Ejemplo n.º 1
0
 def __init__( me, spr):
     ViewRedovaBase.__init__( me, spr)
     me.layout = spr.layout
     for name in 'top_left top_right bottom_left bottom_right empty_cell'.split():
         view_def = getattr( me.layout, name)
         view = getattr( view_def, me.view_context_name)
         me.view_descr[ name] = view
Ejemplo n.º 2
0
    def get_table_data( me, column_order):
        table_data, column_styles = ViewRedovaBase.get_table_data( me, column_order)

        style_commands = []
        for style in column_styles:
            style_commands += [ cmd.as_tuple() for cmd in style.container ]
        return table_data, style_commands
Ejemplo n.º 3
0
    def make_output( me, layout =None, view_descr =None):
        me.update( layout, view_descr)

        html = '<table>\n'
        table_data, column_styles = ViewRedovaBase.get_table_data( me, me.layout)
        for row_cells in table_data:
            html += '\t<tr>\n' + ''.join( row_cells) + '\n'
        html += '</table>\n'
        return html
Ejemplo n.º 4
0
    def make_embeddable_output( me, layout =None, view_descr =None):
        me.update( layout, view_descr)

        me.widths = [ me.calc_column_width( name) for name in me.layout]
        table_data, column_styles = ViewRedovaBase.get_table_data( me, me.layout)

        out=[]
        #pass 2
        for row_cells in table_data:
            out += [ ''.join( row) for row in zip( *row_cells ) ]
        return '\n'.join( out)