ó
>ü½cc           @   sæ  d  Z  d d l Z d d l m Z d d l m Z d d l m Z m Z d d l m	 Z	 d Z
 d Z d	 Z d
 „  Z d „  Z d „  Z d d` d „  ƒ  YZ d da d „  ƒ  YZ d db d „  ƒ  YZ d dc d „  ƒ  YZ d dd d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d  „  ƒ  YZ d! e f d" „  ƒ  YZ d# e f d$ „  ƒ  YZ d% e f d& „  ƒ  YZ d' e f d( „  ƒ  YZ d) e f d* „  ƒ  YZ d+ e f d, „  ƒ  YZ d- e f d. „  ƒ  YZ  d/ e f d0 „  ƒ  YZ! d1 e f d2 „  ƒ  YZ" d3 e f d4 „  ƒ  YZ# d5 e f d6 „  ƒ  YZ$ d7 de d8 „  ƒ  YZ% d9 e% f d: „  ƒ  YZ& d; e% f d< „  ƒ  YZ' d= e% f d> „  ƒ  YZ( d? e% f d@ „  ƒ  YZ) dA df dB „  ƒ  YZ* dC e% f dD „  ƒ  YZ+ dE e% f dF „  ƒ  YZ, dG e% f dH „  ƒ  YZ- dI dg dJ „  ƒ  YZ. dK dh dL „  ƒ  YZ/ dM e/ f dN „  ƒ  YZ0 dO e/ f dP „  ƒ  YZ1 dQ e f dR „  ƒ  YZ2 dS e f dT „  ƒ  YZ3 dU e f dV „  ƒ  YZ4 d dW l m5 Z5 dX Z6 dY Z7 dZ Z8 d[ Z9 d\ Z: d] „  Z; d^ di d_ „  ƒ  YZ< d S(j   sÈ   Library for program-based construction of an HTML documents.

Encapsulate HTML formatting directives in classes that act as containers
for python and, recursively, for nested HTML formatting objects.
iÿÿÿÿN(   t   mm_cfg(   t   Utils(   t   _t   get_translation(   t
   csrf_tokent    t    s   
c         C   sA   t  |  ƒ t  d ƒ k r |  St |  d ƒ s0 |  S|  j | ƒ Sd S(   sH   Return a presentation of an object, invoking their Format method if any.R   t   FormatN(   t   typet   hasattrR   (   t   itemt   indent(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   HTMLFormatObject.   s
    c         C   s7   i  } x* |  j  ƒ  D] \ } } | | | j ƒ  <q W| S(   N(   t   itemst   lower(   t   dt   resultt   kt   v(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   CaseInsensitiveKeyedDict7   s    c         C   s+   x$ | j  ƒ  D] \ } } | |  | <q Wd  S(   N(   R   (   t   destinationt
   fresh_dictt   keyt   value(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt	   DictMerge?   s    t   Tablec           B   s¤   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 „  Z d „  Z d „  Z d „  Z d d „ Z RS(   c         K   s(   g  |  _  i  |  _ i  |  _ | |  _ d  S(   N(   t   cellst	   cell_infot   row_infot   opts(   t   selft
   table_opts(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   __init__D   s    			c         C   s   t  |  j | ƒ d  S(   N(   R   R   (   R   R   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt
   AddOptionsJ   s    c         C   s   | |  _  d  S(   N(   R   (   R   R   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   SetAllCellsP   s    c         C   s   |  j  j g  ƒ d  S(   N(   R   t   append(   R   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   NewRowT   s    c         C   s   |  j  d j d ƒ d  S(   NiÿÿÿÿR   (   R   R#   (   R   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   NewCellX   s    c         C   s   |  j  j | ƒ d  S(   N(   R   R#   (   R   t   row(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   AddRow[   s    c         C   s   |  j  d j | ƒ d  S(   Niÿÿÿÿ(   R   R#   (   R   t   cell(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   AddCell^   s    c         K   sw   t  | ƒ } |  j j | ƒ s5 i | | 6|  j | <n> |  j | j | ƒ rb t |  j | | ƒ n | |  j | | <d  S(   N(   R   R   t   has_keyR   (   R   R&   t   colt   kws(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   AddCellInfoa   s    c         K   sF   t  | ƒ } |  j j | ƒ s. | |  j | <n t |  j | | ƒ d  S(   N(   R   R   R*   R   (   R   R&   R,   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt
   AddRowInfoj   s    c         C   s   t  |  j ƒ d S(   Ni   (   t   lenR   (   R   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   GetCurrentRowIndexr   s    c         C   s   t  |  j d ƒ d S(   Niÿÿÿÿi   (   R/   R   (   R   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   GetCurrentCellIndexv   s    c         C   s‡   d d d d d d g } d } xb | j  ƒ  D]T \ } } | | k rI q+ n  | d k re | d } q+ q+ | d	 | j ƒ  | f } q+ W| S(
   Nt   alignt   valignt   nowrapt   rowspant   colspant   bgcolorR   s    NOWRAPs    %s="%s"(   R   t   upper(   R   t   infot
   valid_modst   outputR   t   val(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   ExtractCellInfoy   s    	
c         C   sb   d d d g } d } xF | j  ƒ  D]8 \ } } | | k r@ q" n  | d | j ƒ  | f } q" W| S(   NR2   R3   R7   R   s    %s="%s"(   R   R8   (   R   R9   R:   R;   R   R<   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   ExtractRowInfo‰   s    c         C   s“   d d d d d d g } d } xn | j  ƒ  D]` \ } } | | k rI q+ n  | d k rq | d  k rq | d } q+ q+ | d	 | j ƒ  | f } q+ W| S(
   NR2   t   widtht   bordert   cellspacingt   cellpaddingR7   R   s    BORDERs    %s="%s"(   R   t   NoneR8   (   R   R9   R:   R;   R   R<   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   ExtractTableInfo”   s    	
c         C   s‹   y |  j  | | } Wn d  } n Xd d | d } | rS | |  j | ƒ } n  |  j | | } t | | d ƒ } d | | f } | S(   Ns   
R   s   <tdi   s
   %s>%s</td>(   R   RC   R=   R   R   (   R   R&   R+   R   t   my_infoR;   R
   t   item_format(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt
   FormatCell¥   s    
c         C   s´   y |  j  | } Wn d  } n Xd d | d } | rO | |  j | ƒ } n  | d } x> t t |  j | ƒ ƒ D]# } | |  j | | | d ƒ } qs W| d d | d } | S(   Ns   
R   s   <trt   >i   s   </tr>(   R   RC   R>   t   rangeR/   R   RG   (   R   R&   R   RE   R;   t   i(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt	   FormatRow³   s    

 !i    c         C   s†   d d | d } | |  j  |  j ƒ } | d } x7 t t |  j ƒ ƒ D]  } | |  j | | d ƒ } qH W| d d | d } | S(   Ns   
R   s   <tableRH   i   s	   </table>
(   RD   R   RI   R/   R   RK   (   R   R   R;   RJ   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR   Å   s    
(   t   __name__t
   __module__R    R!   R"   R$   R%   R'   R)   R-   R.   R0   R1   R=   R>   RD   RG   RK   R   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR   C   s"   																	t   Linkc           B   s    e  Z d d  „ Z d d „ Z RS(   c         C   s   | |  _  | |  _ | |  _ d  S(   N(   t   hreft   textt   target(   R   RO   RP   RQ   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR    Ó   s    		i    c         C   sN   d } |  j  d  k r% d |  j  } n  d t |  j | ƒ | t |  j | ƒ f S(   NR   s    target="%s"s   <a href="%s"%s>%s</a>(   RQ   RC   R   RO   RP   (   R   R   t   texpr(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR   Ø   s    N(   RL   RM   RC   R    R   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRN   Ò   s   t   FontSizec           B   s#   e  Z d  Z d „  Z d d „ Z RS(   sE   FontSize is being deprecated - use FontAttr(..., size="...") instead.c         G   s   t  | ƒ |  _ | |  _ d  S(   N(   t   listR   t   size(   R   RU   R   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR    â   s    i    c         C   sB   d |  j  } x$ |  j D] } | t | | ƒ } q W| d } | S(   Ns   <font size="%s">s   </font>(   RU   R   R   (   R   R   R;   R
   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR   æ   s
    
(   RL   RM   t   __doc__R    R   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRS   à   s   	t   FontAttrc           B   s#   e  Z d  Z d „  Z d d „ Z RS(   s"   Present arbitrary font attributes.c         O   s   t  | ƒ |  _ | |  _ d  S(   N(   RT   R   t   attrs(   R   R   t   kw(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR    ï   s    i    c         C   s…   g  } x4 |  j  j ƒ  D]# \ } } | j d | | f ƒ q Wd t j | ƒ } x$ |  j D] } | t | | ƒ } qZ W| d } | S(   Ns   %s="%s"s	   <font %s>s   </font>(   RX   R   R#   t   SPACEt   joinR   (   R   R   t   seqR   R   R;   R
   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR   ó   s    
(   RL   RM   RV   R    R   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRW   í   s   	t	   Containerc           B   s&   e  Z d  „  Z d „  Z d d „ Z RS(   c         G   s   | s g  |  _  n	 | |  _  d  S(   N(   R   (   R   R   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR    ÿ   s    c         C   s   |  j  j | ƒ d  S(   N(   R   R#   (   R   t   obj(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   AddItem  s    i    c         C   s=   g  } x' |  j  D] } | j t | | ƒ ƒ q Wt j | ƒ S(   N(   R   R#   R   t   EMPTYSTRINGR[   (   R   R   R;   R
   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR     s    (   RL   RM   R    R_   R   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR]   þ   s   		t   Labelc           B   s#   e  Z d  Z d „  Z d d „ Z RS(   t   rightc         G   s   t  j |  | Œ d  S(   N(   R]   R    (   R   R   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR      s    i    c         C   s   d |  j  t j |  | ƒ d S(   Ns   <div align="%s">s   </div>(   R2   R]   R   (   R   R   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR     s    (   RL   RM   R2   R    R   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRa     s   	t   Documentc           B   sY   e  Z d Z d Z e j Z d  Z d d „ Z	 d „  Z
 d „  Z d  d „ Z d d „ Z RS(   i    c         C   s   | |  _  d  S(   N(   t   language(   R   t   lang(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   set_language$  s    c         C   s   | |  _  d  S(   N(   R7   (   R   t   color(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   set_bgcolor'  s    c         C   s   | |  _  d  S(   N(   t   title(   R   Ri   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   SetTitle*  s    c   
      K   sH  d } |  j  r6 t j |  j  ƒ r6 t j |  j  ƒ } n  d | g } |  j sô| j d |  j ƒ d | } | j | d d g ƒ t j	 r¦ | j
 d t j	 t j ƒ n  | j
 d | ƒ |  j rÝ | j
 d	 | |  j f ƒ n  | j
 d
 ƒ t j r| j
 t j ƒ n  | j
 d | ƒ g  } t j r<| j d t j ƒ n  t j r[| j d t j ƒ n  t j rz| j d t j ƒ n  x1 | j ƒ  D]# \ } } | j
 d | | f ƒ q‡W| j
 d | t j | ƒ f ƒ t j |  j  ƒ }	 | j
 d |	 ƒ n  | j
 t j |  | ƒ ƒ |  j s;| j
 d | ƒ | j
 d | ƒ n  t j | ƒ S(   Ns   us-asciis$   Content-Type: text/html; charset=%s
R7   R   s   <HTML>s   <HEAD>s$   <LINK REL="SHORTCUT ICON" HREF="%s">s@   <META http-equiv="Content-Type" content="text/html; charset=%s">s   %s<TITLE>%s</TITLE>s¶   <style type="text/css">
    div.hidden
        {position:absolute;
        left:-10000px;
        top:auto;
        width:1px;
        height:1px;
        overflow:hidden;}
</style>
s	   %s</HEAD>t   vlinkt   alinkt   links   %s="%s"s
   %s<BODY %ss	   dir="%s">s	   %s</BODY>s	   %s</HTML>(   Rd   R   t
   IsLanguaget
   GetCharSett   suppress_headt
   setdefaultR7   t   extendR    t   IMAGE_LOGOSR#   t   SHORTCUT_ICONRi   t   WEB_HEAD_ADDt   WEB_VLINK_COLORt   WEB_ALINK_COLORt   WEB_LINK_COLORR   RZ   R[   t   GetDirectionR]   R   t   NL(
   R   R   R,   t   charsetR;   t   tabt   qualsR   R   t	   direction(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR   -  sN    	
	
				
				 	c      
   C   sl   | d  k r t d ƒ } n  |  j t d t t t | ƒ d t j d d ƒƒ j ƒ  t	 | ƒ j ƒ  ƒ ƒ d  S(   Ns   Error: i   Rg   RU   s   +2(
   RC   R   R_   t   Headert   BoldRW   R    t   WEB_ERROR_COLORR   t   Italic(   R   t   errmsgt   tag(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   addErrorf  s
    $N(   RL   RM   RC   Ri   Rd   R    t   WEB_BG_COLORR7   Rp   Rf   Rh   Rj   R   R…   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRc     s   			9t   HeadlessDocumentc           B   s   e  Z d  Z d Z RS(   sD   Document without head section, for templates that provide their own.i   (   RL   RM   RV   Rp   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR‡   n  s   t   StdContainerc           B   s   e  Z d  d „ Z RS(   i    c         C   s:   d |  j  } | t j |  | ƒ } d | |  j  f } | S(   Ns   <%s>s   %s</%s>(   R„   R]   R   (   R   R   R;   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR   t  s    (   RL   RM   R   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRˆ   s  s   t   QuotedContainerc           B   s   e  Z d  d „ Z RS(   i    c         C   s2   d |  j  t j t j |  | ƒ ƒ |  j  f } | S(   Ns   <%s>%s</%s>(   R„   R   t   websafeR]   R   (   R   R   R;   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR   }  s
    (   RL   RM   R   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR‰   |  s   R   c           B   s   e  Z d  „  Z RS(   c         G   s   | |  _  d | |  _ d  S(   Ns   h%d(   R   R„   (   R   t   numR   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR    †  s    	(   RL   RM   R    (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR   …  s   t   Addressc           B   s   e  Z d  Z RS(   t   address(   RL   RM   R„   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRŒ   Š  s   t	   Underlinec           B   s   e  Z d  Z RS(   t   u(   RL   RM   R„   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRŽ   �  s   R€   c           B   s   e  Z d  Z RS(   t   strong(   RL   RM   R„   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR€   �  s   R‚   c           B   s   e  Z d  Z RS(   t   em(   RL   RM   R„   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR‚   “  s   t   Preformattedc           B   s   e  Z d  Z RS(   t   pre(   RL   RM   R„   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR’   –  s   t	   Subscriptc           B   s   e  Z d  Z RS(   t   sub(   RL   RM   R„   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR”   ™  s   t   Superscriptc           B   s   e  Z d  Z RS(   t   sup(   RL   RM   R„   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR–   œ  s   t	   Strikeoutc           B   s   e  Z d  Z RS(   t   strike(   RL   RM   R„   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR˜   Ÿ  s   t   Centerc           B   s   e  Z d  Z RS(   t   center(   RL   RM   R„   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRš   ¢  s   t   Formc           B   s8   e  Z d  d d d d d d „ Z d „  Z d d „ Z RS(   R   t   POSTc         G   sQ   t  t j |  f | ƒ | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ d  S(   N(	   t   applyR]   R    t   actiont   methodt   encodingt   mlistt   contextst   user(   R   RŸ   R    R¡   R¢   R£   R¤   R   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR    ¦  s    					c         C   s   | |  _  d  S(   N(   RŸ   (   R   RŸ   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt
   set_action°  s    i    c         C   s¢   d | } d } |  j  r) d |  j  } n  d | |  j |  j | f } |  j rt | d t |  j |  j |  j ƒ } n  | t j |  | d ƒ } d | | f } | S(   NR   R   s   enctype="%s"s%   
%s<FORM action="%s" method="%s" %s>
s3   <input type="hidden" name="csrf_token" value="%s">
i   s   %s
%s</FORM>
(	   R¡   RŸ   R    R¢   R   R£   R¤   R]   R   (   R   R   t   spacesR¡   R;   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR   ³  s    
		 N(   RL   RM   RC   R    R¥   R   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRœ   ¥  s   			t   InputObjc           B   s   e  Z d  „  Z d d „ Z RS(   c         K   s1   | |  _  | |  _ | |  _ | |  _ | |  _ d  S(   N(   t   nameR   R   t   checkedR,   (   R   R¨   t   tyR   R©   R,   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR    Ä  s
    				i    c         C   sË   t  ƒ  j ƒ  p d } d |  j |  j |  j f g } x( |  j j ƒ  D] } | j d | ƒ qD W|  j rx | j d ƒ n  | j d ƒ t	 j
 | ƒ } |  j d k rÇ t | t ƒ rÇ | j | d ƒ } n  | S(   Ns   us-asciis%   <INPUT name="%s" type="%s" value="%s"s   %s="%s"t   CHECKEDRH   t   TEXTt   xmlcharrefreplace(   R   R{   R¨   R   R   R,   R   R#   R©   RZ   R[   t
   isinstancet   unicodet   encode(   R   R   R{   R;   R
   t   ret(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR   Ë  s    	(   RL   RM   R    R   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR§   Ã  s   	t   SubmitButtonc           B   s   e  Z d  „  Z RS(   c         C   s    t  j |  | d | d d ƒd  S(   Nt   SUBMITR©   i    (   R§   R    (   R   R¨   t   button_text(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR    Û  s    (   RL   RM   R    (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR²   Ú  s   t   PasswordBoxc           B   s   e  Z d  e j d „ Z RS(   R   c      	   C   s&   t  j |  | d | d d d | ƒd  S(   Nt   PASSWORDR©   i    RU   (   R§   R    (   R   R¨   R   RU   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR    ß  s    (   RL   RM   R    t   TEXTFIELDWIDTHR    (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRµ   Þ  s   t   TextBoxc           B   s   e  Z d  e j d „ Z RS(   R   c      	   C   sM   t  | t ƒ r! t j | ƒ } n | } t j |  | d | d d d | ƒd  S(   NR¬   R©   i    RU   (   R®   t   strR   RŠ   R§   R    (   R   R¨   R   RU   t	   safevalue(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR    ã  s    (   RL   RM   R    R·   R    (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR¸   â  s   t   Hiddenc           B   s   e  Z d  d „ Z RS(   R   c         C   s    t  j |  | d | d d ƒd  S(   Nt   HIDDENR©   i    (   R§   R    (   R   R¨   R   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR    ë  s    (   RL   RM   R    (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR»   ê  s   t   TextAreac           B   s,   e  Z d  d d d d d „ Z d d „ Z RS(   R   t   softi    c   	      C   sk   t  | t ƒ r+ | } t j | | ƒ } n | } | |  _ | |  _ | |  _ | |  _ | |  _ | |  _	 d  S(   N(
   R®   R¹   R   RŠ   R¨   RP   t   rowst   colst   wrapt   readonly(	   R   R¨   RP   R¿   RÀ   RÁ   RÂ   t   doubleescapet   safetext(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR    ï  s    					c         C   sÈ   t  ƒ  j ƒ  p d } d |  j } |  j r? | d |  j 7} n  |  j r\ | d |  j 7} n  |  j ry | d |  j 7} n  |  j r� | d 7} n  | d |  j 7} t | t	 ƒ rÄ | j
 | d ƒ } n  | S(	   Ns   us-asciis   <TEXTAREA NAME=%ss    ROWS=%ss    COLS=%ss    WRAP=%ss	    READONLYs   >%s</TEXTAREA>R­   (   R   R{   R¨   R¿   RÀ   RÁ   RÂ   RP   R®   R¯   R°   (   R   R   R{   R;   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR   þ  s    				N(   RL   RM   RC   R    R   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR½   î  s   t
   FileUploadc           B   s   e  Z d d d  „ Z RS(   c         K   s&   t  t j |  | d d d f | ƒ d  S(   Nt   FILER   i    (   Rž   R§   R    (   R   R¨   R¿   RÀ   R,   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR      s    N(   RL   RM   RC   R    (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRÅ     s   t   RadioButtonc           B   s   e  Z d  d „ Z RS(   i    c         K   s&   t  t j |  | d | | f | ƒ d  S(   Nt   RADIO(   Rž   R§   R    (   R   R¨   R   R©   R,   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR      s    (   RL   RM   R    (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRÇ     s   t   CheckBoxc           B   s   e  Z d  d „ Z RS(   i    c         K   s&   t  t j |  | d | | f | ƒ d  S(   Nt   CHECKBOX(   Rž   R§   R    (   R   R¨   R   R©   R,   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR      s    (   RL   RM   R    (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRÉ     s   t   VerticalSpacerc           B   s    e  Z d  d „ Z d d „ Z RS(   i
   c         C   s   | |  _  d  S(   N(   RU   (   R   RU   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR      s    i    c         C   s   d |  j  } | S(   Ns$   <spacer type="vertical" height="%d">(   RU   (   R   R   R;   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR     s    (   RL   RM   R    R   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRË     s   t   WidgetArrayc           B   s,   e  Z d Z d  „  Z d „  Z d d „ Z RS(   c         C   sO   | |  _  | |  _ | |  _ | |  _ | |  _ t | ƒ t | ƒ k sK t ‚ d  S(   N(   R¨   t   button_namesR©   t
   horizontalt   valuesR/   t   AssertionError(   R   R¨   RÍ   R©   RÎ   RÏ   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR    $  s    					c         C   s
   t  ‚ d  S(   N(   t   NotImplemented(   R   RJ   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt	   ischecked.  s    i    c   	      C   sÛ   t  d d ƒ } g  } x� t t t |  j ƒ ƒ |  j |  j ƒ D]t \ } } } |  j | ƒ } d |  j |  j | | ƒ j	 ƒ  | d } | j
 | ƒ |  j s= | j | ƒ g  } q= q= W|  j rÎ | j | ƒ n  | j	 | ƒ S(   NRA   i   s   <label>s   </label>(   R   t   zipRI   R/   RÍ   RÏ   RÒ   t   WidgetR¨   R   R#   RÎ   R'   (	   R   R   t   tR   RJ   R¨   R   RÒ   R
   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR   1  s    *		N(   RL   RM   RC   RÔ   R    RÒ   R   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRÌ   !  s   	
	t   RadioButtonArrayc           B   s)   e  Z e Z d d  d d „ Z d „  Z RS(   i   c         C   sA   | d  k r! t t | ƒ ƒ } n  t j |  | | | | | ƒ d  S(   N(   RC   RI   R/   RÌ   R    (   R   R¨   RÍ   R©   RÎ   RÏ   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR    F  s    c         C   s   |  j  | k S(   N(   R©   (   R   RJ   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRÒ   N  s    N(   RL   RM   RÇ   RÔ   RC   R    RÒ   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRÖ   C  s   t   CheckBoxArrayc           B   s)   e  Z e Z d d  d d „ Z d „  Z RS(   i    c         C   s�   | d  k r" d g t | ƒ } n t | ƒ t | ƒ k s@ t ‚ | d  k ra t t | ƒ ƒ } n  t j |  | | | | | ƒ d  S(   Ni    (   RC   R/   RÐ   RI   RÌ   R    (   R   R¨   RÍ   R©   RÎ   RÏ   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR    T  s    c         C   s   |  j  | S(   N(   R©   (   R   RJ   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRÒ   _  s    N(   RL   RM   RÉ   RÔ   RC   R    RÒ   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR×   Q  s   
t   UnorderedListc           B   s   e  Z d  d „ Z RS(   i    c         C   s[   d | } d | } x2 |  j  D]' } | d | t | | d ƒ f } q W| d | } | S(   NR   s   
%s<ul>
s	   %s<li>%s
i   s   %s</ul>
(   R   R   (   R   R   R¦   R;   R
   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR   c  s    

(   RL   RM   R   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRØ   b  s   t   OrderedListc           B   s   e  Z d  d „ Z RS(   i    c         C   s[   d | } d | } x2 |  j  D]' } | d | t | | d ƒ f } q W| d | } | S(   NR   s   
%s<ol>
s	   %s<li>%s
i   s   %s</ol>
(   R   R   (   R   R   R¦   R;   R
   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR   m  s    

(   RL   RM   R   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRÙ   l  s   t   DefinitionListc           B   s   e  Z d  d „ Z RS(   i    c      	   C   sq   d | } d | } xH |  j  D]= \ } } | d | t | | d ƒ t | | d ƒ f } q W| d | } | S(   NR   s   
%s<dl>
s   %s<dt>%s
<dd>%s
i   s   %s</dl>
(   R   R   (   R   R   R¦   R;   t   dtt   dd(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR   w  s    

(   RL   RM   R   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRÚ   v  s   (   t   MAILMAN_URLs   http://www.python.org/s   http://www.gnu.org/s   mailman.jpgs   PythonPowered.pngs   gnu-head-tiny.jpgc          C   sÛ   t  d d d d ƒ }  t j ry d „  } d | t ƒ t j f } d | t ƒ } d | t ƒ } |  j | | | g ƒ n^ t j } t t	 t
 d	 ƒ ƒ } t t t
 d
 ƒ ƒ } t t t
 d ƒ ƒ } |  j | | | g ƒ |  S(   NR@   i    R?   s   100%c         S   s   t  j |  S(   N(   R    Rs   (   t   file(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   logo–  s    s@   <img src="%s" alt="Delivered by Mailman" border=0><br>version %ss,   <img src="%s" alt="Python Powered" border=0>s,   <img src="%s" alt="GNU's Not Unix" border=0>s+   Delivered by Mailman<br>version %(version)ss   Python Powereds   Gnu's Not Unix(   R   R    Rs   t   DELIVERED_BYt   VERSIONt   PYTHON_POWEREDt   GNU_HEADR'   RN   RÝ   R   t
   PYTHON_URLt   GNU_URL(   RÕ   Rß   t   mmlinkt   pylinkt   gnulinkt   version(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   MailmanLogo“  s"    			t   SelectOptionsc           B   s&   e  Z d  d d d „ Z d  d „ Z RS(   i    i   c         C   s·   | |  _  | |  _ | |  _ | |  _ | |  _ | s³ t | ƒ t j k rW | f |  _ q³ t | ƒ t j	 k r | d f |  _ q³ t | ƒ t j
 k r§ | d f |  _ q³ d |  _ n  d  S(   Ni    (   i    (   t   varnameRÏ   t   legendRU   t   multipleR   t   typest   IntTypet   selectedt	   TupleTypet   ListType(   R   Rì   RÏ   Rí   Rñ   RU   Rî   (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR    «  s    					c         C   s  d | } t  t |  j ƒ t |  j ƒ ƒ } | d k r; d Sd | d |  j } |  j d k rs | d |  j } n  |  j r‰ | d } n  | d	 } xe t | ƒ D]W } | |  j k r¾ d
 } n d } d |  j | | |  j | f } | | | d } q  W| | d S(   NR   i    R   s   
s   <Select name="%s"i   s    size=%ds	    multiples   >
s	    Selecteds#    <option value="%s"%s> %s </option>s	   </Select>(	   t   minR/   RÏ   Rí   Rì   RU   Rî   RI   Rñ   (   R   R   R¦   R   RP   RJ   R©   t   opt(    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyR   ½  s$    
!	
	N(   RL   RM   RC   R    R   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyRë   ª  s   (    (    (    (    (    (    (    (    (    (    (=   RV   Rï   t   MailmanR    R   t   Mailman.i18nR   R   t   Mailman.CSRFcheckR   RZ   R`   Rz   R   R   R   R   RN   RS   RW   R]   Ra   Rc   R‡   Rˆ   R‰   R   RŒ   RŽ   R€   R‚   R’   R”   R–   R˜   Rš   Rœ   R§   R²   Rµ   R¸   R»   R½   RÅ   RÇ   RÉ   RË   RÌ   RÖ   R×   RØ   RÙ   RÚ   RÝ   Rä   Rå   Rà   Râ   Rã   Rê   Rë   (    (    (    s1   /export/web/mailman/mailman/Mailman/htmlformat.pyt   <module>   sp   				�P		 "

	