B
    \m                 @   s   d 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	 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 edededdZeedee	_edddddddgZG dd deZG dd deZdd ZdS )z
    sphinx.domains.changeset
    ~~~~~~~~~~~~~~~~~~~~~~~~

    The changeset domain.

    :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    )
namedtuple)nodes)	iteritems)addnodes)locale)DeprecatedDictRemovedInSphinx30Warning)Domain)_)SphinxDirective)set_source_infozNew in version %szChanged in version %szDeprecated since version %s)versionaddedversionchanged
deprecatedzesphinx.locale.versionlabels is deprecated. Please use sphinx.domains.changeset.versionlabels instead.	ChangeSettypedocnamelinenomoduleZdescnamecontentc               @   s,   e Zd ZdZdZdZdZdZi Zdd Z	dS )VersionChangezT
    Directive to describe a change/addition/deprecation in a specific version.
    T   c             C   s  t  }| jj|_t| | | j|d< | jd |d< t| j | jd  }t| jdkr| j	| jd | j
d \}}tj| jd df|ddi}t| | || ng }| jr| j| j| j| t|rht|d tjrD|d jrDtj|d jd	d
}|d j|_|d j|_||d j7 }|d tjdd|dd
 |d dtjdd| dgd n.tjddtjdd| dgddd
}|| | jd| |g| S )Nr   r   version   r    translatableFT)r   z%s: versionmodified)classesz%s.	changeset)r   r   statedocumentr   nameZ	argumentsversionlabelslenZinline_textr   r   Z	paragraphappendr   Znested_parseZcontent_offset
isinstanceZ	rawsourceZinlinesourcelineZchildrenZreplace_selfinsertenvZ
get_domainnote_changeset)selfnodetextZinodesZmessagesZparar    r.   7lib/python3.7/site-packages/sphinx/domains/changeset.pyrun>   s>    





zVersionChange.runN)
__name__
__module____qualname____doc__Zhas_contentZrequired_argumentsZoptional_argumentsZfinal_argument_whitespaceZoption_specr0   r.   r.   r.   r/   r   4   s   r   c               @   sH   e Zd ZdZdZdZdi iZdd Zdd Zdd	 Z	d
d Z
dd ZdS )ChangeSetDomainzDomain for changesets.r   changesc             C   sJ   xDt | jd D ]2\}}x(|d d  D ]}|j|kr&|| q&W qW d S )Nr6   )r   datar   remove)r+   r   r   r6   r   r.   r.   r/   	clear_docn   s    
zChangeSetDomain.clear_docc             C   sR   xLt |d D ]<\}}| jd |g }x |D ]}|j|kr.|| q.W qW d S )Nr6   )r   r7   
setdefaultr   r$   )r+   ZdocnamesZ	otherdatar   Zotherchangesr6   r   r.   r.   r/   merge_domaindatau   s
    

z ChangeSetDomain.merge_domaindatac             C   s   d S )Nr.   )r+   r)   r   r    r.   r.   r/   process_doc~   s    zChangeSetDomain.process_docc             C   s`   |d }| j jd}| j jd}t|d | j j|j||| }| jd 	|g 
| d S )Nr   z	py:moduleobjectr   r6   )r)   Zref_contextgetZ	temp_datar   r   r'   Zastextr7   r:   r$   )r+   r,   r   r   Zobjnamer   r.   r.   r/   r*      s    zChangeSetDomain.note_changesetc             C   s   | j d |g S )Nr6   )r7   r>   )r+   r   r.   r.   r/   get_changesets_for   s    z"ChangeSetDomain.get_changesets_forN)r1   r2   r3   r4   r!   ZlabelZinitial_datar9   r;   r<   r*   r?   r.   r.   r.   r/   r5   d   s   		r5   c             C   s<   |  t | dt | dt | dt dddddS )Nr   r   r   Zbuiltinr   T)r   Zenv_versionZparallel_read_safeZparallel_write_safe)Z
add_domainr5   Zadd_directiver   )Zappr.   r.   r/   setup   s    
r@   N)r4   collectionsr   Zdocutilsr   Zsixr   Zsphinxr   r   Zsphinx.deprecationr   r   Zsphinx.domainsr	   Zsphinx.localer
   Zsphinx.util.docutilsr   Zsphinx.util.nodesr   r"   r   r   r5   r@   r.   r.   r.   r/   <module>
   s,   0,