mò
jHÑ=c           @   sp   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 S(   c         C   s?   | i | ƒ } t | ƒ d j o |  i | d ƒ Sn d Sd S(   s   get Text of specified elementi    t    N(   t   myNodet   getElementsByTagNamet   GIt   NLt   lent   selft   text(   R   R   R   R   (    (    t;   /home2/kennisonb/webapps/zope/Zope/Products/zNote/format.pyt   getChunk#   s
     c         C   s   | i d ƒ S(   t   Authorst   authorN(   R   R   (   R   R   (    (    R   t
   getAuthors+   s     c         C   s?   g  } x2 | i D]' } | i d j o | i | ƒ q q W| S(   t   Editorst   editorN(   t   retListR   t
   childNodest   nt   nodeNamet   append(   R   R   R   R   (    (    R   t
   getEditors0   s     
 c         C   s?   g  } x2 | i D]' } | i d j o | i | ƒ q q W| S(   t   Translatorst   transN(   R   R   R   R   R   R   (   R   R   R   R   (    (    R   t   getTrans:   s     
 c         C   s"   | i d j	 o | i i Sn d S(   s   Return text from a nodeN(   t   nodet
   firstChildt   Nonet	   nodeValue(   R   R   (    (    R   R   D   s     c         C   s“   d k  } |  i i d i } | i d ƒ o] | i d ƒ d } |  i | ƒ } | i
 | d ƒ } d } x& | D] } | | d } qm Wn d } | S(   s   Display notes elementNi    t   notess   
R    s   <br />
(   t   stringR   t   REQUESTt   PARENTSt   documentElementt   rootR   t	   notesNodeR   t	   notesTextt   splitt	   notesListt   rst   line(   R   R   R&   R#   R"   R%   R!   R'   (    (    R   t	   showNotesJ   s     	 c         C   s!   |  i i d i i d ƒ d i S(   s   return the notes nodei    R   N(   R   R   R   R    R   R   (   R   (    (    R   R   Y   s     c         C   sT   |  i | ƒ } | i d ƒ d } | d | d | } | i	 ƒ  d | d } | S(   s-   concatenate a string to serve as object titlet   :i    s    (s   ) i   N(
   R   t   getNamest	   AuthsListt   rawNamest	   formTitleR$   t
   cleanTitlet   formDatet   titleStringt   upper(   R   R+   R/   R-   R.   R,   R0   (    (    R   t   composeTitle_   s     c         C   s  g  } xô | D]ì } | i d j oÖ | i h  ƒ | i d ƒ o( |  i | i d ƒ d ƒ | d d <n d | d d <| i d ƒ oU |  i | i d ƒ d ƒ | d d <|  i |  i | i d ƒ d ƒ ƒ | d d	 <qù d | d d <| d d	 <q q W| S(   s   Parse First and Last namesi   t   lastnamei    iÿÿÿÿt   LR    t	   firstnamet   Ft   fN(	   t   At   peoplet   pt   nodeTypeR   R   R   R   t   initials(   R   R9   R8   R:   (    (    R   t   namesl   s      ($1"c         C   sÚ   | i d ƒ } x d | j o | i d ƒ q Wg  } yˆ x | D]y } d | j oU | i d ƒ } | d d } x$ | d D] } | d | d } q| W| i	 | ƒ qA | i	 | d ƒ qA WWn d Sn Xd i
 | ƒ S(   s   make initialst    t   -i    i   s   **** ERROR HERE ****s   . N(   R5   R$   R=   t   removet   initsR   t   hyphenst   hStrt   hR   t   join(   R   R5   RC   R   RB   RA   R=   RD   (    (    R   R<      s(        c         C   s˜   h  } d | j o5 | i d ƒ } | d i ƒ  | d <| d | d <nM | i ƒ  } d i | d d !ƒ | d <y | d | d <Wn d	 | d <n X| S(   s   split name into first and lastt   ,s   , i   t   firsti    t   lastR>   iÿÿÿÿs   *** bug in format.parseName ***N(   t   myDictt   myNameR$   t   tempListt   rstripRE   (   R   RJ   RI   RK   (    (    R   t	   parseName˜   s     c         C   s¬   g  } x( | D]  } | i |  i | ƒ d ƒ q Wt | ƒ d j o | d SnY t | ƒ d j o | d d | d Sn. t | ƒ d j o | d d Sn t | ƒ Sd S(   s"   format multiple names brief stringRH   i   i    i   s    and s    et. al.N(   t   nameListR+   t   aR   R   RM   R   t   str(   R   R+   RO   RN   (    (    R   R*   ©   s         N(   R	   R   R   R   R   R(   R   R2   R=   R<   RM   R*   (   R	   R*   R   R   R2   R   R   R=   R(   R   RM   R<   (    (    R   t   ?#   s   			
	
							