;
)?Bc           @   s   d  Z  d k Z d k Z d k l Z d k l Z d k l Z d k Td k l	 Z	 d Z
 d Z d	 Z d
 Z d f  d     YZ d S(   s5   Routines for presentation of list-specific HTML text.N(   s   mm_cfg(   s   Utils(   s   MemberAdaptor(   s   *(   s   _s    s   <br>s   
s   , s   HTMLFormatterc           B   s  t  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 d  Z d   Z d   Z d d d  Z d   Z d d  Z d   Z e d  Z e d  Z e d  Z e d d  Z RS(   Nc   	      C   s  t  i g  i } |  i D] } | t i | d   q ~  } |  i
 } |  i } t |  i d  |  i   } t d |  i   |  i   } t d  } t d t t | d t |  i d  t d   t d	  d t t i d  t d
   d t      i   Sd  S(   Ni   s   listinfos   mailto:s,   %(listinfo_link)s list run by %(owner_link)ss   <hr>s   <br>s   admins%   %(realname)s administrative interfaces    (requires authorization)s*   Overview of all %(hostname)s mailing listss   <p>(   s
   COMMASPACEs   joins   appends   _[1]s   selfs   owners   as   Utilss   ObscureEmails	   ownertexts	   real_names   realnames	   host_names   hostnames   Links   GetScriptURLs   Formats   listinfo_links   GetOwnerEmails
   owner_links   _s	   innertexts	   Containers   Addresss	   ScriptURLs   MailmanLogo(	   s   selfs   as   realnames	   ownertexts   hostnames
   owner_links   _[1]s   listinfo_links	   innertext(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   GetMailmanFooter'   s     ?				c         C   s  | t j o |  i } n t i }	 g  } | o\ |  i	   } x3 | D]+ } |  i | |	  o | i |  qC qC Wt |  t |  } nY |  i   } x3 | D]+ } |  i | |	  o | i |  q q Wt |  t |  } | d j o t d  } n$ | d j o t d  } n d } g  } | i   |  i } x | D] } t i |  } |  i | d | } | o t i | d d }
 n | }
 t  | |
  } |  i" |  t# i$ j o t% d | d  } n | i |  qDW| t& t' |    i(   Sd  S(	   Ni   s%   <em>(1 private member not shown)</em>s6   <em>(%(num_concealed)d private members not shown)</em>s    s   obscures   for_texts   (s   )()   s   langs   Nones   selfs   preferred_languages   mm_cfgs   ConcealSubscriptions   conceal_subs   peoples   digests   getDigestMemberKeyss   digestmemberss   dms   getMemberOptions   appends   lens   num_concealeds   getRegularMemberKeyss   memberss   ms   _s	   concealeds   itemss   sorts   obscure_addressess   obscures   persons   Utilss   ObscureEmails   ids   GetOptionsURLs   urls   showings   Links   gots   getDeliveryStatuss   MemberAdaptors   ENABLEDs   Italics   UnorderedLists   tuples   Format(   s   selfs   digests   langs   peoples   num_concealeds   digestmemberss   ids   gots   dms   conceal_subs   showings	   concealeds   memberss   urls   itemss   ms   persons   obscure(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   FormatUsers>   sJ    	  
	 c         C   s   | t i j o |  i |  t i j } n |  i	 | |  } | | j o
 d } n d } h  t i d <t i d <t i d <t i d <t i d <t i d <t i d	 <t i d
 <t i d <| } d | | | f Sd  S(   Ns    CHECKEDs    s   dontreceives   disablemails   mimes   ackpostss   digests   conceals   reminds   rcvtopics   nodupess)   <input type=radio name="%s" value="%d"%s>(   s   options   mm_cfgs   DisableDeliverys   selfs   getDeliveryStatuss   users   MemberAdaptors   ENABLEDs   optvals   getMemberOptions   values   checkeds   DontReceiveOwnPostss   DisableMimes   AcknowledgePostss   Digestss   ConcealSubscriptions   SuppressPasswordReminders   ReceiveNonmatchingTopicss   DontReceiveDuplicatess   name(   s   selfs   options   values   users   checkeds   optvals   name(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   FormatOptionButtonh   s    
v
c         C   s&   |  i o
 d } n d } d | Sd  S(   Ns    CHECKEDs    s,   <input type=radio name="digest" value="1"%s>(   s   selfs   digest_is_defaults   checked(   s   selfs   checked(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   FormatDigestButton~   s    

c         C   sz  |  i |  } t } |  i |  } | t i	 j o t
 d  } n | t i j o t
 d  } nh | t i j o7 t i d t i t i | i    } t
 d  } n! | t i j o t
 d  } n | oi t d t
 d   i   } t d t
 d	   i   }
 t d
 |  i   t
 d   i   } t
 d  Sn< | o | i d j o  | i } |  i }	 t
 d  Sn d Sd  S(   Ns   ; it was disabled by yous+   ; it was disabled by the list administrators   %d-%b-%Ysa   ; it was disabled due to excessive bounces.  The
            last bounce was received on %(date)ss%   ; it was disabled for unknown reasonss   +1s9   Note: your list delivery is currently disabled%(reason)s.s   #disables   Mail deliverys   mailto:s   the list administratorsL  <p>%(note)s

            <p>You may have disabled list delivery intentionally,
            or it may have been triggered by bounces from your email
            address.  In either case, to re-enable delivery, change the
            %(link)s option below.  Contact %(mailto)s if you have any
            questions or need assistance.i    s  <p>We have received some recent bounces from your
            address.  Your current <em>bounce score</em> is %(score)s out of a
            maximum of %(total)s.  Please double check that your subscribed
            address is correct and that there are no problems with delivery to
            this address.  Your bounce score will be automatically reset if
            the problems are corrected soon.s    (   s   selfs   getDeliveryStatuss   users   statuss   Nones   reasons   getBounceInfos   infos   MemberAdaptors   BYUSERs   _s   BYADMINs   BYBOUNCEs   times   strftimes	   localtimes   Utilss   midnights   dates   UNKNOWNs   FontSizes   Formats   notes   Links   links   GetOwnerEmails   mailtos   scores   bounce_score_thresholds   total(   s   selfs   users   statuss   infos   mailtos   notes   reasons   scores   dates   totals   link(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   FormatDisabledNotice   s0    			c         C   s/   |  i |  } |  i o t d  Sn d Sd  S(   Ns   (Note - you are subscribing to a list of mailing lists, so the %(type)s notice will be sent to the admin address for your membership, %(addr)s.)<p>s    (   s   selfs   GetMemberAdminEmails   users   addrs   umbrella_lists   _(   s   selfs   users   types   addr(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   FormatUmbrellaNotice   s    
c         C   sD  d } d } |  i d j o | t d  7} na |  i d j o  | t d  7} t d  } n1 |  i d j o  | t d  7} t d  } n | o | d	 7} n |  i d j o | t d
  7} nM |  i o | t d  7} n/ | t d  7} |  i o | t d  7} n |  i o |  i } | t d  7} n | Sd  S(   Ns    i   sp   You will be sent email requesting confirmation, to
            prevent others from gratuitously subscribing you.i   s   This is a closed list, which means your subscription
            will be held for approval.  You will be notified of the list
            moderator's decision by email.s   also i   s.  You will be sent email requesting confirmation, to
            prevent others from gratuitously subscribing you.  Once
            confirmation is received, your request will be held for approval
            by the list moderator.  You will be notified of the moderator's
            decision by email.s    sq   This is %(also)sa private list, which means that the
            list of members is not available to non-members.s|   This is %(also)sa hidden list, which means that the
            list of members is available only to the list administrator.sn   This is %(also)sa public list, which means that the
            list of members list is available to everyone.s`    (but we obscure the addresses so they are not
                easily recognizable by spammers).s   <p>(Note that this is an umbrella list, intended to
            have only other mailing lists as members.  Among other things,
            this means that your confirmation request will be sent to the
            `%(sfx)s' account for your address.)(
   s   msgs   alsos   selfs   subscribe_policys   _s   private_rosters   obscure_addressess   umbrella_lists   umbrella_member_suffixs   sfx(   s   selfs   msgs   alsos   sfx(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   FormatSubscriptionMsg   s.    


	c         C   s&   |  i o
 d } n d } d | Sd  S(   Ns    s    CHECKEDs,   <input type=radio name="digest" value="0"%s>(   s   selfs   digest_is_defaults   checked(   s   selfs   checked(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   FormatUndigestButton   s    

c         C   s&   |  i o
 d } n d } d | Sd  S(   Ns    CHECKEDs    s*   <input type=radio name="mime" value="1"%s>(   s   selfs   mime_is_default_digests   checked(   s   selfs   checked(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   FormatMimeDigestsButton   s    

c         C   s&   |  i o
 d } n d } d | Sd  S(   Ns    s    CHECKEDs+   <input type=radio name="plain" value="1"%s>(   s   selfs   mime_is_default_digests   checked(   s   selfs   checked(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   FormatPlainDigestsButton   s    

c         C   s   |  i d j o t d  } n d } |  i } t d  t d d d i   d t d	 t d
   i   t	 d |  i   d } |  i d j o | t d  7} n | t d  7} | Sd  S(   Ni    s   <b><i>either</i></b> s    s   To unsubscribe from %(realname)s, get a password reminder,
        or change your subscription options %(either)senter your subscription
        email address:
        <p><center> s   emails   sizei   s     s   UserOptionss   Unsubscribe or edit optionss   languages	   </center>sf   <p>... <b><i>or</i></b> select your entry from
                      the subscribers list (see above).sR    If you leave the field blank, you will be prompted for
        your email address(   s   selfs   private_rosters   _s   eithers	   real_names   realnames   TextBoxs   Formats   SubmitButtons   Hiddens   langs   text(   s   selfs   langs   realnames   texts   either(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   FormatEditingOption   s    	)-c         C   s9   | o d Sn& | d j o t d  Sn t d  Sd  S(   Ns    i   sI   (<i>%(which)s is only available to the list
                members.</i>)sK   (<i>%(which)s is only available to the list
            administrator.</i>)(   s   restrictions   _(   s   selfs   whichs   restriction(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   RestrictedListMessage  s
    c         C   s   |  i |  i   Sd  S(   N(   s   selfs   RosterOptions   langs   Format(   s   selfs   lang(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   FormatRosterOptionForUser  s    c         C   si  t    } | i t d |   |  i oD | i t d  |  i t d   | i t	 d t d    n |  i d j o t d  } t d  } n t d	  } t d
  } | i |  i t d  |  i  t d  | d  i   t d  | d  | i |  i d   | i t d  |  i d  d  | i t	 d t d    | i d  | Sd  S(   Ns   languages   Click here for the list of s    subscribers: s   SubscriberRosters   Visit Subscriber listi   s   memberss   Address:s   the list administrators   Admin address:s   The subscribers lists    <p>Enter your is:    and password to visit  the subscribers list: <p><center> s    s   roster-emails
   Password: s	   roster-pws   &nbsp;&nbsp;s   Visit Subscriber Lists	   </center>(   s	   Containers	   containers   AddItems   Hiddens   langs   selfs   private_rosters   _s	   real_names   SubmitButtons   onlys   whoms   RestrictedListMessages   lowers	   FormatBoxs   FormatSecureBox(   s   selfs   langs   whoms   onlys	   container(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   RosterOption  s&    	$7$s    c         C   s<   |  i |  } | o d | | f } n | } d | Sd  S(   Ns   %s/%ss   <FORM Method=POST ACTION="%s">(   s   selfs   GetScriptURLs   names   base_urls   extras   full_url(   s   selfs   names   extras   base_urls   full_url(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   FormatFormStart@  s
    c         C   s   d |  i   Sd  S(   Ns   <a href="%s">(   s   selfs   GetBaseArchiveURL(   s   self(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   FormatArchiveAnchorH  s    c         C   s   d Sd  S(   Ns   </FORM>(    (   s   self(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   FormatFormEndK  s    i   c         C   s   d | | | f Sd  S(   Ns2   <INPUT type="Text" name="%s" size="%d" value="%s">(   s   names   sizes   value(   s   selfs   names   sizes   value(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys	   FormatBoxN  s    c         C   s   d | Sd  S(   Ns+   <INPUT type="Password" name="%s" size="15">(   s   name(   s   selfs   name(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   FormatSecureBoxR  s    s   Submitc         C   s   d | | f Sd  S(   Ns*   <INPUT type="Submit" name="%s" value="%s">(   s   names   text(   s   selfs   names   text(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   FormatButtonU  s    c         C   s    |  i o t d  Sn d Sd  S(   NsA   Once a month, your password will be emailed to you as a reminder.s    (   s   selfs   send_reminderss   _(   s   selfs   lang(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   FormatReminderX  s    
c   
      C   s  | t j o
 d } n t i |  } t i | d d d | d |  } t	 i
 d |  } d } x | t |  j  o| | | i   } | i |  oD | | }	 t |	 t d   o |	 i | d  }	 n |	 | | <n d	 | | <| d
 } qb Wt i |  Sd  S(   Ns   us-asciis   rawi   s   langs   mlists   (</?[Mm][Mm]-[^>]*>)u    s   replaces    i   (   s   langs   Nones   charsets   Utilss
   GetCharSets   maketexts   templates   selfs   texts   res   splits   partss   is   lens   lowers   tags   replacementss   has_keys   repls
   isinstances   types   encodes   EMPTYSTRINGs   join(
   s   selfs   templates   replacementss   langs   is   texts   charsets   tags   partss   repl(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys	   ParseTags^  s"    
! 

c         C   s  t  |  i    } t  |  i    } t  |  i    d j o t t i	 |  i
   } n |  i |  i   } h  d |  i   <d |  i <d |  i <d |  i <d t i |  i i t   <d |  i   <d |  i   <d	 d
 <d |  i   <d |  i t d  |  i  <d | <d | <d | | <d d |  i   <d d |  i   <d |  i   <d |  i  |  i
  <d |  i! <d | <} t# i$ o t# i$ t# i% | d <n | Sd  S(   Ni   s   <mm-mailman-footer>s   <mm-list-name>s   <mm-email-user>s   <mm-list-description>s   <mm-list-info>s   <mm-form-end>s   <mm-archive>s   </mm-archive>s   </a>s   <mm-list-subscription-msg>s   <mm-restricted-list-message>s   The current archives   <mm-num-reg-users>s   <mm-num-digesters>s   <mm-num-members>s   <mm-posting-addr>s   %ss   <mm-request-addr>s
   <mm-owner>s   <mm-reminder>s	   <mm-host>s   <mm-list-langs>s   <mm-favicon>(&   s   lens   selfs   getDigestMemberKeyss   dmember_lens   getRegularMemberKeyss
   member_lens   GetAvailableLanguagess   _s   Utilss   GetLanguageDescrs   preferred_languages	   listlangss   GetLangSelectBoxs   langs   Formats   GetMailmanFooters	   real_names   _internal_names   descriptions   BRs   joins   infos   splits   NLs   FormatFormEnds   FormatArchiveAnchors   FormatSubscriptionMsgs   RestrictedListMessages   archive_privates   GetListEmails   GetRequestEmails   GetOwnerEmails   FormatReminders	   host_names   ds   mm_cfgs   IMAGE_LOGOSs   SHORTCUT_ICON(   s   selfs   langs   ds   dmember_lens
   member_lens	   listlangs(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   GetStandardReplacementst  s    
c         C   sh   | t j o |  i } n |  i |  } | i h  d |  i d |  <d |  i d |  < | Sd S(   sz   
        returns standard replaces plus formatted user lists in
        a dict just like GetStandardReplacements.
        s   <mm-regular-users>i    s   <mm-digest-users>i   N(   s   langs   Nones   selfs   preferred_languages   GetStandardReplacementss   ds   updates   FormatUsers(   s   selfs   langs   d(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   GetAllReplacements  s     7s   languagec         C   s   | t j o |  i } n |  i   } t t t t i	 |   } y | i |  } WnH t j
 o< y | i |  i  } Wq t j
 o t i } q Xn Xt | | | |  Sd  S(   N(   s   langs   Nones   selfs   preferred_languages   GetAvailableLanguagess   valuess   maps   _s   Utilss   GetLanguageDescrs   legends   indexs   selecteds
   ValueErrors   mm_cfgs   DEFAULT_SERVER_LANGUAGEs   SelectOptionss   varname(   s   selfs   langs   varnames   selecteds   valuess   legend(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   GetLangSelectBox  s    (   s   __name__s
   __module__s   GetMailmanFooters   Nones   FormatUserss   FormatOptionButtons   FormatDigestButtons   FormatDisabledNotices   FormatUmbrellaNotices   FormatSubscriptionMsgs   FormatUndigestButtons   FormatMimeDigestsButtons   FormatPlainDigestsButtons   FormatEditingOptions   RestrictedListMessages   FormatRosterOptionForUsers   RosterOptions   FormatFormStarts   FormatArchiveAnchors   FormatFormEnds	   FormatBoxs   FormatSecureBoxs   FormatButtons   FormatReminders	   ParseTagss   GetStandardReplacementss   GetAllReplacementss   GetLangSelectBox(    (    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   HTMLFormatter&   s2   	*			+			)							#				$(   s   __doc__s   times   res   Mailmans   mm_cfgs   Utilss   MemberAdaptors   Mailman.htmlformats   Mailman.i18ns   _s   EMPTYSTRINGs   BRs   NLs
   COMMASPACEs   HTMLFormatter(   s   NLs   Utilss   EMPTYSTRINGs   res   mm_cfgs   MemberAdaptors   BRs   times   HTMLFormatters   _s
   COMMASPACE(    (    s%   /var/mailman/Mailman/HTMLFormatter.pys   ?   s   		