ó
´,þQc           @   s<  d  d l  m Z m Z d  d l m Z m Z d  d l m Z d  d l m	 Z	 m
 Z
 d  d l m Z d  d l m Z m Z d  d l m Z d  d l m Z d  d	 l m Z d  d
 l m Z d „  Z 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 „  Z d S(   iÿÿÿÿ(   t   l_t   _(   t   Domaint   ObjType(   t   XRefRole(   t   GenericObjectt   StandardDomain(   t   ObjectDescription(   t   clean_astextt   make_refnode(   t   ws_re(   t   addnodes(   t   Field(   t   nodesc         C   s_   |  d  d k r |  d }  n  |  d d k r: |  d  }  n  |  j  d d ƒ }  |  j d ƒ } | S(   s/   
    Formats anchor ID from config option.
    i   s   $cfg['iþÿÿÿs   ']s   [$i]t    s   ']['(   t   replacet   split(   t   textt   parts(    (    sF   /var/www/git/phpmyadmin/release/phpMyAdmin-4.0.5/doc/_ext/configext.pyt   get_id_from_cfg   s    t   ConfigOptionc        	   B   sz   e  Z e d  ƒ Z d
 Z e Z e d d e d ƒ d e	 d d ƒe d d e d ƒ d e	 d d ƒg Z
 d „  Z d	 „  Z RS(   s   configuration option; %st   defaultt   labels   Default valuet   has_argt   namest   typet   Typec         C   s6   | j  ƒ  | t j | | ƒ 7} t j d | ƒ } | S(   NR   (   t   clearR   t	   desc_nameR
   t   sub(   t   selft   sigt   signodet   name(    (    sF   /var/www/git/phpmyadmin/release/phpMyAdmin-4.0.5/doc/_ext/configext.pyt   handle_signature'   s    
c   	      C   s{  t  | ƒ } d d j | ƒ } | d j | ƒ |  j j j | ƒ d } |  j | f } |  j d j | | | | f ƒ |  j d j | | | | f ƒ | d d k rt | ƒ d k rd	 j | d ƒ } |  j d j | t	 d
 ƒ | | | f ƒ |  j d j | | | | f ƒ n/ d	 j | ƒ } |  j d j | | | | f ƒ |  j
 j | f |  j
 j d d |  j | f <d  S(   Ns   cfg_%sR   t   idst   singlet   entriesi    t   Serversi   s   , s   server configuration; %st   configt   objects(   R   t   joint   appendt   statet   documentt   note_explicit_targett   indextemplatet	   indexnodet   lenR    t   envt   docnamet
   domaindatat   objtype(	   R   R!   R   R    t   targetpartst
   targetnamet	   indextypet
   indexentryt	   indexname(    (    sF   /var/www/git/phpmyadmin/release/phpMyAdmin-4.0.5/doc/_ext/configext.pyt   add_target_and_index.   s(    "N(   s   default(   s   type(   t   __name__t
   __module__R    R.   t   Nonet
   parse_nodet   Truet   has_argumentsR   t   Falset   doc_field_typesR"   R:   (    (    (    sF   /var/www/git/phpmyadmin/release/phpMyAdmin-4.0.5/doc/_ext/configext.pyR      s   	t   ConfigSectionXRefRolec           B   s   e  Z d  Z d „  Z RS(   sR   
    Cross-referencing role for configuration sections (adds an index entry).
    c   	      C   s©   | s | g g  f S| d } d | j  d ƒ } t j ƒ  } d | | | f d t d ƒ | | | f g | d <t j d d d | g ƒ} | j | ƒ | | | g g  f S(	   Nt	   reftargets   index-%st   indexR$   s   configuration section; %sR%   R   R#   (   t   new_serialnoR   RE   R   R   t   targetR-   (	   R   R,   R1   t   nodet   is_reft   varnamet   tgtidR/   t
   targetnode(    (    sF   /var/www/git/phpmyadmin/release/phpMyAdmin-4.0.5/doc/_ext/configext.pyt   result_nodesQ   s    
#(   R;   R<   t   __doc__RM   (    (    (    sF   /var/www/git/phpmyadmin/release/phpMyAdmin-4.0.5/doc/_ext/configext.pyRC   L   s   t   ConfigSectionc           B   s,   e  Z e d  ƒ Z d Z d „  Z d „  Z RS(   s   configuration section; %sc         C   sZ   |  j  r$ |  j  |  j | | ƒ } n2 | j ƒ  | t j | | ƒ 7} t j d | ƒ } | S(   NR   (   R>   R1   R   R   R   R
   R   (   R   R   R    R!   (    (    sF   /var/www/git/phpmyadmin/release/phpMyAdmin-4.0.5/doc/_ext/configext.pyR"   c   s    	
c         C   sü   d |  j  | f } | d j | ƒ |  j j j | ƒ |  j rË |  j j d ƒ } | d k r’ |  j |  j ƒ  } |  j | d j ƒ  | f } n d } |  j | f } |  j d j | | | | f ƒ n  |  j	 j
 | f |  j	 j d d	 |  j  | f <d  S(
   Ns   %s-%sR#   t   :iÿÿÿÿi   R$   R%   R'   R(   (   R4   R*   R+   R,   R-   R.   t   findt   stripR/   R1   R2   R3   (   R   R!   R   R    R6   t   colonR7   R8   (    (    sF   /var/www/git/phpmyadmin/release/phpMyAdmin-4.0.5/doc/_ext/configext.pyR:   m   s    	!N(   R;   R<   R    R.   R=   R>   R"   R:   (    (    (    sF   /var/www/git/phpmyadmin/release/phpMyAdmin-4.0.5/doc/_ext/configext.pyRO   _   s   	
t   ConfigOptionXRefRolec           B   s   e  Z d  Z d „  Z RS(   sQ   
    Cross-referencing role for configuration options (adds an index entry).
    c   	      C   s©   | s | g g  f S| d } d | j  d ƒ } t j ƒ  } d | | | f d t d ƒ | | | f g | d <t j d d d | g ƒ} | j | ƒ | | | g g  f S(	   NRD   s   index-%sRE   R$   s   configuration option; %sR%   R   R#   (   RF   R   RE   R   R   RG   R-   (	   R   R,   R1   RH   RI   RJ   RK   R/   RL   (    (    sF   /var/www/git/phpmyadmin/release/phpMyAdmin-4.0.5/doc/_ext/configext.pyRM   „   s    
#(   R;   R<   RN   RM   (    (    (    sF   /var/www/git/phpmyadmin/release/phpMyAdmin-4.0.5/doc/_ext/configext.pyRT      s   t   ConfigFileDomainc           B   sœ   e  Z d  Z d Z i e e d ƒ d ƒ d 6e e d ƒ d ƒ d 6Z i e d 6e d 6Z	 i e
 ƒ  d 6e ƒ  d 6Z i i  d 6Z d „  Z d „  Z d	 „  Z RS(
   R'   t   Configs   config optiont   options   config sectiont   sectionR(   c         C   sK   xD |  j  d j ƒ  D]/ \ } \ } } | | k r |  j  d | =q q Wd  S(   NR(   (   t   datat   items(   R   R2   t   keyt   fnR   (    (    sF   /var/www/git/phpmyadmin/release/phpMyAdmin-4.0.5/doc/_ext/configext.pyt	   clear_doc¨   s    &c   
      C   sI   |  j  d j | | f d ƒ \ } }	 | s/ d  St | | | |	 | ƒ Sd  S(   NR(   R   (   R   R   (   RY   t   getR=   R	   (
   R   R1   t   fromdocnamet   buildert   typRG   RH   t   contnodeR2   t   labelid(    (    sF   /var/www/git/phpmyadmin/release/phpMyAdmin-4.0.5/doc/_ext/configext.pyt   resolve_xref­   s
    %c         c   s[   xT |  j  d j ƒ  D]? \ \ } } } | | | | d | d |  j | j d f Vq Wd  S(   NR(   i    i   t
   searchprio(   RY   t	   iteritemst   object_typest   attrs(   R   R   R!   t   info(    (    sF   /var/www/git/phpmyadmin/release/phpMyAdmin-4.0.5/doc/_ext/configext.pyt   get_objects¶   s    &(   R;   R<   R!   R   R   R    Rg   R   RO   t
   directivesRT   RC   t   rolest   initial_dataR]   Rd   Rj   (    (    (    sF   /var/www/git/phpmyadmin/release/phpMyAdmin-4.0.5/doc/_ext/configext.pyRU   “   s    


			c         C   s   |  j  t ƒ d  S(   N(   t
   add_domainRU   (   t   app(    (    sF   /var/www/git/phpmyadmin/release/phpMyAdmin-4.0.5/doc/_ext/configext.pyt   setup»   s    N(   t   sphinx.localeR    R   t   sphinx.domainsR   R   t   sphinx.rolesR   t   sphinx.domains.stdR   R   t   sphinx.directivesR   t   sphinx.util.nodesR   R	   t   sphinx.utilR
   t   sphinxR   t   sphinx.util.docfieldsR   t   docutilsR   R   R   RC   RO   RT   RU   Rp   (    (    (    sF   /var/www/git/phpmyadmin/release/phpMyAdmin-4.0.5/doc/_ext/configext.pyt   <module>   s    	3 (