ó
öÀ„\c           @  sé  d  Z  d d l m Z d d l m Z d d l m Z m Z d d l m Z m	 Z	 m
 Z
 d d l m Z m Z m Z d d l 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 d l m Z m Z m  Z  d d l! m" Z" d d l# m$ Z$ d d l% m& Z& m' Z' d d l( m) Z) m* Z* m+ Z+ d d l, m- Z- e. rÕd d l/ m0 Z0 m1 Z1 m2 Z2 m3 Z3 m4 Z4 m5 Z5 m6 Z6 d d l7 m8 Z8 d d l# m9 Z9 d d l: m; Z; n  e j< e= ƒ Z> d d Z? d e@ f d „  ƒ  YZA d e@ f d „  ƒ  YZB d e- f d „  ƒ  YZC d  e f d! „  ƒ  YZD e ƒ  ZE e jF eE ƒ e jG eE ƒ ZH e d" ƒ ZI eI d* k	 ržeK eI ƒ ZE e
 d# ƒ ZH n  d$ e	 f d% „  ƒ  YZL eL ƒ  ZM d& „  ZN d' eD f d( „  ƒ  YZO d) „  ZP d* S(+   uÑ   
    sphinx.builders.gettext
    ~~~~~~~~~~~~~~~~~~~~~~~

    The MessageCatalogBuilder class.

    :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
iÿÿÿÿ(   t   unicode_literals(   t   open(   t   defaultdictt   OrderedDict(   t   datetimet   tzinfot	   timedelta(   t   patht   walkt   getenv(   t   time(   t   uuid4(   t	   iteritemst   StringIO(   t   Builder(   t   pairindextypes(   t
   ThemeError(   t   __(   t   split_index_msgt   loggingt   status_iterator(   t   bold(   t   find_catalog(   t   extract_messagest   traverse_translatable_index(   t   relpatht	   ensuredirt
   canon_path(   t   Tags(   t   Anyt   DefaultDictt   Dictt   Iterablet   Listt   Sett   Tuple(   t   nodes(   t   CatalogInfo(   t   Sphinxu!  
# SOME DESCRIPTIVE TITLE.
# Copyright (C) %(copyright)s
# This file is distributed under the same license as the %(project)s package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: %(project)s %(version)s\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: %(ctime)s\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

i   t   Catalogc           B  s    e  Z d  Z d „  Z d „  Z RS(   u!   Catalog of translatable messages.c         C  s   g  |  _  t ƒ  |  _ d  S(   N(   t   messagesR   t   metadata(   t   self(    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyt   __init__E   s    	c         C  sl   t  | d ƒ s d  S| |  j k rB |  j j | ƒ g  |  j | <n  |  j | j | j | j | j f ƒ d  S(   Nu   uid(   t   hasattrR)   R(   t   appendt   sourcet   linet   uid(   R*   t   msgt   origin(    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyt   addL   s    (   t   __name__t
   __module__t   __doc__R+   R3   (    (    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyR'   B   s   	t	   MsgOriginc           B  s   e  Z d  Z d „  Z RS(   u3   
    Origin holder for Catalog message origin.
    c         C  s%   | |  _  | |  _ t ƒ  j |  _ d  S(   N(   R.   R/   R   t   hexR0   (   R*   R.   R/   (    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyR+   ]   s    		(   R4   R5   R6   R+   (    (    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyR7   X   s   t   I18nTagsc           B  s   e  Z d  Z d „  Z RS(   už   Dummy tags module for I18nBuilder.

    To translate all text inside of only nodes, this class
    always returns True value even if no tags are defined.
    c         C  s   t  S(   N(   t   True(   R*   t	   condition(    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyt   eval_conditionj   s    (   R4   R5   R6   R<   (    (    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyR9   d   s   t   I18nBuilderc           B  s_   e  Z d  Z d Z d Z d	 Z e Z d „  Z	 d	 d „ Z
 d „  Z d „  Z d „  Z d „  Z RS(
   u   
    General i18n builder.
    u   i18nu   textc         C  sK   t  j |  ƒ |  j j |  j |  j j j ƒ t ƒ  |  _ t	 t
 ƒ |  _ d  S(   N(   R   t   initt   envt   set_versioning_methodt   versioning_methodt   configt   gettext_uuidR9   t   tagsR   R'   t   catalogs(   R*   (    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyR>   y   s
    c         C  s   d S(   Nu    (    (   R*   t   docnamet   typ(    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyt   get_target_uri   s    c         C  s
   |  j  j S(   N(   R?   t
   found_docs(   R*   (    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyt   get_outdated_docs…   s    c         C  s   d  S(   N(    (   R*   t   docnames(    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyt   prepare_writing‰   s    c         C  s   d  S(   N(    (   R*   RE   t   message(    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyt   compile_catalogs   s    c         C  sð   |  j  t | |  j j ƒ } x* t | ƒ D] \ } } | j | | ƒ q) Wd |  j j j k rì x‹ t | ƒ D]z \ } } xk | D]c \ } } } }	 }
 xK t	 | | ƒ D]: } | d k rÍ | t
 j ƒ  k rÍ q£ n  | j | | ƒ q£ Wq~ Wqk Wn  d  S(   Nu   indexu   pair(   RE   R   RB   t   gettext_compactR   R3   R?   t   gettext_additional_targetsR   R   R   t   values(   R*   RF   t   doctreet   catalogt   nodeR1   t   entriesRG   t   tidt   maint   key_t   m(    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyt	   write_doc‘   s    N(   R4   R5   R6   t   nameRA   t   Nonet   versioning_comparet   Falset   use_message_catalogR>   RH   RJ   RL   RN   RZ   (    (    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyR=   o   s   				u   SOURCE_DATE_EPOCHi    t   LocalTimeZonec           B  s#   e  Z d  „  Z d „  Z d „  Z RS(   c         O  s&   t  t |  ƒ j | | Ž  t |  _ d  S(   N(   t   superR`   R+   t   tzdelta(   R*   t   argst   kw(    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyR+   ³   s    c         C  s   |  j  S(   N(   Rb   (   R*   t   dt(    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyt	   utcoffset¸   s    c         C  s
   t  d ƒ S(   Ni    (   R   (   R*   Re   (    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyt   dst¼   s    (   R4   R5   R+   Rf   Rg   (    (    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyR`   ±   s   		c         C  s»   t  j |  ƒ s t Sy t |  d d d ƒu } | j ƒ  } | j d ƒ } | j d ƒ } | j d ƒ } | j d ƒ } | |  | |  k p› | | | | k SWd  QXWn t k
 r¶ n Xt S(   Nu   rt   encodingu   utf-8u   "POT-Creation-Date:u   "PO-Revision-Date:(   R   t   existsR:   R   t   readt   indext
   ValueError(   t   filepatht   new_contentt   oldpott   old_contentt   old_header_indext   new_header_indext   old_body_indext   new_body_index(    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyt   should_writeÄ   s    t   MessageCatalogBuilderc           B  sS   e  Z d  Z d Z e d ƒ Z d „  Z d „  Z d „  Z d	 d d „ Z
 d „  Z RS(
   u=   
    Builds gettext-style message catalogs (.pot files).
    u   gettextu'   The message catalogs are in %(outdir)s.c         C  s+   t  j |  ƒ |  j ƒ  |  j j |  ƒ d  S(   N(   R=   R>   t   create_template_bridget	   templates(   R*   (    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyR>   Þ   s    
c   	      C  s¤   t  ƒ  } x” |  j j D]† } t j |  j j | ƒ } xe t | ƒ D]W \ } } } xE | D]= } | j d ƒ rW t	 t j | | ƒ ƒ } | j
 | ƒ qW qW WqA Wq W| S(   Nu   .html(   t   setRB   t   templates_pathR   t   joint   appt   srcdirR   t   endswithR   R3   (	   R*   t   template_filest   template_patht   tmpl_abs_patht   dirpatht   dirst   filest   fnt   filename(    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyt   _collect_templatesä   s    	c         C  sF  t  |  j ƒ  ƒ } | j ƒ  t j t t d ƒ |  j ƒ d d ƒt j t d ƒ t | ƒ ƒ |  j	 j
 j } xÒ t | t d ƒ d t | ƒ |  j j ƒ D]¦ } yt t | d d d	 ƒ } | j ƒ  } Wd  QXxC | | ƒ D]5 \ } } } t | | ƒ }	 |  j d
 j | |	 ƒ qØ WWq˜ t k
 r=}
 t d | |
 f ƒ ‚ q˜ Xq˜ Wd  S(   Nu   building [%s]: t   nonli   u   targets for %d template filesu   reading templates... u   purpleu   rRh   u   utf-8u   sphinxu   %s: %r(   t   listR‡   t   sortt   loggert   infoR   R   R[   t   lenRx   t   environmentt   extract_translationsR   R|   t	   verbosityR   Rj   R7   RE   R3   t	   ExceptionR   (   R*   R„   R   t   templatet   ft   contextR/   t   methR1   R2   t   exc(    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyt   _extract_from_templateð   s    
&u   updatec         C  s$   |  j  ƒ  t j |  | | | ƒ d  S(   N(   R—   R=   t   build(   R*   RK   t   summaryt   method(    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyR˜     s    
c   
        s  t  j ˆ  ƒ t d ˆ  j j d ˆ  j j d ˆ  j j d t j t	 t
 ƒ j d ƒ ƒ } x°t t ˆ  j ƒ t d ƒ d t ˆ  j ƒ ˆ  j j d „  ƒ D]r\ } } t t j ˆ  j t j | ƒ ƒ ƒ t j ˆ  j | d	 ƒ } t ƒ  } | j t | ƒ xÅ | j D]º } | j | } ˆ  j j rI| j d
 d j ‡  f d †  | Dƒ ƒ ƒ n  ˆ  j j r|| j d d j d „  | Dƒ ƒ ƒ n  | j d d ƒ j d d ƒ j d d ƒ } | j d | ƒ qý W| j  ƒ  } t! | | ƒ r’ t" | d d d ƒ }	 |	 j | ƒ Wd  QXq’ q’ Wd  S(   Nt   versiont	   copyrightt   projectt   ctimeu   %Y-%m-%d %H:%M%zu   writing message catalogs... u	   darkgreenc         S  s   |  d S(   Ni    (    (   t   textdomain__(    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyt   <lambda>  s    u   .potu   #: %s
u   
#: c         3  s:   |  ]0 \ } } } d  t  t | ˆ  j ƒ ƒ | f Vq d S(   u   %s:%sN(   R   R   t   outdir(   t   .0R.   R/   t   _(   R*   (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pys	   <genexpr>%  s   u   # %s
u   
# c         s  s   |  ] \ } } } | Vq d  S(   N(    (   R¢   R£   R0   (    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pys	   <genexpr>*  s    u   \u   \\u   "u   \"u   
u   \n"
"u   msgid "%s"
msgstr ""

u   wRh   u   utf-8(#   R=   t   finisht   dictRB   R›   Rœ   R   R   t   fromtimestampt	   timestampt   ltzt   strftimeR   R   RE   R   R   R|   R   R   R   R{   R¡   t   dirnameR   t   writet   POHEADERR(   R)   t   gettext_locationRC   t   replacet   getvalueRu   R   (
   R*   t   datat
   textdomainRS   t   pofnt   outputRM   t	   positionst   contentt   pofile(    (   R*   s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyR¤   	  sB    		"	N(   R4   R5   R6   R[   R   t   epilogR>   R‡   R—   R\   R˜   R¤   (    (    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyRv   ×   s   			c         C  s…   |  j  t ƒ |  j d t d ƒ |  j d t d ƒ |  j d t d ƒ |  j d t d ƒ |  j d g  d ƒ i d d	 6t d
 6t d 6S(   Nu   gettext_compactu   gettextu   gettext_locationu   gettext_uuidu   gettext_auto_buildu   envu   gettext_additional_targetsu   builtinu   versionu   parallel_read_safeu   parallel_write_safe(   t   add_builderRv   t   add_config_valueR:   R^   (   R|   (    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyt   setup9  s    N(Q   R6   t
   __future__R    t   codecsR   t   collectionsR   R   R   R   R   t   osR   R   R	   R
   t   uuidR   t   sixR   R   t   sphinx.buildersR   t   sphinx.domains.pythonR   t   sphinx.errorsR   t   sphinx.localeR   t   sphinx.utilR   R   R   t   sphinx.util.consoleR   t   sphinx.util.i18nR   t   sphinx.util.nodesR   R   t   sphinx.util.osutilR   R   R   t   sphinx.util.tagsR   R^   t   typingR   R   R   R    R!   R"   R#   t   docutilsR$   R%   t   sphinx.applicationR&   t	   getLoggerR4   R‹   R¬   t   objectR'   R7   R9   R=   R§   R¦   t   utcfromtimestampRb   t   source_date_epochR\   t   floatR`   R¨   Ru   Rv   Rº   (    (    (    s6   lib/python2.7/site-packages/sphinx/builders/gettext.pyt   <module>
   sR   4
7			b