;
0sDc           @   s	  d  Z  d k Z d k Z d k l Z l Z l Z d k Z d k Z d k	 Z	 d k
 Z d k l Z d k l Z d k l Z l Z l Z l Z l Z d k l Z l Z d k l Z l Z l Z l Z d k l Z l  Z  l! Z! l" Z" e i# d	  Z$ d
 Z% d Z& d Z' d d  Z( d   Z) h  d d e* f <d d e* f <d d e( f <d d e( f <d d e( f <d d e( f <d d e( f <d d e( f <d d e) f <d d e( f <d  d! e( f <d" d# e* f <d$ d% e( f <d& d' e( f <d( d) e f <d* d+ e f <d, d- e f <d. d- e f <d/ d- e f <d0 d+ e f <Z+ h  d d# e* f <d d# e* f <d d% e( f <d d% e( f <d1 d' e( f <d* d) e f <d0 d) e f <Z, h  d d e( f <d d e* f <d2 d e* f <d0 d+ e f <d* d+ e f <d, d- e f <d. d- e f <Z- h  d d e( f <d d e* f <d2 d e* f <d0 d+ e f <d* d+ e f <d, d- e f <d. d- e f <d3 d4 e* f <d5 d4 e* f <d6 d4 e* f <d7 d4 e* f <Z. d8   Z/ e/ e+  e/ e-  e/ e,  d9   Z0 h  d: d; <d< d= <d> d? <d@ dA <dB dC <dD dE <dF dG <dH dI <dJ dK <dL dM <dN dO <dP dQ <dR dS <dT dU <dV dW <dX dY <dZ d[ <d\ d] <d^ d_ <d` da <db dc <dd de <df dg <dh di <dj dk <dl dk <dm dn <do dp <dq dr <ds dt <du dv <dw dx <dy dz <d{ d| <d} d~ <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <d d <dd<dd<dd<dd<dd	<d
d<dd<dd<dd<dd<dd<dd<dd<dd<dd<dd<d d<d!d"<d#d$<d%d&<d'd(<d)d*<d+d,<d-d.<d/d0<d1d2<d3d4<d5d6<Z1 d7e f d8    YZ2 e* a3 d9  Z4 d:e i5 f d;    YZ6 e7 d<j od=k8 l9 Z9 e6   Z: e: d> Z; e2   Z< d?e< _= d@e< _> e e< _? e e< _@ d?e< _@ d@e< _A dAZB e; eB  e; dB e; dC e; dD e; dE e; dF e; dG e; dH e; dI e; dJ e; dK e; dL e; dM e; dN dOe: _C e; dP e; dQ e; dR n d S(S  s9    $Id: paraparser.py 2853 2006-05-10 12:56:39Z rgbecker $ N(   s	   TupleTypes   UnicodeTypes
   StringType(   s   ABag(   s   xmllib(   s   toColors   whites   blacks   reds   Color(   s   tt2pss   ps2tt(   s   TA_LEFTs   TA_RIGHTs	   TA_CENTERs
   TA_JUSTIFY(   s   inchs   mms   cms   picas   ^\s*<\s*para(?:\s+|>|/>)i   f0.5i   c         C   su  |  d d j o t } |  d  }  n |  d d j o t } |  d  }  n |  d d j o d } |  d  }  n |  d d j o t } |  d  }  n |  d d j o t } |  d  }  n |  d	 d
 j o t } |  d	  }  n |  d d d g j oF y d t |   | f SWqqt j
 o d t |   | f SqqXn7 y t |   | SWn! t j
 o t |   | Sn Xd S(   s   Convert a string like '10cm' to an int or float (in points).
       The default unit is point, but optionally you can use other
       default units like mm.
    is   cms   ins   pti   is   is   mmis   picai    s   +s   -s   relativeN(	   s   ss   cms   units   inchs   mms   picas   ints
   ValueErrors   float(   s   ss   unit(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   _num   s8     c         C   ss   t  i |   }  |  d j o t SnL |  d j o t Sn7 |  d j o t Sn" |  d d f j o t Sn t  d  S(   Ns   lefts   rights   justifys   centres   center(   s   strings   lowers   ss   TA_LEFTs   TA_RIGHTs
   TA_JUSTIFYs	   TA_CENTERs
   ValueError(   s   s(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   _align=   s        s   fonts   fontNames   faces   fontsizes   fontSizes   sizes   leadings   lindents
   leftIndents   rindents   rightIndents   findents   firstLineIndents   aligns	   alignments   spacebs   spaceBefores   spaceas
   spaceAfters   bfonts   bulletFontNames	   bfontsizes   bulletFontSizes   bindents   bulletIndents   bcolors   bulletColors   colors	   textColors	   backcolors	   backColors   bgcolors   bgs   fgs   indents   names   dests   links   destinations   targets   hrefc         C   s   |  i   } xq | D]i } |  | d } |  i |  o |  | |  | <n t i |  } |  i |  o |  | |  | <q q Wd  S(   Ni    (   s   ms   keyss   Ks   ks   ns   has_keys   strings   lower(   s   ms   Ks   ks   n(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   _addAttributeNames|   s       c         C   s   x | i   D]y \ } } t |  t j o | d d j o9 t |  |  o | d t |  |  } qv | d } n t	 |  | |  q Wd  S(   Ni    s   relativei   (
   s   attrs   itemss   ks   vs   types	   TupleTypes   hasattrs   objs   getattrs   setattr(   s   objs   attrs   ks   v(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   _applyAttributes   s     $s   pounds   £s   nbsps    s   alefsyms   ℵs   Alphas   Αs   alphas   αs   ands   ∧s   angs   ∠s   asymps   ≈s   Betas   Βs   betas   βs   bulls   •s   caps   ∩s   Chis   Χs   chis   χs   clubss   ♣s   congs   ≅s   cups   ∪s   darrs   ↓s   dArrs   ⇓s   deltas   δs   Deltas   ∆s   diamss   ♦s   emptys   ∅s   Epsilons   Εs   epsilons   εs   epsivs   equivs   ≡s   Etas   Ηs   etas   ηs   euros   €s   exists   ∃s   foralls   ∀s   frasls   ⁄s   Gammas   Γs   gammas   γs   ges   ≥s   harrs   ↔s   hArrs   ⇔s   heartss   ♥s   hellips   …s   images   ℑs   infins   ∞s   ints   ∫s   Iotas   Ιs   iotas   ιs   isins   ∈s   Kappas   Κs   kappas   κs   Lambdas   Λs   lambdas   λs   langs   〈s   larrs   ←s   lArrs   ⇐s   lceils   s   les   ≤s   lfloors   s   lowasts   ∗s   lozs   ◊s   minuss   −s   mus   µs   Mus   Μs   nablas   ∇s   nes   ≠s   nis   ∋s   notins   ∉s   nsubs   ⊄s   Nus   Νs   nus   νs   olines   s   omegas   ωs   Omegas   Ωs   Omicrons   Οs   omicrons   οs   opluss   ⊕s   ors   ∨s   otimess   ⊗s   parts   ∂s   perps   ⊥s   Phis   Φs   phis   ϕs   phiss   φs   Pis   Πs   pis   πs   pivs   ϖs   primes   ′s   prods   ∏s   props   ∝s   Psis   Ψs   psis   ψs   radics   √s   rangs   〉s   rarrs   →s   rArrs   ⇒s   rceils   s   reals   ℜs   rfloors   s   Rhos   Ρs   rhos   ρs   sdots   ⋅s   Sigmas   Σs   sigmas   σs   sigmafs   ςs   sigmavs   sims   ∼s   spadess   ♠s   subs   ⊂s   subes   ⊆s   sums   ∑s   sups   ⊃s   supes   ⊇s   Taus   Τs   taus   τs   there4s   ∴s   Thetas   Θs   thetas   θs   thetasyms   ϑs   thetavs   trades   s   uarrs   ↑s   uArrs   ⇑s   upsihs   ϒs   Upsilons   Υs   upsilons   υs   weierps   ℘s   Xis   Ξs   xis   ξs   Zetas   Ζs   zetas   ζs   ParaFragc           B   s   t  Z d  Z RS(   s   class ParaFrag contains the intermediate representation of string
    segments as they are being parsed by the XMLParser.
    fontname, fontSize, rise, textColor, cbDefn
    (   s   __name__s
   __module__s   __doc__(    (    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   ParaFrag  s   c         C   s   t  o d k l } d  k } | i t d d   } } x! t d d  D] } t	 | | <qJ W| i
 | i d d  h  a  xU | i   D]C \ } } | o
 d } n t |  i d  } | t  t |  <q Wn d i t t  i |    Sd  S(	   N(   s	   RL_Codecsi    i   i    s   symbols    s   utf8s    (   s   _greek2Utf8s   reportlab.pdfbase.rl_codecss	   RL_Codecss   codecss   make_identity_dicts   xranges   dms   decoding_maps   ks   Nones   updates   _RL_Codecs__rl_codecs_datas	   iteritemss   vs   us   unichrs   encodes   chrs   joins   maps   __getitem__s   data(   s   datas	   RL_Codecss   dms   ks   vs   decoding_maps   codecss   u(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   _greekConvert"  s"     	  
s
   ParaParserc           B   s<  t  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 e Z e 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( e' Z) d'   Z* e' Z+ e$ Z, e% Z- e& Z. e' Z/ e( Z0 e) Z1 e* Z2 e+ Z3 d(   Z4 d)   Z5 d*   Z6 d+   Z7 d,   Z8 d-   Z9 d d.  Z: d/   Z; d0   Z< d1   Z= d2   Z> d3   Z? d4   Z@ d5   ZA d6   ZB d7   ZC RS(8   Nc         C   so   | | i   j o5 | d j o( |  i o | i d  p | i d  o t |  | i    Sn t |  d S(   sC   This way we can handle <TAG> the same way as <tag> (ignoring case).s   caseSensitives   start_s   end_N(   s   attrNames   lowers   selfs   caseSensitives
   startswiths   getattrs   AttributeError(   s   selfs   attrName(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   __getattr__Y  s     Kc         C   s   |  i d d  d  S(   Ns   boldi   (   s   selfs   _push(   s   selfs
   attributes(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   start_ba  s    c         C   s   |  i d d  d  S(   Ns   boldi   (   s   selfs   _pop(   s   self(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   end_bd  s    c         C   s   |  i d d  d  S(   Ns   boldi   (   s   selfs   _push(   s   selfs
   attributes(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   start_strongg  s    c         C   s   |  i d d  d  S(   Ns   boldi   (   s   selfs   _pop(   s   self(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys
   end_strongj  s    c         C   s   |  i d d  d  S(   Ns   italici   (   s   selfs   _push(   s   selfs
   attributes(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   start_in  s    c         C   s   |  i d d  d  S(   Ns   italici   (   s   selfs   _pop(   s   self(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   end_iq  s    c         C   s   |  i d d  d  S(   Ns   italici   (   s   selfs   _push(   s   selfs
   attributes(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   start_emt  s    c         C   s   |  i d d  d  S(   Ns   italici   (   s   selfs   _pop(   s   self(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   end_emw  s    c         C   s   |  i d d  d  S(   Ns	   underlinei   (   s   selfs   _push(   s   selfs
   attributes(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   start_u{  s    c         C   s   |  i d d  d  S(   Ns	   underlinei   (   s   selfs   _pop(   s   self(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   end_u~  s    c         C   s   |  i |  i | t    d  S(   N(   s   selfs   _pushs   getAttributess
   attributess   _linkAttrMap(   s   selfs
   attributes(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys
   start_link  s    c         C   s2   |  i d } |  i d =| i t j p t  d  S(   Ni(   s   selfs   _stacks   frags   links   Nones   AssertionError(   s   selfs   frag(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   end_link  s    
c         C   s   |  i d d  d  S(   Ns   superi   (   s   selfs   _push(   s   selfs
   attributes(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   start_super  s    c         C   s   |  i d d  d  S(   Ns   superi   (   s   selfs   _pop(   s   self(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys	   end_super  s    c         C   s   |  i d d  d  S(   Ns   subi   (   s   selfs   _push(   s   selfs
   attributes(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys	   start_sub  s    c         C   s   |  i d d  d  S(   Ns   subi   (   s   selfs   _pop(   s   self(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   end_sub  s    c         C   s   y8 | d d j o t | d d  } n t |  } Wn$ t j
 o |  i |  d  Sn X|  i t |  i d   d  S(   Ni    s   xi   i   s   utf8(	   s   names   ints   ns
   ValueErrors   selfs   unknown_charrefs   handle_datas   unichrs   encode(   s   selfs   names   n(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   handle_charref  s    	c         C   s<   t  i |  o |  i t  |  n t i i |  |  d  S(   N(   s   greekss   has_keys   names   selfs   handle_datas   xmllibs	   XMLParsers   handle_entityref(   s   selfs   name(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   handle_entityref  s    c         C   s   |  i |  d  S(   N(   s   selfs   _syntax_errors   message(   s   selfs   linenos   message(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   syntax_error  s    c         C   s>   | d  d j o | d d j o d  Sn |  i i |  d  S(   Ni
   s
   attribute is    value not quoted(   s   messages   selfs   errorss   append(   s   selfs   message(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   _syntax_error  s    " c         C   s   |  i d d  d  S(   Ns   greeki   (   s   selfs   _push(   s   selfs   attr(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   start_greek  s    c         C   s   |  i d d  d  S(   Ns   greeki   (   s   selfs   _pop(   s   self(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys	   end_greek  s    c         C   sB  | i d  or | i d  o |  i d  n y  t i | d  i d  } Wqt j
 o |  i d t	  d } qXn | i d  oR y) t
 t t | d    i d  } Wq|  i d | d  d } qXn- t } | o |  i d | i   d	  n | t j	 o |  i |  n |  i d
 d  d  S(   Ns   names   codes5   <unichar/> invalid with both name and code attributess   utf8s&   <unichar/> invalid name attribute
"%s"s    s$   <unichar/> invalid code attribute %ss   <unichar/> invalid attribute %si    s   _selfClosingTags   unichar(   s   attrs   has_keys   selfs   _syntax_errors   unicodedatas   lookups   encodes   vs   KeyErrors   names   unichrs   ints   evals   Nones   keyss   handle_datas   _push(   s   selfs   attrs   v(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   start_unichar  s(     )c         C   s   |  i   d  S(   N(   s   selfs   _pop(   s   self(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   end_unichar  s    c         C   s   |  i |  i | t    d  S(   N(   s   selfs   _pushs   getAttributess   attrs   _fontAttrMap(   s   selfs   attr(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys
   start_font  s    c         C   s   |  i   d  S(   N(   s   selfs   _pop(   s   self(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   end_font  s    i    c         C   s)  |  i } | h  j o5 t i |  } t | |  i | |   | |  _ n t	   } d | _ d | _ d | _ d | _ d | _ t | _ | oW t | i  \ | _ | _ | _ | i | _ t | d  o | i p | i | _ n: t | i  \ | _ | _ | _ | i | _ | i | _ | Sd  S(   Ni    s   bulletColor(   s   selfs   _styles   styles   attrs   copys   deepcopys   _applyAttributess   getAttributess   attrMaps   ParaFrags   frags   subs   supers   rises	   underlines   greeks   Nones   links   bullets   ps2tts   bulletFontNames   fontNames   bolds   italics   bulletFontSizes   fontSizes   hasattrs   bulletColors	   textColor(   s   selfs   attrs   attrMaps   bullets   frags   style(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   _initial_frag  s(    								!*!c         C   s   |  i | t  g |  _ d  S(   N(   s   selfs   _initial_frags   attrs   _paraAttrMaps   _stack(   s   selfs   attr(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys
   start_para  s    c         C   s   |  i   d  S(   N(   s   selfs   _pop(   s   self(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   end_para  s    c         C   s\   t  |  d  o |  i d  n g  |  _ |  i | t d  } d | _ |  i	 i
 |  d  S(   Ns	   bFragLists   only one <bullet> tag allowedi   (   s   hasattrs   selfs   _syntax_errors	   bFragLists   _initial_frags   attrs   _bulletAttrMaps   frags   isBullets   _stacks   append(   s   selfs   attrs   frag(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   start_bullet  s    		c         C   s   |  i   d  S(   N(   s   selfs   _pop(   s   self(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys
   end_bullet  s    c         C   s>   y | d } Wn t j
 o t } n X|  i i |  d  S(   Ns   id(   s   attrs   defaults   KeyErrors   Nones   selfs   _seqs   setDefaultCounter(   s   selfs   attrs   default(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   start_seqdefault  s
    c         C   s   d  S(   N(    (   s   self(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   end_seqdefault  s    c         C   se   y | d } Wn t j
 o t } n Xy t | d  } Wn d } n X|  i i | |  d  S(   Ns   ids   basei    (	   s   attrs   ids   KeyErrors   Nones   ints   bases   selfs   _seqs   reset(   s   selfs   attrs   bases   id(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   start_seqreset  s    
c         C   s   d  S(   N(    (   s   self(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   end_seqreset  s    c         C   s{   y | d } Wn t j
 o d } n X| i   } |  i } x5 t | d  | d  D] \ } } | i
 | |  qW Wd  S(   Ns   orders    ii   (   s   attrs   orders   KeyErrors   splits   selfs   _seqs   seqs   zips   ps   cs   chain(   s   selfs   attrs   cs   seqs   ps   order(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   start_seqchain  s    	 c         C   sk   y | d } Wn t j
 o t } n Xy | d } Wn t j
 o d } n X|  i i | |  d  S(   Ns   ids   values   1(   s   attrs   ids   KeyErrors   Nones   values   selfs   _seqs	   setFormat(   s   selfs   attrs   values   id(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   start_seqformat*  s    c         C   s}   | i d  o& | d } |  i | |  i  d  Sn% | i d  o | d } n t } |  i i |  } |  i |  d  S(   Ns   templates   id(
   s   attrs   has_keys   templs   selfs   handle_datas   _seqs   ids   Nones   nextfs   output(   s   selfs   attrs   templs   outputs   id(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys	   start_seqA  s    
c         C   s   d  S(   N(    (   s   self(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   end_seqO  s    c         C   s   t    } | i d  o | d | _ n |  i d  | i d  o | d | _ n d | _ |  i	 d |  |  i
 d  |  i   d  S(   Ns   names(   <onDraw> needs at least a name attributes   labels   onDraws   cbDefns    (   s   ABags   defns   attrs   has_keys   names   selfs   _syntax_errors   labels   kinds   _pushs   handle_datas   _pop(   s   selfs   attrs   defn(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   start_onDrawR  s    	  	c         K   s7   t  i  |  i d  } t | |  |  i i |  d  S(   Ni(   s   copys   selfs   _stacks   frags   _applyAttributess   attrs   append(   s   selfs   attrs   frag(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   _push^  s    c         K   sY   |  i d } |  i d =x7 | i   D]) \ } } t | |  | j p t  q$ W| Sd  S(   Ni(	   s   selfs   _stacks   frags   kws   itemss   ks   vs   getattrs   AssertionError(   s   selfs   kws   frags   vs   k(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   _popc  s    
 !c         C   s   h  } x | i   D] \ } } |  i o t i |  } n | | i
   j oe | | } | d } y, | t j o | p
 | |  | | d <Wq |  i d | | f  q Xq |  i d |  q W| Sd  S(   Ni   i    s   %s: invalid value %ss   invalid attribute name %s(   s   As   attrs   itemss   ks   vs   selfs   caseSensitives   strings   lowers   attrMaps   keyss   js   funcs   Nones   _syntax_error(   s   selfs   attrs   attrMaps   As   funcs   ks   js   v(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   getAttributesj  s     

,c         C   s#   d |  _ t i i |  d | d  S(   Ni    s   verbose(   s   selfs   caseSensitives   xmllibs	   XMLParsers   __init__s   verbose(   s   selfs   verbose(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   __init__|  s    	c         C   s.   g  |  _ t |  d  o t |  d  n d  S(   Ns	   bFragList(   s   selfs   fragLists   hasattrs   delattr(   s   self(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   _iReset  s    	 c         C   s0   t  i i |   g  |  _ | |  _ |  i   d S(   s   reset the parserN(   s   xmllibs	   XMLParsers   resets   selfs   errorss   styles   _styles   _iReset(   s   selfs   style(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   _reset  s
     		c         C   s  t  i  |  i d  } t | d  o | d j o t d  qGnt | d  o* | d j o t d | i  n d Sn | i d j o | i	 d j o d	 | _ d	 | _	 n | i o. | i
 t | _ t | i
 t d
  | _
 n8 | i	 o- | i
 t | _ t | i
 t d
  | _
 n | i o d | _ t |  } n t | i | i | i  } | _ | | _ t | d  o! t | d  |  i i |  n |  i i |  d S(   s:   Creates an intermediate representation of string segments.is   cbDefns    s   Only <onDraw> tag alloweds   _selfClosingTags   No content allowed in %s tagNi   i    i   s   symbols   isBullet(   s   copys   selfs   _stacks   frags   hasattrs   datas   syntax_errors   _selfClosingTags   subs   supers   fontSizes   subFractions   rises   maxs	   sizeDeltas   superFractions   greeks   fontNames   _greekConverts   tt2pss   bolds   italics   xs   texts   delattrs	   bFragLists   appends   fragList(   s   selfs   datas   frags   x(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   handle_data  s6        	


	"	c         C   s   |  i |  d  S(   N(   s   selfs   handle_datas   data(   s   selfs   data(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   handle_cdata  s    c         C   s&   t  i i i   |  _ |  i |  d  S(   N(   s	   reportlabs   libs	   sequencers   getSequencers   selfs   _seqs   _resets   style(   s   selfs   style(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   _setup_for_parse  s    c         C   s   d } |  _ t |  t j |  _ |  i o | i |  } n |  i |  t
 |  d j o | d d j o t i |  o d | d } n |  i |  |  i   |  i   Sd S(   s   Given a formatted string will return a list of
        ParaFrag objects with their calculated widths.
        If errors occur None will be returned and the
        self.errors holds a list of the error messages.
        s   cp1252i   i    s   <s   <para>s   </para>N(   s   encs   selfs   _encs   types   texts   UnicodeTypes   _UNIs   encodes   _setup_for_parses   styles   lens   _re_paras   matchs   feeds   closes   _complete_parse(   s   selfs   texts   styles   enc(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   parse  s     
5
c         C   s   |  ` |  i } |  ` t |  i  d j o7 |  i } t |  d  o |  i p t	 } |  i
   n t	 } } |  i ol | o- x* | D] } t | i |  i  | _ q Wn | o- x* | D] } t | i |  i  | _ q Wq n | | | f Sd  S(   Ni    s	   bFragList(   s   selfs   _seqs   _styles   styles   lens   errorss   fragLists   hasattrs	   bFragLists   Nones   _iResets   _UNIs   frags   unicodes   texts   _enc(   s   selfs   frags   styles   fragLists	   bFragList(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   _complete_parse  s$    		 

   $c         C   s   | d } y* t |  d |  } t |  d |  } Wn# t j
 o t d |   n X| | d p h   | d } | o8 |  i	 } x, | D]  } | t |  t j |  q Wn |   d  S(   Ni    s   start_s   end_s   Invalid tag "%s"i   i   (   s   tts   tags   getattrs   selfs   starts   ends   AttributeErrors
   ValueErrors   Cs   _tt_handlerss   Ms   cs   types	   TupleType(   s   selfs   tts   Cs   ends   Ms   cs   starts   tag(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys	   _tt_parse  s    

	 "c         C   s=   |  i |  |  i |  i f |  _ |  i |  |  i   Sd S(   s   parse from tupletree formN(   s   selfs   _setup_for_parses   styles   handle_datas	   _tt_parses   _tt_handlerss   tts   _complete_parse(   s   selfs   tts   style(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   tt_parse  s
     (D   s   __name__s
   __module__s   __getattr__s   start_bs   end_bs   start_strongs
   end_strongs   start_is   end_is   start_ems   end_ems   start_us   end_us
   start_links   end_links   start_supers	   end_supers	   start_sups   end_sups	   start_subs   end_subs   handle_charrefs   handle_entityrefs   syntax_errors   _syntax_errors   start_greeks	   end_greeks   start_unichars   end_unichars
   start_fonts   end_fonts   _initial_frags
   start_paras   end_paras   start_bullets
   end_bullets   start_seqdefaults   end_seqdefaults   start_seqresets   end_seqresets   start_seqchains   end_seqchains   start_seqformats   end_seqformats   start_seqDefaults   end_seqDefaults   start_seqResets   end_seqResets   start_seqChains   end_seqChains   start_seqFormats   end_seqFormats	   start_seqs   end_seqs   start_onDraws   _pushs   _pops   getAttributess   __init__s   _iResets   _resets   handle_datas   handle_cdatas   _setup_for_parses   parses   _complete_parses	   _tt_parses   tt_parse(    (    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys
   ParaParserI  s   																																						
								
	&					s   __main__(   s   cleanBlockQuotedTextc         C   s   d GHt  |   }  | i |  t  \ } } } | t j o x t	 i
 D] } | GHqC Wn d G| i G| i G| i GHxx | D]p } | i G| i G| i G| i G| i Gd | i d  Gt | d  o' d G| i i G| i i G| i i GHqw Hqw Wd  S(   Ns
   ##########s	   ParaStyles   |%s|i   s   cbDefn(   s   cleanBlockQuotedTexts   texts   ps   parses   styles   ls   rvs   bvs   Nones   _parsers   errorss   fontNames   fontSizes	   textColors   bolds   rises   hasattrs   cbDefns   names   labels   kind(   s   texts   ps   rvs   ls   bv(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys
   check_text  s    
  2's   Times-Romani   s  
    <b><i><greek>a</greek>D</i></b>&beta;<unichr value="0x394"/>
    <font name="helvetica" size="15" color=green>
    Tell me, O muse, of that ingenious hero who travelled far and wide
    after</font> he had sacked the famous town of Troy. Many cities did he visit,
    and many were the nations with whose manners and customs he was acquainted;
    moreover he suffered much by sea while trying to save his own life
    and bring his men safely home; but do what he might he could not save
    his men, for they perished through their own sheer folly in eating
    the cattle of the Sun-god Hyperion; so the god prevented them from
    ever reaching home. Tell me, too, about all these things, O daughter
    of Jove, from whatsoever source you<super>1</super> may know them.
    s   <para> </para>sm   <para font="times-bold" size=24 leading=28.8 spaceAfter=72>ReportLab -- Reporting for the Internet Age</para>s  
    <font color=red>&tau;</font>Tell me, O muse, of that ingenious hero who travelled far and wide
    after he had sacked the famous town of Troy. Many cities did he visit,
    and many were the nations with whose manners and customs he was acquainted;
    moreover he suffered much by sea while trying to save his own life
    and bring his men safely home; but do what he might he could not save
    his men, for they perished through their own sheer folly in eating
    the cattle of the Sun-god Hyperion; so the god prevented them from
    ever reaching home. Tell me, too, about all these things, O daughter
    of Jove, from whatsoever source you may know them.sf	  
    Telemachus took this speech as of good omen and rose at once, for
    he was bursting with what he had to say. He stood in the middle of
    the assembly and the good herald Pisenor brought him his staff. Then,
    turning to Aegyptius, "Sir," said he, "it is I, as you will shortly
    learn, who have convened you, for it is I who am the most aggrieved.
    I have not got wind of any host approaching about which I would warn
    you, nor is there any matter of public moment on which I would speak.
    My grieveance is purely personal, and turns on two great misfortunes
    which have fallen upon my house. The first of these is the loss of
    my excellent father, who was chief among all you here present, and
    was like a father to every one of you; the second is much more serious,
    and ere long will be the utter ruin of my estate. The sons of all
    the chief men among you are pestering my mother to marry them against
    her will. They are afraid to go to her father Icarius, asking him
    to choose the one he likes best, and to provide marriage gifts for
    his daughter, but day by day they keep hanging about my father's house,
    sacrificing our oxen, sheep, and fat goats for their banquets, and
    never giving so much as a thought to the quantity of wine they drink.
    No estate can stand such recklessness; we have now no Ulysses to ward
    off harm from our doors, and I cannot hold my own against them. I
    shall never all my days be as good a man as he was, still I would
    indeed defend myself if I had power to do so, for I cannot stand such
    treatment any longer; my house is being disgraced and ruined. Have
    respect, therefore, to your own consciences and to public opinion.
    Fear, too, the wrath of heaven, lest the gods should be displeased
    and turn upon you. I pray you by Jove and Themis, who is the beginning
    and the end of councils, [do not] hold back, my friends, and leave
    me singlehanded- unless it be that my brave father Ulysses did some
    wrong to the Achaeans which you would now avenge on me, by aiding
    and abetting these suitors. Moreover, if I am to be eaten out of house
    and home at all, I had rather you did the eating yourselves, for I
    could then take action against you to some purpose, and serve you
    with notices from house to house till I got paid in full, whereas
    now I have no remedy."sA  
But as the sun was rising from the fair sea into the firmament of
heaven to shed light on mortals and immortals, they reached Pylos
the city of Neleus. Now the people of Pylos were gathered on the sea
shore to offer sacrifice of black bulls to Neptune lord of the Earthquake.
There were nine guilds with five hundred men in each, and there were
nine bulls to each guild. As they were eating the inward meats and
burning the thigh bones [on the embers] in the name of Neptune, Telemachus
and his crew arrived, furled their sails, brought their ship to anchor,
and went ashore. s   
So the neighbours and kinsmen of Menelaus were feasting and making
merry in his house. There was a bard also to sing to them and play
his lyre, while two tumblers went about performing in the midst of
them when the man struck up with his tune.]s&  
"When we had passed the [Wandering] rocks, with Scylla and terrible
Charybdis, we reached the noble island of the sun-god, where were
the goodly cattle and sheep belonging to the sun Hyperion. While still
at sea in my ship I could bear the cattle lowing as they came home
to the yards, and the sheep bleating. Then I remembered what the blind
Theban prophet Teiresias had told me, and how carefully Aeaean Circe
had warned me to shun the island of the blessed sun-god. So being
much troubled I said to the men, 'My men, I know you are hard pressed,
but listen while I tell you the prophecy that Teiresias made me, and
how carefully Aeaean Circe warned me to shun the island of the blessed
sun-god, for it was here, she said, that our worst danger would lie.
Head the ship, therefore, away from the island.s   A&lt;B&gt;C&amp;D&quot;E&apos;Fs$   A&lt; B&gt; C&amp; D&quot; E&apos; Fs   <![CDATA[<>&'"]]>s   <bullet face=courier size=14 color=green>+</bullet>
There was a bard also to sing to them and play
his lyre, while two tumblers went about performing in the midst of
them when the man struck up with his tune.]s3   <onDraw name="myFunc" label="aaa   bbb">A paragraphs@   <para><onDraw name="myFunc" label="aaa   bbb">B paragraph</para>i    sq   Here comes <FONT FACE="Helvetica" SIZE="14pt">Helvetica 14</FONT> with <STRONG>strong</STRONG> <EM>emphasis</EM>.sq   Here comes <font face="Helvetica" size="14pt">Helvetica 14</font> with <Strong>strong</Strong> <em>emphasis</em>.sO   Here comes <font face="Courier" size="3cm">Courier 3cm</font> and normal again.(D   s   __version__s   strings   res   typess	   TupleTypes   UnicodeTypes
   StringTypes   syss   oss   copys   reportlab.lib.sequencers	   reportlabs   reportlab.lib.abags   ABags   reportlab.libs   xmllibs   reportlab.lib.colorss   toColors   whites   blacks   reds   Colors   reportlab.lib.fontss   tt2pss   ps2tts   reportlab.lib.enumss   TA_LEFTs   TA_RIGHTs	   TA_CENTERs
   TA_JUSTIFYs   reportlab.lib.unitss   inchs   mms   cms   picas   compiles   _re_paras	   sizeDeltas   subFractions   superFractions   _nums   _aligns   Nones   _paraAttrMaps   _bulletAttrMaps   _fontAttrMaps   _linkAttrMaps   _addAttributeNamess   _applyAttributess   greekss   ParaFrags   _greek2Utf8s   _greekConverts	   XMLParsers
   ParaParsers   __name__s   reportlab.platypuss   cleanBlockQuotedTexts   _parsers
   check_texts   styles   fontNames   fontSizes	   textColors   bulletFontNames   bulletFontSizes   texts   caseSensitive(0   s   _parsers   TA_RIGHTs   cms   texts   _paraAttrMaps   _applyAttributess   _fontAttrMaps   ps2tts   ABags
   StringTypes	   reportlabs	   TupleTypes   greekss   ParaFrags   UnicodeTypes
   check_texts   res   toColors   blacks	   sizeDeltas   _bulletAttrMaps   inchs   TA_LEFTs   whites   __version__s   reds   _re_paras   strings   styles   syss
   ParaParsers   xmllibs   _addAttributeNamess   copys   superFractions   _aligns   Colors   oss
   TA_JUSTIFYs   cleanBlockQuotedTexts   _nums   mms	   TA_CENTERs   subFractions   _linkAttrMaps   tt2pss   picas   _greekConvert(    (    sG   /home/packages/reportlab/reportlab_2_0/reportlab/platypus/paraparser.pys   ?   s   						%"	 3oo		


	    	' 								





$









	

