Ñò
?]Mc           @   s~   d  Z  d d k Z d d k Z d d k Z d d k l Z d d k l Z d d „ Z d „  Z	 e
 d j o e d	 ƒ n d S(
   sŒ  Reset a list's web_page_url attribute to the default setting.

This script is intended to be run as a bin/withlist script, i.e.

% bin/withlist -l -r fix_url listname [options]

Options:
    -u urlhost
    --urlhost=urlhost
        Look up urlhost in the virtual host table and set the web_page_url and
        host_name attributes of the list to the values found.  This
        essentially moves the list from one virtual domain to another.

        Without this option, the default web_page_url and host_name values are
        used.

    -v / --verbose
        Print what the script is doing.

If run standalone, it prints this help text and exits.
iÿÿÿÿN(   t   mm_cfg(   t   _t    c         C   s8   t  t i d d ƒ ƒ GH| o	 | GHn t i |  ƒ d  S(   Nt   %s   %%(   R   t   __doc__t   replacet   syst   exit(   t   codet   msg(    (    s   /usr/lib/mailman/bin/fix_url.pyt   usage2   s    	c   
      G   sO  y% t  i  | d d d g ƒ \ } } Wn% t  i j
 o } t d | ƒ n Xd } d  } } xB | D]: \ } } | d j o
 | } qd | d j o
 d } qd qd W| o, t i | }	 t i i | i ƒ  | ƒ } n t i t i	 }	 t i
 } | o t d
 ƒ GHn |	 |  _ | o t d ƒ GHn | |  _ t d ƒ GH|  i ƒ  |  i ƒ  d  S(   Ns   u:vs   urlhost=t   verbosei   i    s   -us	   --urlhosts   -vs	   --verboses)   Setting web_page_url to: %(web_page_url)ss"   Setting host_name to: %(mailhost)ss   Saving list(   s   -us	   --urlhost(   s   -vs	   --verbose(   t   getoptt   errorR
   t   NoneR    t   DEFAULT_URL_PATTERNt   VIRTUAL_HOSTSt   gett   lowert   DEFAULT_URL_HOSTt   DEFAULT_EMAIL_HOSTR   t   web_page_urlt	   host_namet   Savet   Unlock(
   t   mlistt   argst   optsR	   R   t   urlhostt   mailhostt   optt   argR   (    (    s   /usr/lib/mailman/bin/fix_url.pyt   fix_url:   s4    %
 
			
t   __main__i    (   R   R   R   t   pathst   MailmanR    t   Mailman.i18nR   R
   R    t   __name__(    (    (    s   /usr/lib/mailman/bin/fix_url.pyt   <module>'   s   	!
