#NEWLINE# def start( self , c ) : #NEWLINE# #INDENT# if ( self . attr . align is not None ) : #NEWLINE# #INDENT# c . frag . alignment = getAlign ( self . attr . align ) #NEWLINE# #UNINDENT# c . clearFrag ( ) #NEWLINE# self . story = c . swapStory ( ) #NEWLINE# attrs = self . attr #NEWLINE# tdata = c . tableData #NEWLINE# cspan = attrs . colspan #NEWLINE# rspan = attrs . rowspan #NEWLINE# row = tdata . row #NEWLINE# col = tdata . col #NEWLINE# while 1 : #NEWLINE# #INDENT# for ( x , y ) in tdata . span : #NEWLINE# #INDENT# if ( ( x == col ) and ( y == row ) ) : #NEWLINE# #INDENT# col += 1 #NEWLINE# tdata . col += 1 #NEWLINE# #UNINDENT# #UNINDENT# break #NEWLINE# #UNINDENT# begin = ( col , row ) #NEWLINE# end = ( col , row ) #NEWLINE# if cspan : #NEWLINE# #INDENT# end = ( ( ( end [ 0 ] + cspan ) - 1 ) , end [ 1 ] ) #NEWLINE# #UNINDENT# if rspan : #NEWLINE# #INDENT# end = ( end [ 0 ] , ( ( end [ 1 ] + rspan ) - 1 ) ) #NEWLINE# #UNINDENT# if ( begin != end ) : #NEWLINE# #INDENT# tdata . add_style ( ( 'SPAN' , begin , end ) ) #NEWLINE# for x in xrange ( begin [ 0 ] , ( end [ 0 ] + 1 ) ) : #NEWLINE# #INDENT# for y in xrange ( begin [ 1 ] , ( end [ 1 ] + 1 ) ) : #NEWLINE# #INDENT# if ( ( x != begin [ 0 ] ) or ( y != begin [ 1 ] ) ) : #NEWLINE# #INDENT# tdata . add_empty ( x , y ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# tdata . add_cell_styles ( c , begin , end , 'td' ) #NEWLINE# if ( ( col + 1 ) > len ( tdata . colw ) ) : #NEWLINE# #INDENT# tdata . colw = ( tdata . colw + ( ( ( col + 1 ) - len ( tdata . colw ) ) * [ _width ( ) ] ) ) #NEWLINE# #UNINDENT# if ( not cspan ) : #NEWLINE# #INDENT# width = ( c . frag . width or self . attr . width ) #NEWLINE# if ( width is not None ) : #NEWLINE# #INDENT# tdata . colw [ col ] = _width ( width ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( self . node . childNodes ) == 0 ) : #NEWLINE# #INDENT# width = ( c . frag . paddingLeft + c . frag . paddingRight ) #NEWLINE# tdata . colw [ col ] = _width ( width ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( ( row + 1 ) > len ( tdata . rowh ) ) : #NEWLINE# #INDENT# tdata . rowh = ( tdata . rowh + ( ( ( row + 1 ) - len ( tdata . rowh ) ) * [ _width ( ) ] ) ) #NEWLINE# #UNINDENT# if ( not rspan ) : #NEWLINE# #INDENT# height = ( c . frag . height or self . attr . get ( 'height' , None ) ) #NEWLINE# if ( height is not None ) : #NEWLINE# #INDENT# tdata . rowh [ row ] = _height ( height ) #NEWLINE# tdata . add_style ( ( 'FONTSIZE' , begin , end , 1.0 ) ) #NEWLINE# tdata . add_style ( ( 'LEADING' , begin , end , 1.0 ) ) #NEWLINE# #UNINDENT# #UNINDENT# valign = ( self . attr . valign or c . frag . vAlign ) #NEWLINE# if ( valign is not None ) : #NEWLINE# #INDENT# tdata . add_style ( ( 'VALIGN' , begin , end , valign . upper ( ) ) ) #NEWLINE# #UNINDENT# frag = c . frag #NEWLINE# frag . borderLeftWidth = 0 #NEWLINE# frag . borderLeftColor = None #NEWLINE# frag . borderLeftStyle = None #NEWLINE# frag . borderRightWidth = 0 #NEWLINE# frag . borderRightColor = None #NEWLINE# frag . borderRightStyle = None #NEWLINE# frag . borderTopWidth = 0 #NEWLINE# frag . borderTopColor = None #NEWLINE# frag . borderTopStyle = None #NEWLINE# frag . borderBottomWidth = 0 #NEWLINE# frag . borderBottomColor = None #NEWLINE# frag . borderBottomStyle = None