;ò
³0sDc        	   @   sÐ  d  Z  d Z d k l Z l Z d k l Z d k l Z l	 Z	 d k
 l Z d k l Z d k l Z d k Z d k Z d	 k l Z l Z l Z l Z l Z d
 e f d „  ƒ  YZ h  e e <d d <d d <d d <d d <Z h  e e <d d <d d <d d <d d <Z d e f d „  ƒ  YZ e Z d f  d „  ƒ  YZ e e ƒ  ƒ Z e e f Z  d „  Z! d „  Z" e i# d „ Z$ d „  Z% d „  Z& d „  Z' d  e f d! „  ƒ  YZ( h  d" d# <d$ d% <d& d% <d' d( <d) d* <d+ d, <d- d. <d/ d0 <Z) d1 e( f d2 „  ƒ  YZ* e) i+ ƒ  Z, d3 „  Z- d4 „  Z. e d" d d f d5 d5 f d6 e i/ f d7 d d f d5 d5 f d8 f g ƒ Z0 e d$ d d f d5 d5 f d9 e i/ f d7 d d f d5 d5 f d8 f g ƒ Z1 e d' d d f d5 d5 f d6 e i/ f d$ d d f d5 d5 f d e i/ f d) d d f d5 d f d e i/ f d/ d d f d d5 f d e i/ f d7 d d f d5 d5 f d8 f g ƒ Z2 e d' d d f d5 d5 f d6 e i/ f d$ d d f d5 d5 f d e i3 f d) d d f d5 d f d e i/ f d/ d d f d d5 f d e i/ f d7 d d f d5 d5 f d8 f g ƒ Z4 e d+ d d f d5 d f d e i5 f d+ d d f d5 d5 f d6 e i/ f d) d d5 f d5 d5 f d e i5 f d7 d d f d5 d5 f d8 f g ƒ Z6 e7 d: j o d; k8 l9 Z9 e9 ƒ  n d S(<   s1    $Id: tables.py 2849 2006-05-06 08:25:23Z andy $ sØ  
Tables are created by passing the constructor a tuple of column widths, a tuple of row heights and the data in
row order. Drawing of the table can be controlled by using a TableStyle instance. This allows control of the
color and weight of the lines (if any), and the font, alignment and padding of the text.

None values in the sequence of row heights or column widths, mean that the corresponding rows
or columns should be automatically sized.

All the cell values should be convertible to strings; embedded newline '\n' characters
cause the value to wrap (ie are like a traditional linefeed).

See the test output from running this module as a script for a discussion of the method for constructing
tables and table styles.
(   s   Flowables   Preformatted(   s	   rl_config(   s   PropertySets   ParagraphStyle(   s   colors(   s   fp_str(   s
   pdfmetricsN(   s	   TupleTypes   ListTypes
   StringTypes	   FloatTypes   IntTypes	   CellStylec           B   s˜   t  Z h  d d <d d <d d <d d <d	 d <d
 d <d d <d d <d e i <d d <d d d d f <d d <d e <d e <Z RS(   Ns   fontnames   Times-Romans   fontsizei
   s   leadingi   s   leftPaddingi   s   rightPaddings
   topPaddingi   s   bottomPaddings   firstLineIndenti    s   colors	   alignments   LEFTs
   backgroundi   s   valigns   BOTTOMs   hrefs   destination(   s   __name__s
   __module__s   colorss   blacks   Nones   defaults(    (    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys	   CellStyle   s   s   butti    s   roundi   s
   projectingi   s   squareds   miters   mitres   bevels
   CellStyle1c           B   s€   t  Z d Z d Z d Z d Z d Z d Z d Z d Z	 e
 i Z d Z d d d f Z d	 Z e Z e Z e d
 „ Z e d „ Z RS(   Ns   Times-Romani
   i   i   i   i    s   LEFTi   s   BOTTOMc         C   s+   | |  _  | t j	 o | i |  ƒ n d  S(   N(   s   names   selfs   parents   Nones   copy(   s   selfs   names   parent(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   __init__B   s    	c         C   sR   | t j o t ƒ  } n x- t |  ƒ D] } t | | t |  | ƒ ƒ q' W| Sd  S(   N(   s   results   Nones
   CellStyle1s   dirs   selfs   names   setattrs   gettattr(   s   selfs   results   name(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   copyF   s     (   s   __name__s
   __module__s   fontnames   fontsizes   leadings   leftPaddings   rightPaddings
   topPaddings   bottomPaddings   firstLineIndents   colorss   blacks   colors	   alignments
   backgrounds   valigns   Nones   hrefs   destinations   __init__s   copy(    (    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys
   CellStyle13   s    	s
   TableStylec           B   s2   t  Z e e d „ Z d „  Z d „  Z d „  Z RS(   Nc         K   s²   g  } | od | | i ƒ  } | i |  _ xE d d f D]3 } t | | ƒ o t |  | t | | ƒ ƒ q6 q6 Wn | o | t
 | ƒ } n | |  _ h  |  _ |  i i | ƒ d  S(   Ns   spaceBefores
   spaceAfter(   s   commandss   parents   getCommandss   _optss   selfs   as   hasattrs   setattrs   getattrs   cmdss   lists   _cmdss   updates   kw(   s   selfs   cmdss   parents   kws   as   commands(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   __init__O   s     %		c         G   s   |  i i | ƒ d  S(   N(   s   selfs   _cmdss   appends   cmd(   s   selfs   cmd(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   add_   s    c         C   s9   t  t |  i ƒ } d  k } | i | d ƒ } d | Sd  S(   Ns     
s!   TableStyle(
%s
) # end TableStyle(   s   maps   reprs   selfs   _cmdss   Ls   strings   join(   s   selfs   Ls   string(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   __repr__a   s    	c         C   s   |  i Sd  S(   N(   s   selfs   _cmds(   s   self(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   getCommandsf   s    (   s   __name__s
   __module__s   Nones   __init__s   adds   __repr__s   getCommands(    (    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys
   TableStyleN   s   		c         C   s(   t  |  ƒ t j o d p
 t |  ƒ Sd  S(   Ni   (   s   types   xs	   _SeqTypess   len(   s   x(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _rowLenl   s    c         C   sï  g  } | i } g  } | i }	 g  } | i } | }
 d } } x÷ |  D]ï } t | ƒ t d ƒ j o¡ | i ƒ  } | o t } | d 7} q)| i d ƒ o. t | d  ƒ } | | 7} |	 t | ƒ ƒ q)| d j o | t | ƒ ƒ q)t | ƒ } |
 | 8}
 n& | t j o | d 7} n |
 | 8}
 | | ƒ qD Wt d |
 ƒ }
 |
 t d | ƒ } x, | D]$ }	 | |	 c | 9<|
 | |	 8}
 q`Wt d |
 ƒ }
 t | ƒ } | o= | d j o |
 | p t } x | D] } | | | <qÏWn | Sd	 S(
   s  check list V for percentage or * values
    1) absolute values go through unchanged
    2) percentages are used as weights for unconsumed space
    3) if no None values were seen '*' weights are
    set equally with unclaimed space
    otherwise * weights are assigned as Nonef0.0s    i   s   %iÿÿÿÿs   *f100.0i    N(   s   Rs   appends   rs   Is   is   Js   js   avails   ss   ws   ns   Vs   vs   types   strips   Nones   endswiths   floats   lens   maxs   fs   m(   s   Vs   avails   js   fs   Is   Js   vs   ms   ns   is   ss   rs   ws   R(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _calc_pco   sT     			
 

  c         C   s]  | o | i | t ƒ } n | p/ | | d d | j p | | d d | j o |  | | | | ƒ nì d } t	 | ƒ } x® | | | j  o
 | | j  o | | \ }
 } | | | j p |
 | | j o | d 7} qƒ n t | |
 ƒ } t | | ƒ }	 | | j o |  | | | | ƒ n |	 } qƒ W| | | j  o |  | | | | ƒ n d S(   s’   
    Draw horizontal lines; do not draw through regions specified in hBlocks
    This also serves for vertical lines with a suitable canvLine
    iÿÿÿÿi   i    N(   s   hBlockss   gets   ys   Nones   scps   FUZZs   ecps   canvLines   is   lens   ns   x0s   x1s   maxs   i0s   mins   i1(   s   canvLines   scps   ecps   ys   hBlockss   FUZZs   x1s   is   i0s   i1s   x0s   n(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _hLineŸ   s(      : "
  c         C   sT   d | d | } | | 7} x1 t | ƒ D]# } | |  | | | ƒ | | 8} q) Wd  S(   Nf0.5i   (	   s   counts   wss   offsets   ys   xranges   idxs   canvLines   scps   ecp(   s   scps   ecps   ys   canvLines   wss   counts   idxs   offset(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys
   _multiLineµ   s    
 c         C   s…   y | |  SWnS t j
 oG y6 t |  ƒ } | | j o
 | j n o | Sn Wqb qb Xn Xt d | |  t	 | ƒ f ƒ ‚ d S(   sL   private converter tries map(value) low<=int(value)<=high or finally an errors   Bad %s value %s in %sN(   s   maps   values   KeyErrors   ints   ivalues   lows   highs
   ValueErrors   names   strs   cmd(   s   values   maps   lows   highs   names   cmds   ivalue(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _convert2int¼   s      	c         C   s#   y |  i | ƒ SWn d Sn Xd  S(   Ni    (   s   objs   endswiths   s(   s   objs   s(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys	   _endswithÈ   s    s   Tablec           B   s—  t  Z e e e d d d e e e e d „
 Z d „  Z d „  Z d d „ Z e e d d	 „ Z e d
 „ Z d „  Z	 e e d „ Z
 d „  Z e d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d  „  Z d d! „ Z d" „  Z  d# „  Z! d$ „  Z" d% „  Z# d& „  Z$ d' „  Z% d( „  Z& d) „  Z' d* „  Z( RS(+   Ni    i   c         C   sÏ  |	 |  _  |
 p d |  _ | p d |  _ t | ƒ t j o t d |  i ƒ  ‚ n t	 | ƒ |  _
 } g  |  _ t | ƒ t j } t | ƒ t j } | o  t t t | ƒ ƒ |  _ } n% | o | o t	 | ƒ } n d } | o t i } n | o | oð | d j o t d |  i ƒ  ‚ nÅ | d j oq t |  _ d t ƒ  i ƒ  j o( t d ƒ a t i t _  t i! t _" n t i# |  d	 |  i i$ | | f t ƒ nG | d
 j o  t% |  _ t% i# |  d d ƒ n t d |  i ƒ  | f ‚ d  Sn |  i& | ƒ |  _ | o | | g } n: t	 | ƒ | j o& t d |  i ƒ  | t	 | ƒ f ‚ n | o | | g } n: t	 | ƒ | j o& t d |  i ƒ  | t	 | ƒ f ‚ n xH t' | ƒ D]: } t	 | | ƒ | j o t d |  i ƒ  | f ‚ qµqµW| |  _) |  _* | |  _+ |  _, g  } xX t' | ƒ D]J } g  } x. t' | ƒ D]  } | i0 t1 | | f ƒ ƒ q?W| i0 | ƒ q&W| |  _2 g  |  _3 g  |  _4 g  |  _5 | |  _6 | |  _7 | |  _8 | o |  i: | ƒ n d  S(   Ns   CENTERs   MIDDLEs   %s invalid data typei    s   errors&   %s must have at least a row and columns   indicates   _emptyTableStyles	   %s(%d,%d)s   ignores   %s bad emptyTableAction: "%s"s1   %s data error - %d columns in data but %d in grids.   %s data error - %d rows in data but %d in grids$   %s not enough data points in row %d!(;   s   idents   selfs   hAligns   vAligns   types   datas	   _SeqTypess
   ValueErrors   identitys   lens   _nrowss   nrowss   _cellvaluess	   colWidthss   _seqCWs
   rowHeightss   _seqRHs   maxs   maps   _rowLens   _ncolss   ncolss   emptyTableActions	   rl_configs   Preformatteds	   __class__s   globalss   keyss   ParagraphStyles   _emptyTableStyles   colorss   reds	   textColors   yellows	   backColors   __init__s   __name__s   Spacers   normalizeDatas   ranges   is   _rowHeightss   _argHs
   _colWidthss   _argWs   cellrowss   cellcolss   js   appends	   CellStyles   _cellStyless   _bkgrndcmdss	   _linecmdss	   _spanCmdss
   repeatRowss
   repeatColss
   splitByRows   styles   setStyle(   s   selfs   datas	   colWidthss
   rowHeightss   styles
   repeatRowss
   repeatColss
   splitByRows   emptyTableActions   idents   hAligns   vAligns   cellrowss   _seqCWs   cellcolss   ncolss   nrowss   is   _seqRHs   j(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   __init__Ï   s€    		    	 *	 & & !  							c         C   sŠ   t  |  d d ƒ } t  |  d d ƒ } t  |  d d ƒ } d k } d k } | i | ƒ } | i | d d ƒ } d |  i	 i
 | | | f Sd S(	   s#   incomplete, but better than nothings   _rowHeightss	   [unknown]s
   _colWidthss   _cellvaluesNs   
s   
  s3   %s(
 rowHeights=%s,
 colWidths=%s,
%s
) # end table(   s   getattrs   selfs   rs   cs   cvs   pprints   strings   pformats   replaces	   __class__s   __name__(   s   selfs   cs   strings   pprints   rs   cv(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   __repr__  s     c   	      C   so   d „  } g  } xH | D]@ } g  i } | D] } | | | ƒ ƒ q* ~ } | i | ƒ q Wd k l } | Sd S(   s¥   Takes a block of input data (list of lists etc.) and
        - coerces unicode strings to non-unicode UTF8
        - coerces nulls to ''
        - 
        
        c         C   sG   |  t j o d Sn/ t |  ƒ t d ƒ j o |  i d ƒ Sn |  Sd  S(   Ns    u    s   utf8(   s   stuffs   Nones   types   encode(   s   stuff(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   normCell   s
    (   s   pprintN(
   s   normCells   outDatas   datas   rows   appends   _[1]s   cells   outRows   pprints   pp(	   s   selfs   datas   cells   pps   outRows   _[1]s   outDatas   normCells   row(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   normalizeData  s     	 -i   c         C   sM  |  i o |  i Sn t } t |  d d ƒ } t |  d d ƒ } t |  d t ƒ } | o d | | f j o‘d }	 xˆt	 | ƒ D]v}
 xat	 | ƒ D]S} | |
 | } t | ƒ } | t j p t | t ƒ oœ | t j o | f } n d } x: | D]2 } | i | ƒ } | o | d d j o Pqö qö W| o | d d j o" |
 | | d	 f \ } } } }	 qØno | t j o d p
 t | ƒ } |
 | | f \ } } } | o
 | t j o d	 p d }	 | o | |  } n |	 o Pq‘ q‘ W|	 o Pq~ q~ Wn | o d
 | | t | ƒ f } n d } d |  i i t |  ƒ | | | f Sd S(   s'   Identify our selves as well as possibles   _nrowss   unknowns   _ncolss   _cellvaluesi    s    iüÿÿÿs   >...i   s    with cell(%d,%d) containing
%ss   ...s   <%s at %d %d rows x %s cols>%sN(   s   selfs   idents   Nones   vxs   getattrs   nrs   ncs   cvs   bs   xranges   is   js   vs   types   ts	   _SeqTypess
   isinstances   Flowables   rs   vijs   identitys   maxLens   ixs   jxs   strs
   StringTypes   reprs	   __class__s   __name__s   id(   s   selfs   maxLens   ixs   vijs   vxs   cvs   ncs   nrs   jxs   bs   is   js   rs   ts   v(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   identity1  sN     
     	& !  	 i@ c         C   s  | o d d f Sn | | i | i } | | i | i } d } d } t
 |  d t ƒ }
 x’ | D]Š }	 |	 i |
 | | ƒ \ } } | t j	 o | i | ƒ n | t j	 o | i | ƒ n t | | ƒ } | | |	 i ƒ  |	 i ƒ  } qc W| | | d i ƒ  | d i ƒ  f Sd  S(   Ni    s   canviÿÿÿÿ(   s   Vs   ws   ss   leftPaddings   rightPaddings   aWs   aHs
   topPaddings   bottomPaddings   ts   getattrs   selfs   Nones   canvs   vs   wrapOns   vws   vhs   Ws   appends   Hs   maxs   getSpaceBefores   getSpaceAfter(   s   selfs   Vs   ws   ss   Ws   Hs   aHs   vws   vhs   vs   canvs   aWs   t(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _listCellGeomU  s"        "c         C   s   t  |  d t ƒ o d  Sn | o t |  i | ƒ } n t | j o~t  |  d t ƒ }
 t } |  i	 o |  i
 p f  } | |  i j o | } n x.t | j o| i t ƒ } | d „ } t | |  i ƒ } t | |  i ƒ }	 d } d } xÀ t t | |	 ƒ D]¬ \ } } | | f | j o
 d } nc |  i | | ƒ } | t j o/ t d | i d ƒ | | |  i d ƒ f ‚ n | | i | i } | | j o
 | } n | d } qW| | | <q– Wn | |  _ d } d g |  _  x( | D]  } | | } |  i  i! | ƒ qæW| |  _" d |  _# d  S(	   Ns   _width_calculated_onces   canvc         C   s   t  i |  | ƒ S(   N(   s   operators   getitems   xs   j(   s   xs   j(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   <lambda>o  s    i    f0.0s3   Flowable %s in cell(%d,%d) can't have auto width
%si   i   ($   s   getattrs   selfs   Nones   Ws   _calc_pcs   _argWs
   availWidths   canvs   saveds	   _spanCmdss   _colSpanCellss   colSpanCellss   indexs   js   fs   maps   _cellvaluess   Vs   _cellStyless   Ss   ws   is   vs   ss   ts   _elementWidths
   ValueErrors   identitys   leftPaddings   rightPaddings
   _colWidthss   widths   _colpositionss   appends   _widths   _width_calculated_once(   s   selfs
   availWidths   Ws   vs   ws   fs   is   ss   js   Ss   canvs   widths   colSpanCellss   Vs   saveds   t(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _calc_widthd  sN         
/ 
	 
	c         C   s­  t  | ƒ } | t j oU d } xD | D]< } |  i | | ƒ } | t
 j o t
 Sn t | | ƒ } q& W| Sn t | t ƒ o | i or t | d ƒ o t  | i ƒ t t f j o | i Sn t | d ƒ o t  | i ƒ t t f j o | i Sqú n t | d ƒ oK y1 | i ƒ  } t  | ƒ t t f j o | Sn WqUt j
 o qUXn t i | t
 j	 o
 t | ƒ p d d ƒ } t t | i | i t i d „ | ƒ ƒ Sd  S(   Ni    s   widths	   drawWidths   minWidths    s   
c         C   s   | |  | | ƒ S(   N(   s   ds   as   bs   c(   s   as   bs   cs   d(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   <lambda>¤  s    (   s   types   vs   ts	   _SeqTypess   ws   es   selfs   _elementWidths   ss   ews   Nones   maxs
   isinstances   Flowables   _fixedWidths   hasattrs   widths   IntTypes	   FloatTypes	   drawWidths   minWidths   AttributeErrors   strings   splits   strs   maps   fontnames   fontsizes
   pdfmetricss   stringWidth(   s   selfs   vs   ss   es   ts   ws   ew(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _elementWidthŽ  s0      , ,  	,c         C   s•  |  i } | o t |  i | ƒ } n t | ƒ } }	 t
 |  d t i ƒ } t | j o·t
 |  d t ƒ } t } |  i o( |  i }
 |  i } |  i } |  i } n f  }
 } | o | i | i | i f } n | } | |  _ xt | j o| i t ƒ } | o5 | } t  t! i" | |  d ƒ } | | j o Pq;n |  i% | } |  i' | } d } d } x‚t+ t | | | ƒ D]k\ } } } | | f } | |
 j o
 d } nt1 | ƒ } | t2 j p t3 | t4 ƒ oœ| t2 j o | f } n | t j o3 t5 d | d i6 d ƒ | | |  i6 d ƒ f ‚ n | o< | i7 | i8 | i9 p d | i8 f \ | _ | _ | _ n | | j o5 | | } t: | | d d	 | | d | ƒ } n |  i; | | | ƒ \ } } | o | \ | _ | _ | _ n | | i= | i> } t i? o
 | | j oN d
 d | d i6 d ƒ t@ | ƒ t@ | ƒ | | t@ | ƒ |  i6 d ƒ f ‚ q­n@ tA iB | t j	 o
 tC | ƒ p d d ƒ } | i9 t | ƒ } | | iD | iE } | | j o
 | } n | d	 } qwW| | | <qã Wt | j o
 |	 } qn t  t! i" | |  d ƒ } |  _F | g |  _G x, | |  D]  } | | } |  iG iH | ƒ qGWtI | ƒ d j  p
 tJ d ‚ | |  _K d  S(   Ns   _longTableOptimizes   canvi    f0.0s6   Flowable %s in cell(%d,%d) can't have auto width in
%si   f1.2i   i   s   LayoutErrorsG   Flowable %s (%sx%s points) too wide for cell(%d,%d) (%sx* points) in
%ss    s   
f1e-08s   Internal height error(L   s   selfs   _argHs   Hs   Ws   _calc_pcs   _argWs
   availWidths   lens   hmaxs   lims   getattrs	   rl_configs   longTableOptimizes	   longTables   Nones   canvs   saveds	   _spanCmdss   _rowSpanCellss   rowSpanCellss   _colSpanCellss   colSpanCellss   _spanRangess
   spanRangess   _colpositionss   colpositionss	   _fontnames	   _fontsizes   _leadings   _rowHeightss   indexs   is   reduces   operators   adds   heights   availHeights   _cellvaluess   Vs   _cellStyless   Ss   hs   js   maps   vs   ss   ws   jis   ts   types	   _SeqTypess
   isinstances   Flowables
   ValueErrors   identitys   fontnames   fontsizes   leadings   maxs   _listCellGeoms   dWs   leftPaddings   rightPaddings   allowTableBoundsErrorss   fp_strs   strings   splits   strs   bottomPaddings
   topPaddings   _heights   _rowpositionss   appends   abss   AssertionErrors   _hmax(   s   selfs   availHeights
   availWidths   Hs   Ws   colpositionss   heights   canvs
   spanRangess   lims   rowSpanCellss   ts   Ss   jis   Vs	   longTables   hmaxs   is   hs   js   saveds   ss   colSpanCellss   ws   vs   dW(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _calc_height¦  sŠ    	 
			
 	  	 
 3 <
+ R, 
   
c         C   sÊ   t  |  i j p d |  i j o
 |  i ƒ  o |  i | ƒ } n t  } |  i o5 |  i ƒ  t  |  i	 j o |  i
 | d | ƒq… n |  i | | d | ƒ|  i
 | d | ƒ|  i o |  i ƒ  n d  S(   Ns   *s   W(   s   Nones   selfs
   _colWidthss   _hasVariWidthElementss   _calcPreliminaryWidthss
   availWidths   Ws	   _spanCmdss   _calcSpanRangess   _argHs   _calc_widths   _calc_heights   availHeights   _calcSpanRects(   s   selfs
   availWidths   availHeights   W(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _calcë  s    -


c         C   s‘   d } | t j o |  i } n xf t t |  i | ƒ ƒ D]L } xC t |  i ƒ D]2 } |  i
 | | } |  i | ƒ o
 d } qO qO Wq9 W| Sd S(   s   Check for flowables in table cells and warn up front.

        Allow a couple which we know are fixed size such as
        images and graphics.i    i   N(   s   bads   upToRows   Nones   selfs   _nrowss   ranges   mins   rows   _ncolss   cols   _cellvaluess   values   _canGetWidth(   s   selfs   upToRows   bads   values   cols   row(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _hasVariWidthElements	  s        c         C   sn   t  | ƒ t t f j o2 x' | D] } |  i | ƒ o d Sq  q  Wd Sn  t | t ƒ o | i	 Sn d Sd S(   s"   Can we work out the width quickly?i    i   N(
   s   types   things   ListTypes	   TupleTypes   elems   selfs   _canGetWidths
   isinstances   Flowables   _fixedWidth(   s   selfs   things   elem(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _canGetWidth  s      c   &      C   sQ  t  |  i ƒ } d } d } d } d } d } d }# xª | D]¢ }% |% t j o | d 7} q: |% d j o | d 7} |# d 7}# q: t |% d ƒ o" | d 7} | t |% d  ƒ 7} q: t |% ƒ t t f j p t ‚ | |% } q: W| o d |  i | | | f GHn g  }
 g  } g  } h  } d } |  i } x)t |  i ƒ D]} | | }% |% t j p |% d j p t |% d ƒ oÑ d } t }	 } x t |  i  ƒ D]p } |  i" | | } |  i$ | | } | | | ƒ | i& | i' } t) |	 | ƒ } | }	 | o |  i* | ƒ } q•W| o | i+ | ƒ n | i+ | ƒ | | | <| | 7} q;|
 i+ | ƒ q;Wt, |
 ƒ |  i j o d Sn | o d	 G|
 GHn | o d
 G| GHn | o d G| GHn | | | }  |  d j o2| | d } | | 7} | o
 | d j  o3 |# p | } d | | } d } | | | }! n d } }! g  } d } |  } xÈ | i5 ƒ  D]º \ } }" | | }% t |% d ƒ o t |% d  ƒ | | } n- |% d j o
 |! } n |# o |! p d } | |" j o |" | | <qT| i+ | |" |" | | f ƒ | | 7} | |" 7} qTW| oá | | } | i9 ƒ  g  } x~ | D]v \ }$ }" } } | | } | |" j  o7 |" | | <| | 8} | |" 8} | o | | } q°q:| i+ |" | | f ƒ q:WxC | D]7 \ }" } } | | } | |" j p t ‚ | | | <q»Wq%n( x$ | i5 ƒ  D] \ } }" |" | | <qW| o d G| GHn | |  _ |  _= | Sd S(   sË   Fallback algorithm for when main one fails.

        Where exact width info not given but things like
        paragraphs might be present, do a preliminary scan
        and assign some best-guess values.i    f0.0i   s   *s   %iÿÿÿÿsM   prelim width calculation.  %d columns, %d undefined width, %0.2f units remainNs   predefined width:   s   uncomputable width: s   computable width:   id   s   new widths are:(>   s   lists   selfs   _argWs   Ws   verboses   totalDefineds   percentDefineds   percentTotals   numberUndefineds   numberGreedyUndefineds   ws   Nones	   _endswiths   floats   types   IntTypes	   FloatTypes   AssertionErrors   _ncolss
   availWidths   givens   sizeables
   unsizeables   minimumss   totalMinimums   _elementWidths   elementWidths   ranges   colNos   sizs   currents   finals   _nrowss   rowNos   _cellvaluess   values   _cellStyless   styles   leftPaddings   rightPaddings   news   maxs   _canGetWidths   appends   lens	   remainings   definedPercentages	   undefineds   defaultWeights   defaultDesireds   desiredWidthss   totalDesireds   effectiveRemainings   itemss   minimums   desireds
   proportions   sorts   finalSets   disappointments   adjusteds
   _colWidths(&   s   selfs
   availWidths   finalSets   adjusteds   sizeables   verboses
   proportions   styles   totalDesireds   currents   givens   rowNos   defaultWeights   percentTotals   sizs   percentDefineds
   unsizeables   news   effectiveRemainings   finals   definedPercentages   colNos   totalMinimums   minimumss   totalDefineds   desiredWidthss   numberUndefineds   Ws   elementWidths	   undefineds   desireds   values	   remainings   defaultDesireds   minimums   numberGreedyUndefineds   disappointments   w(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _calcPreliminaryWidths&  sØ      

  	 
*
 
   

 




 



 
  c         C   s  t  |  i ƒ } d } |  i } t |  i ƒ }	 |  i
 } |  i } xË t t | ƒ ƒ D]· } | | } | t j p | d j p t | d ƒ om d } xV |	 D]N } | | | } | | | } | | | ƒ | i | i }
 t | |
 ƒ } q™ W| | 7} qR | t | ƒ 7} qR W| Sd  S(   Ni    s   *s   %(   s   lists   selfs   _argWs   Ws   widths   _elementWidths   elementWidths   xranges   _nrowss   rowNoss   _cellvaluess   valuess   _cellStyless   styless   lens   colNos   ws   Nones	   _endswiths   finals   rowNos   values   styles   leftPaddings   rightPaddings   news   maxs   float(   s   selfs   elementWidths   styless   rowNos   Ws   styles   widths   valuess   values   rowNoss   news   colNos   ws   final(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   minWidthº  s(    			 
* c         C   s¾  h  |  _ } xM t |  i ƒ D]< }	 x3 t |  i ƒ D]" } |	 | |	 | f | |	 | f <q3 Wq Wg  |  _ g  |  _	 |  i i
 } |  i	 i
 } x0|  i D]%\ } } } | \ }
 } | \ } } |
 d j  o |
 |  i }
 n | d j  o | |  i } n | d j  o | |  i } n | d j  o | |  i } n |
 | j o | |
 f \ }
 } n | | j o | | f \ } } n |
 | j p
 | | j o&|
 | j oP xM t | | d ƒ D]4 } x+ t |
 | d ƒ D] }	 | |	 | f ƒ qËWq±Wn | | j oP xM t | | d ƒ D]4 } x+ t |
 | d ƒ D] }	 | |	 | f ƒ q(WqWn xI t | | d ƒ D]4 } x+ t |
 | d ƒ D] }	 t | |	 | f <qxWq^W|
 | | | f | |
 | f <q‘ q‘ Wd S(   s  Work out rects for tables which do row and column spanning.

        This creates some mappings to let the later code determine
        if a cell is part of a "spanned" range.
        self._spanRanges shows the 'coords' in integers of each
        'cell range', or None if it was clobbered:
          (col, row) -> (col0, row0, col1, row1)

        Any cell not in the key is not part of a spanned region
        i    i   N(   s   selfs   _spanRangess
   spanRangess   xranges   _ncolss   xs   _nrowss   ys   _colSpanCellss   _rowSpanCellss   appends   csas   rsas	   _spanCmdss   cmds   starts   stops   x0s   y0s   x1s   y1s   None(   s   selfs   y1s   cmds   csas   rsas   stops   starts   y0s   ys   xs   x0s   x1s
   spanRanges(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _calcSpanRangesÐ  s\    
   $		
             c         C   s  t  |  d t ƒ o d Sn |  i } |  i } h  |  _ } h  |  _	 } h  |  _ } xp|  i i ƒ  D]_\ } } | t j o t | | <qd | \ } } | \ }	 } }
 } |
 |	 d j oU xR t |	 d |
 d ƒ D]5 } | i | | g  ƒ i | | d | | f ƒ qÒ Wn | | d j oU xR t | d | d ƒ D]5 } | i | | g  ƒ i | |	 | |
 d f ƒ q8Wn | |	 } | | d } | |
 d | } | | | } | | | | f | | <qd Wx5 | | f D]' } x | i ƒ  D] } | i  ƒ  qçWqÔWd S(   s®  Work out rects for tables which do row and column spanning.

        Based on self._spanRanges, which is already known,
        and the widths which were given or previously calculated,
        self._spanRects shows the real coords for drawing:
          (col, row) -> (x, y, width, height)

        for each cell.  Any cell which 'does not exist' as another
        has spanned over it will get a None entry on the right
        s
   _spanRectsNi    i   (!   s   getattrs   selfs   Nones   _colpositionss   colpositionss   _rowpositionss   rowpositionss
   _spanRectss	   spanRectss   _vBlockss   vBlockss   _hBlockss   hBlockss   _spanRangess   itemss   coords   values   cols   rows   col0s   row0s   col1s   row1s   xranges   _s
   setdefaults   appends   xs   ys   widths   heights   valuess   sort(   s   selfs   colpositionss   heights   values   rows   widths   vBlockss	   spanRectss   rowpositionss   col0s   col1s   hBlockss   _s   row0s   row1s   coords   ys   xs   col(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _calcSpanRects  s@    
  		  7 7
  c         C   sÐ   t  | ƒ t j	 o t | ƒ } n x! | i ƒ  D] } |  i | ƒ q0 Wx- | i i	 ƒ  D] \ } } t |  | | ƒ qW WxR d d f D]D } t |  | ƒ o t | | ƒ o t |  | t | | ƒ ƒ q„ q„ Wd  S(   Ns   spaceBefores
   spaceAfter(   s   types   tblstyles   TableStyleTypes
   TableStyles   getCommandss   cmds   selfs   _addCommands   _optss   itemss   ks   vs   setattrs   as   hasattrs   getattr(   s   selfs   tblstyles   as   cmds   vs   k(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   setStyle(  s       !c         C   sE  | d d d d f j o |  i i | ƒ n| d d j o |  i i | ƒ nït | ƒ oåt | ƒ } t | ƒ d j  o t d t	 | ƒ ƒ ‚ n t | ƒ d j  o | i d	 ƒ n* t
 | d t d d
 d | ƒ }
 |
 | d <t | ƒ d j  o | i t ƒ n t | ƒ d j  o | i d	 ƒ n* t
 | d t d d
 d | ƒ } | | d <t | ƒ d j  o | i d	 ƒ n@ | d } | t j o d	 } | | d <n | d	 j p t ‚ t | ƒ d j  o | i | d ƒ n0 | d } | t j o | d } | | d <n t | ƒ d j p t ‚ |  i i t | ƒ ƒ ný | d  | d f \ \ } \ } }	 \ } } } | d j  o | |  i } n | d j  o | |  i } n |	 d j  o |	 |  i }	 n | d j  o | |  i } n xR t |	 | d	 ƒ D]= } x4 t | | d	 ƒ D] } t  |  i! | | | | ƒ qWq Wd  S(   Ni    s
   BACKGROUNDs   ROWBACKGROUNDSs   COLBACKGROUNDSs   SPANi   s   bad line command i   i   i   s   capi   i   s   joini	   i
   i   ("   s   cmds   selfs   _bkgrndcmdss   appends	   _spanCmdss   _isLineCommands   lists   lens
   ValueErrors   strs   _convert2ints   LINECAPSs   caps   Nones	   LINEJOINSs   joins	   lineCounts   AssertionErrors   spaces	   _linecmdss   tuples   ops   scs   srs   ecs   ers   valuess   _ncolss   _nrowss   ranges   is   js   _setCellStyles   _cellStyles(   s   selfs   cmds   js   ecs	   lineCounts   ers   spaces   joins   is   srs   caps   valuess   scs   op(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _addCommand3  s^     
  
 
 

/      c         C   s0  t  t  t  f \ } } } |  i i ƒ  xî|  i D]ã\
 } \ } } \ }
 } } } } }	 } } } t | ƒ t d ƒ j o | i d ƒ o q/ n | d j  o | |  i } n |
 d j  o |
 |  i }
 n | d j  o | |  i } n | d j  o | |  i } n | t  j o
 | | j o |  i i | ƒ | } n |	 t  j p
 |	 g  j o( | t  j	 o |  i i ƒ  t  } q¤n( |	 | j o |  i i |	 ƒ |	 } n | t  j	 o
 | | j o |  i i | ƒ | } n t |  t i | d ƒ ƒ | | f |
 | f | | | | ƒ q/ W|  i i ƒ  t  |  _ d  S(   Ns    s   spliti    s   _drawUnknown(    s   Nones   ccaps   cdashs   cjoins   selfs   canvs	   saveStates	   _linecmdss   ops   scs   srs   ecs   ers   weights   colors   caps   dashs   joins   counts   spaces   types
   startswiths   _ncolss   _nrowss
   setLineCaps   setDashs   setLineJoins   getattrs
   _LineOpMaps   gets   restoreStates	   _curcolor(   s   selfs   counts   joins   weights   spaces   colors   ccaps   caps   cdashs   dashs   ecs   srs   scs   cjoins   ers   op(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys
   _drawLinesj  s<    
 0)     


>c         C   s)   | \ } } | \ }	 }
 t d t ‚ d  S(   Ns   Unknown line command '%s'(   s   scs   srs   ecs   ers
   ValueErrors   op(   s   selfs   .2s   .4s   weights   colors   counts   spaces   scs   srs   ecs   er(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _drawUnknown„  s   c         C   sl   | \ } } | \ }	 }
 |  i | | f |	 |
 f | | | | ƒ |  i
 | | f |	 |
 f | | | | ƒ d  S(   N(   s   scs   srs   ecs   ers   selfs   _drawBoxs   weights   colors   counts   spaces   _drawInnerGrid(   s   selfs   .2s   .4s   weights   colors   counts   spaces   scs   srs   ecs   er(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys	   _drawGrid‡  s   (c         C   sÌ   | \ } } | \ }	 }
 |  i | | f |	 | f | | | | ƒ |  i | |
 d f |	 |
 d f | | | | ƒ |  i
 | | f | |
 f | | | | ƒ |  i
 |	 d | f |	 d |
 f | | | | ƒ d  S(   Ni   (   s   scs   srs   ecs   ers   selfs   _drawHLiness   weights   colors   counts   spaces   _drawVLines(   s   selfs   .2s   .4s   weights   colors   counts   spaces   scs   srs   ecs   er(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _drawBox‹  s   (0(c         C   st   | \ } } | \ }	 }
 |  i | | d f |	 |
 f | | | | ƒ |  i
 | d | f |	 |
 f | | | | ƒ d  S(   Ni   (   s   scs   srs   ecs   ers   selfs   _drawHLiness   weights   colors   counts   spaces   _drawVLines(   s   selfs   .2s   .4s   weights   colors   counts   spaces   scs   srs   ecs   er(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _drawInnerGrid‘  s   ,c         C   s^   | |  i j o |  i i | ƒ | |  _ n | |  i j o |  i i | ƒ | |  _ n d  S(   N(   s   colors   selfs	   _curcolors   canvs   setStrokeColors   weights
   _curweights   setLineWidth(   s   selfs   weights   color(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys	   _prepLine•  s    c         C   s)  | \ } } | \ }	 }
 |  i | |	 d !} |  i | |
 d !} t	 | ƒ d j p t	 | ƒ d j  o d  Sn |  i
 | | ƒ | d } | d } t |  d h  ƒ } |  i i } | d j o+ xe | D] } t | | | | | ƒ qÄ Wn> | | | | d „ } x$ | D] } t | | | | | ƒ qWd  S(   Ni   i   i    iÿÿÿÿs   _hBlocksc         C   s   t  |  | | | | | ƒ S(   N(   s
   _multiLines   x0s   x1s   y0s   canvLines   wss   count(   s   x0s   y0s   x1s   y1s   canvLines   wss   count(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   <lambda>ª  s    (   s   scs   srs   ecs   ers   selfs   _colpositionss   ecps   _rowpositionss   rps   lens	   _prepLines   weights   colors   scps   getattrs   hBlockss   canvs   lines   canvLines   counts   ys   _hLines   spaces   lf(   s   selfs   .2s   .4s   weights   colors   counts   spaces   scs   srs   ecs   ers   lfs   canvLines   rps   hBlockss   ys   ecps   scp(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _drawHLines  s"   & 

  c         C   sL   | \ } } | \ }	 }
 |  i | | d f |	 |
 d f | | | | ƒ d  S(   Ni   (
   s   scs   srs   ecs   ers   selfs   _drawHLiness   weights   colors   counts   space(   s   selfs   .2s   .4s   weights   colors   counts   spaces   scs   srs   ecs   er(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _drawHLinesB®  s   c         C   s/  | \ } } | \ }	 }
 |  i | |
 d !} |  i | |	 d !} t	 | ƒ d j p t	 | ƒ d j  o d  Sn |  i
 | | ƒ | d } | d } t |  d h  ƒ } |  i i d „ } | d j o+ xe | D] } t | | | | | ƒ qÊ Wn> | | | | d „ } x$ | D] } t | | | | | ƒ qWd  S(   Ni   i   i    iÿÿÿÿs   _vBlocksc         C   s   | | |  | | ƒ S(   N(   s   _lines   x0s   y0s   x1s   y1(   s   y0s   x0s   y1s   x1s   _line(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   <lambda>¹  s    c         C   s   t  |  | | | | | ƒ S(   N(   s
   _multiLines   x0s   x1s   y0s   canvLines   wss   count(   s   x0s   y0s   x1s   y1s   canvLines   wss   count(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   <lambda>¾  s    (   s   scs   srs   ecs   ers   selfs   _rowpositionss   erps   _colpositionss   cps   lens	   _prepLines   weights   colors   srps   getattrs   vBlockss   canvs   lines   canvLines   counts   xs   _hLines   spaces   lf(   s   selfs   .2s   .4s   weights   colors   counts   spaces   scs   srs   ecs   ers   lfs   canvLines   erps   srps   vBlockss   xs   cp(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _drawVLines±  s"   & 

  c         C   sL   | \ } } | \ }	 }
 |  i | d | f |	 d |
 f | | | | ƒ d  S(   Ni   (
   s   scs   srs   ecs   ers   selfs   _drawVLiness   weights   colors   counts   space(   s   selfs   .2s   .4s   weights   colors   counts   spaces   scs   srs   ecs   er(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _drawVLinesAÂ  s   c         C   s-   |  i | | ƒ | |  _ |  i |  i f Sd  S(   N(   s   selfs   _calcs
   availWidths   availHeights   _widths   _height(   s   selfs
   availWidths   availHeight(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   wrapÅ  s    	c         C   s   d S(   s†   
        This method will be called when the Table is split.
        Special purpose tables can override to do special stuff.
        N(    (   s   selfs   Ts   byRow(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   onSplitË  s     c         C   s¡   xš | D]’ } t | ƒ } | d d !\ \ } } \ } } | | j o q n | | j o | d } n |  i	 | d f | | f | | f f | d ƒ q Wd  S(   Ni   i   i    (
   s   cmdss   cs   tuples   scs   srs   ecs   ers   ns   selfs   _addCommand(   s   selfs   ns   cmdss   cs   srs   ecs   scs   er(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _cr_0Ò  s       c   	      C   s~  xw| D]o} t | ƒ } | d d !\ \ } } \ } } | d d f j o |  i | ƒ q | d j o1 | | j o$ | | j  o | d j o
 | | j  o q n | | j o
 | | j  o
 | } n- | | j o
 | | j o | | | } n | | j o
 | | j  o
 | } n- | | j o
 | | j o | | | } n |  i | d f | | f | | f f | d ƒ q Wd  S(   Ni   i   s
   splitfirsts	   splitlasti    (   s   cmdss   cs   tuples   scs   srs   ecs   ers   selfs   _addCommands
   repeatRowss   n(	   s   selfs   ns
   repeatRowss   cmdss   cs   srs   ecs   scs   er(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _cr_1_1Ú  s"      A  
  
 c         C   s  x
| D]} t | ƒ } | d d !\ \ } } \ } } | d d f j o |  i | ƒ q | d j o
 | | j  o q n | d j o
 | | j  o
 d } n | | j o | | } n | | j o | | } n |  i | d f | | f | | f f | d ƒ q Wd  S(   Ni   i   s
   splitfirsts	   splitlasti    (
   s   cmdss   cs   tuples   scs   srs   ecs   ers   selfs   _addCommands   n(   s   selfs   ns   cmdss   cs   srs   ecs   scs   er(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _cr_1_0ç  s        
  c         C   s  |  i | ƒ } | |  i j o g  Sn t |  i ƒ }
 | |
 j o |  g Sn |  i } |  i } |  i	 } |  i
 } |  i | |  |  i |  i |  d | d | d | ƒ} |  i |  | _ g  } x¬|  i D]¡\
 } \ } } \ } } } } } } } } }	 t | ƒ t d ƒ j o | i  d ƒ ow | i! | | | f | | f | | | | | | |	 f
 ƒ | d j o | d } } q—| d j o | } | } q—n | d	 j  o | |  i" } n | d	 j  o | |  i" } n | d	 j  o | |  i# } n | d	 j  o | |  i# } n | d
 d d f j oó| | j  o
 | | j ož| i! d | | f | | f | | | | | | |	 f
 ƒ | i! d | | f | | f | | | | | | |	 f
 ƒ | i! d | | f | | f | | | | | | |	 f
 ƒ | i! d | | f | | f | | | | | | |	 f
 ƒ | d j o± | i! d | | d f | | d f | | | | | | |	 f
 ƒ | i! d | | f | | f | | | | | | |	 f
 ƒ | i! d | | f | | f | | | | | | |	 f
 ƒ qqh| i! | | | f | | f | | | | | | |	 f
 ƒ qÇ | d d f j oÏ | | j  o
 | | j oz | i! d | | d f | | d f | | | | | | |	 f
 ƒ | i! d | | f | | f | | | | | | |	 f
 ƒ n | i! | | | f | | f | | | | | | |	 f
 ƒ qÇ | d j o… | | j  o | | d j o; | i! d | | f | | f | | | | | | |	 f
 ƒ n | i! | | | f | | f | | f ƒ qÇ | d j o˜ | | j o
 | | j oC | i! d | | d f | | d f | | | | | | |	 f
 ƒ n | i! | | | f | | f | | | | | | |	 f
 ƒ qÇ | i! | | | f | | f | | | | | | |	 f
 ƒ qÇ W| i$ | | ƒ | i$ | |  i% ƒ | i$ | |  i& ƒ | o¦ |  i | |  | | |  i |  i |  |  i | d | d | d | ƒ} |  i |  |  i | | _ | i( | | | ƒ | i( | | |  i% ƒ | i( | | |  i& ƒ n| |  i | | |  i |  i | d | d | d | ƒ} |  i | | _ | i) | | ƒ | i) | |  i% ƒ | i) | |  i& ƒ |  i* | _* | _* |  i+ | _+ | _+ |  i, | ƒ |  i, | ƒ | | g Sd  S(   Ns
   repeatRowss
   repeatColss
   splitByRows    s   splits	   splitlasti   s
   splitfirsti    s   BOXs   OUTLINEs   GRIDs	   LINEABOVEs
   LINEBEFOREs	   LINEAFTERs	   LINEBELOWs	   INNERGRID(-   s   selfs!   _getFirstPossibleSplitRowPositions   availHeights   ns
   repeatRowss   lens   _rowHeightss   lims
   repeatColss
   splitByRows   _cellvaluess   datas	   __class__s
   _colWidthss   _argHs   R0s   _cellStyless   As	   _linecmdss   ops   scs   srs   ecs   ers   weights   colors   caps   dashs   joins   counts   spaces   types
   startswiths   appends   _ncolss   _nrowss   _cr_0s   _bkgrndcmdss	   _spanCmdss   R1s   _cr_1_1s   _cr_1_0s   hAligns   vAligns   onSplit(   s   selfs   availHeights   weights   colors   ecs   dashs
   repeatColss   ers
   repeatRowss   spaces   lims   As   R0s   R1s
   splitByRows   datas   counts   joins   srs   caps   ns   scs   op(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys
   _splitRowsó  s¢      				
 0)7    7777?7?;?;;;,C;;c         C   sG  |  i oÄ h  }
 xÁ |  i D]¬ } |  i | } | t j oŒ | d | d f \ }	 } |	 | j oa t
 |	 | ƒ } t |	 | ƒ } | d } x6 n o* | | j o Pn t |
 | <| d } q“ WqÆ q q Wn h  }
 d } d } d } xV |  i D]K } | | | j o Pn |
 i | ƒ o
 | } n | | } | d } qð W| Sd  S(   Ni   i   i    (   s   selfs	   _spanCmdss
   impossibles   _rowSpanCellss   xys   _spanRangess   rs   Nones   y1s   y2s   mins   ymins   maxs   ymaxs   ys   hs   ns   split_ats   _rowHeightss   rhs   availHeights   has_key(   s   selfs   availHeights   y2s   ymaxs   ys   ymins   xys   ns   hs   y1s
   impossibles   rs   rhs   split_at(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys!   _getFirstPossibleSplitRowPositionS  s<    

 
  

 

c         C   sX   |  i | | ƒ |  i o4 t i o |  i | j o g  Sn |  i | ƒ Sn t	 ‚ d  S(   N(
   s   selfs   _calcs
   availWidths   availHeights
   splitByRows	   rl_configs   allowTableBoundsErrorss   _widths
   _splitRowss   NotImplementedError(   s   selfs
   availWidths   availHeight(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   splitp  s    
 c         C   s‹  t  |  _ |  _ |  _ |  i ƒ  |  i g  j ož xIt t  |  i |  i	 |  i
 d |  i ƒ D]m \ } } } } xX t t  | | |  i d  |  i ƒ D]4 \ }	 } } } |  i |	 | | | f | | f ƒ q WqZ Wn¯ x« t |  i ƒ D]š } x‘ t |  i ƒ D]€ } |  i | | f } | t  j	 oZ | \ }
 } } } |  i | | }	 |  i	 | | } |  i |	 | |
 | f | | f ƒ qõ qõ Wqß W|  i" ƒ  d  S(   Ni   iÿÿÿÿ(#   s   Nones   selfs
   _curweights	   _curcolors   _curcellstyles   _drawBkgrnds	   _spanCmdss   maps   _cellvaluess   _cellStyless   _rowpositionss   _rowHeightss   rows   rowstyles   rowposs	   rowheights   _colpositionss
   _colWidthss   cellvals	   cellstyles   colposs   colwidths	   _drawCells   ranges   _nrowss   rowNos   _ncolss   colNos
   _spanRectss   cellRects   xs   ys   widths   heights
   _drawLines(   s   selfs   cellRects	   rowheights   colNos   colposs   rowstyles	   cellstyles   heights   widths   cellvals   xs   ys   rowNos   colwidths   rowposs   row(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   drawx  s&    
) # .  .c         C   sö  |  i } |  i } xÝ|  i D]Ò\ } \ } } \ } } } | d j  o | | } n | d j  o | | } n | d j  o | | } n | d j  o | | } n |  i | } |  i | } |  i t | d | ƒ } |  i t | d | ƒ } | | | | f \ } } |  i } t | ƒ o# t | |  | | | | | f ƒ q | d j o« t t i | ƒ }	 t |	 ƒ } | | d }
 xkt |
 ƒ D]j } |	 | | } |  i" | | } | o4 | i# | ƒ | i$ | | | | d d d d ƒn | | } qWq | d j oª t t i | ƒ }	 t |	 ƒ } | | d } x³ t | ƒ D]i } |	 | | } |  i& | | } | o3 | i# | ƒ | i$ | | | | d d d d ƒn | | } qEWq | i# t i' | ƒ ƒ | i$ | | | | d d d d ƒq Wd  S(   Ni    i   s   ROWBACKGROUNDSs   strokes   fills   COLBACKGROUNDS((   s   selfs   _nrowss   nrowss   _ncolss   ncolss   _bkgrndcmdss   cmds   scs   srs   ecs   ers   args   _colpositionss   x0s   _rowpositionss   y0s   mins   x1s   y1s   ws   hs   canvs   callables   applys   maps   colorss   toColorOrNones
   colorCycles   lens   counts   rowCounts   ranges   is   colors   _rowHeightss   setFillColors   rects   colCounts
   _colWidthss   toColor(   s   selfs   colors   ecs   canvs   args   y1s   y0s   ers   ncolss
   colorCycles   rowCounts   x0s   x1s   counts   nrowss   is   srs   cmds   colCounts   ws   hs   sc(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _drawBkgrndŽ  s\    		
     	# ' &c      
   C   s,  | \ } } | \ } } |  i | j	 o¶ |  i } | t j p | i	 | i	 j o |  i
 i | i	 ƒ n | t j p6 | i | i j p# | i | i j p | i | i j o# |  i
 i | i | i | i ƒ n | |  _ n | i }	 | i } t | ƒ } | t j p t | t ƒ oÌ| t j o | f } n g  } g  } |  i | | | d | d | d | ƒ\ } } | d j o | | | i } nC | d j o | | i  | } n! | | | i  | i | d } | o | | d i! ƒ  7} n x³t" t | | | ƒ D]× \ } } } |	 d j o | | i$ } nk |	 d	 j o | | | i& | } nE |	 d
 d f j o$ | | | i$ | i& | d } n t' d |	 ‚ | | i! ƒ  8} | | 8} | i( |  i
 | | ƒ | | i) ƒ  8} qWnÂ|	 d j o |  i
 i* }
 | | i$ } n› |	 d
 d f j o |  i
 i, }
 | | d } nj |	 d	 j o! |  i
 i- }
 | | | i& } n< |	 d j o! |  i
 i. }
 | | | i& } n t' d |	 ‚ t/ i0 t1 | ƒ d ƒ } t3 | ƒ } | i } | i } | d j o | | i  | | | } ns | d j o | | | i | } nM | d j o, | | i  | | i | | d | } n t' d t1 | ƒ ‚ x( | D]  } |
 | | | ƒ | | 8} q‚W| i4 o4 |  i
 i5 | i4 | | | | | | f d d ƒn | i6 o: |  i
 i7 d | i6 d | | | | | | f d d ƒn d  S(   Ns   Ws   Hs   aHs   TOPs   BOTTOMf2.0i    s   LEFTs   RIGHTs   CENTREs   CENTERs   Invalid justification %sf0.5s   DECIMALs   
s   MIDDLEs   Bad valign: '%s's   relativei   s    s   Rect(8   s   colposs   rowposs   colwidths	   rowheights   selfs   _curcellstyles	   cellstyles   curs   Nones   colors   canvs   setFillColors   leadings   fontnames   fontsizes   setFonts	   alignments   justs   valigns   types   cellvals   ns	   _SeqTypess
   isinstances   Flowables   Ws   Hs   _listCellGeoms   ws   hs
   topPaddings   ys   bottomPaddings   getSpaceBefores   maps   vs   leftPaddings   xs   rightPaddings
   ValueErrors   drawOns   getSpaceAfters
   drawStrings   draws   drawCentredStrings   drawRightStrings   drawAlignedStrings   strings   splits   strs   valss   lens   hrefs   linkURLs   destinations   linkRect(   s   selfs   cellvals	   cellstyles   .6s   .8s   colposs   rowposs   colwidths	   rowheights   justs   draws   curs   leadings   valigns   Hs   fontsizes   Ws   valss   hs   ns   ws   vs   ys   x(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys	   _drawCell¾  sˆ   	 F#		 -     $
		, 
4
()   s   __name__s
   __module__s   Nones   __init__s   __repr__s   normalizeDatas   identitys   _listCellGeoms   _calc_widths   _elementWidths   _calc_heights   _calcs   _hasVariWidthElementss   _canGetWidths   _calcPreliminaryWidthss   minWidths   _calcSpanRangess   _calcSpanRectss   setStyles   _addCommands
   _drawLiness   _drawUnknowns	   _drawGrids   _drawBoxs   _drawInnerGrids	   _prepLines   _drawHLiness   _drawHLinesBs   _drawVLiness   _drawVLinesAs   wraps   onSplits   _cr_0s   _cr_1_1s   _cr_1_0s
   _splitRowss!   _getFirstPossibleSplitRowPositions   splits   draws   _drawBkgrnds	   _drawCell(    (    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   TableÎ   sL   '@	
	$*	E			”		1	'		7															`				0s   GRIDs	   _drawGrids   BOXs   _drawBoxs   OUTLINEs	   INNERGRIDs   _drawInnerGrids	   LINEBELOWs   _drawHLinesBs	   LINEABOVEs   _drawHLiness
   LINEBEFOREs   _drawVLiness	   LINEAFTERs   _drawVLinesAs	   LongTablec           B   s   t  Z d  Z d Z RS(   s+   Henning von Bargen's changes will be activei   (   s   __name__s
   __module__s   __doc__s   _longTableOptimize(    (    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys	   LongTable  s    c         C   s   |  d t j Sd  S(   Ni    (   s   cmds   LINECOMMANDS(   s   cmd(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _isLineCommand  s    c         C   s  |  | | } | d j oi t | ƒ } | d | _ | d j o? | d | _	 | d j o | d | _
 q€ | i	 d | _
 qn–| d d f j o | d | _ nr| d d	 f j o | d | _	 nN| d
 j o | d | _
 n0| d j o, t i | d t i d d d ƒ ƒ | _ n÷ | d d f j o | d | _ nÓ | d j o | d | _ nµ | d j o | d | _ n— | d j o | d | _ ny | d j o | d | _ n[ | d j o | d | _ n= | d j o | d | _ n | d j o | d | _ n d  S(   Ns   FONTi    i   i   f1.2s   FONTNAMEs   FACEs   SIZEs   FONTSIZEs   LEADINGs	   TEXTCOLORs   ALIGNs	   ALIGNMENTs   VALIGNs   LEFTPADDINGs   RIGHTPADDINGs
   TOPPADDINGs   BOTTOMPADDINGs   HREFs   DESTINATION(   s
   cellStyless   is   js   news   ops   lens   valuess   ns   fontnames   fontsizes   leadings   colorss   toColors   Colors   colors	   alignments   valigns   leftPaddings   rightPaddings
   topPaddings   bottomPaddings   hrefs   destination(   s
   cellStyless   is   js   ops   valuess   ns   new(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   _setCellStyle  sB    ,iÿÿÿÿf0.25s   ALIGNs   RIGHTf0.5s   __main__(   s   old_tables_test(:   s   __version__s   __doc__s   reportlab.platypus.flowabless   Flowables   Preformatteds	   reportlabs	   rl_configs   reportlab.lib.styless   PropertySets   ParagraphStyles   reportlab.libs   colorss   reportlab.lib.utilss   fp_strs   reportlab.pdfbases
   pdfmetricss   operators   strings   typess	   TupleTypes   ListTypes
   StringTypes	   FloatTypes   IntTypes	   CellStyles   Nones   LINECAPSs	   LINEJOINSs
   CellStyle1s
   TableStyles   types   TableStyleTypes	   _SeqTypess   _rowLens   _calc_pcs   _FUZZs   _hLines
   _multiLines   _convert2ints	   _endswiths   Tables
   _LineOpMaps	   LongTables   keyss   LINECOMMANDSs   _isLineCommands   _setCellStyles   blacks
   GRID_STYLEs	   BOX_STYLEs   LABELED_GRID_STYLEs   reds   COLORED_GRID_STYLEs   greens
   LIST_STYLEs   __name__s#   reportlab.test.test_platypus_tabless   old_tables_test(*   s   IntTypes   Flowables   Preformatteds   colorss   operators   COLORED_GRID_STYLEs   fp_strs
   StringTypes	   CellStyles   LINECOMMANDSs	   _SeqTypess	   FloatTypes
   LIST_STYLEs   PropertySets	   _endswiths   LABELED_GRID_STYLEs	   rl_configs   _setCellStyles   __version__s   __doc__s   ParagraphStyles   strings   _rowLens
   _multiLines
   pdfmetricss	   BOX_STYLEs   Tables   ListTypes   _isLineCommands	   TupleTypes   old_tables_tests   _calc_pcs
   _LineOpMaps   TableStyleTypes   _convert2ints
   TableStyles	   LINEJOINSs
   GRID_STYLEs   LINECAPSs   _hLines
   CellStyle1s	   LongTable(    (    sC   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/tables.pys   ?   sR   %33		0			ÿ ÿ ÿ ÿ @N			'HH««Š