3

T'ícnã@sdZddlmZmZmZmZmZmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZddlmZdd	lmZer”dd
lmZddlmZedƒed
ƒedƒdœZddddœZGdd„deƒZGdd„deƒZGdd„deƒZdeeefdœdd„Z dS)zThe changeset domain.é)Ú
TYPE_CHECKINGÚAnyÚDictÚListÚ
NamedTupleÚcast)Únodes)ÚNode)Úaddnodes)ÚDomain)Ú_)ÚSphinxDirective)Ú
OptionSpec)ÚSphinx)ÚBuildEnvironmentzNew in version %szChanged in version %szDeprecated since version %s)ÚversionaddedÚversionchangedÚ
deprecatedÚaddedÚchangedrc@s&eZdZUeeeee	e
dS)Ú	ChangeSetN)Ú__name__Ú
__module__Ú__qualname__ÚstrÚtypeÚdocnameÚintÚlinenoÚmoduleZdescnameÚcontent©r!r!ú:/tmp/pip-build-gk9425m9/sphinx/sphinx/domains/changeset.pyr s
rc@s<eZdZUdZdZdZdZdZiZe	e
edœdd„ZdS)Ú
VersionChangezT
    Directive to describe a change/addition/deprecation in a specific version.
    Té)Úreturnc
Cstjƒ}|jj|_|j|ƒ|j|d<|jd|d<t|j|jd}t|jƒdkr¨|jj	|jd|j
dƒ\}}tj|jddf|žddiŽ}|j|ƒ|j
|ƒng}|jrÆ|jj|j|j|ƒd	t|jg}t|ƒdkoît|dtjƒr‚|djrTtj|djd
d}|dj|_|dj|_||dj7}|djtjdd|ddƒttj|dƒ}|jdtjdd||d
ƒnjt|ƒdkrÀtjddtjdd||d
dd}|jd|ƒn,tjddtjdd||d
dd}|j
|ƒtt|jjdƒƒ}|j|ƒ|g}	|	|7}	|	S)NrrÚversionér$ÚÚtranslatableFÚversionmodifiedT)r)z%s: )Úclassesz%s.Ú	changeset)r
r*ÚstateÚdocumentZset_source_infoÚnameÚ	argumentsÚ
versionlabelsÚlenZinline_textrrZ	paragraphÚappendr Znested_parseZcontent_offsetÚversionlabel_classesÚ
isinstanceZ	rawsourceÚinlineÚsourceÚlineÚchildrenZreplace_selfrÚinsertÚChangeSetDomainÚenvZ
get_domainÚnote_changeset)
ÚselfÚnodeÚtextÚinodesÚmessagesÚparar+r ÚdomainÚretr!r!r"Úrun3sN





zVersionChange.runN)
rrrÚ__doc__Zhas_contentZrequired_argumentsZoptional_argumentsZfinal_argument_whitespaceZoption_specrrr	rFr!r!r!r"r#)s
r#c@s¦eZdZUdZdZdZdiiZeeee	e
efdœdd„ƒZe
jddœd	d
„Ze	ddœdd
„Ze
e	eddœdd„Zde	ejddœdd„Ze	e
edœdd„ZdS)r;zDomain for changesets.r,Úchanges)r%cCs|jjdiƒS)NrH)ÚdataÚ
setdefault)r>r!r!r"Ú
changesetspszChangeSetDomain.changesetsN)r?r%cCs\|d}|jjjdƒ}|jjjdƒ}t|d|jj|j|||jƒƒ}|jj	|gƒj
|ƒdS)Nr&z	py:moduleÚobjectr)r<Zref_contextÚgetZ	temp_datarrr8ZastextrKrJr3)r>r?r&rZobjnamer,r!r!r"r=tszChangeSetDomain.note_changeset)rr%cCsBx<|jjƒD].}x(|dd…D]}|j|kr|j|ƒqWqWdS)N)rKÚvaluesrÚremove)r>rrHr,r!r!r"Ú	clear_doc|s
zChangeSetDomain.clear_doc)ÚdocnamesÚ	otherdatar%cCsNxH|djƒD]8\}}|jj|gƒ}x |D]}|j|kr*|j|ƒq*WqWdS)NrH)ÚitemsrKrJrr3)r>rQrRr&ZotherchangesrHr,r!r!r"Úmerge_domaindata‚s


z ChangeSetDomain.merge_domaindatar)r<rr.r%cCsdS)Nr!)r>r<rr.r!r!r"Úprocess_docŠszChangeSetDomain.process_doc)r&r%cCs|jj|gƒS)N)rKrM)r>r&r!r!r"Úget_changesets_forsz"ChangeSetDomain.get_changesets_for)rrrrGr/ÚlabelZinitial_datarÚpropertyrrrrKr
r*r=rPrTrr.rUrVr!r!r!r"r;fs
r;r)Úappr%cCs<|jtƒ|jdtƒ|jdtƒ|jdtƒdddddœS)NrrrÚbuiltinr$T)r&Zenv_versionZparallel_read_safeZparallel_write_safe)Z
add_domainr;Z
add_directiver#)rYr!r!r"Úsetup‘s
r[N)!rGÚtypingrrrrrrZdocutilsrZdocutils.nodesr	Zsphinxr
Zsphinx.domainsrZ
sphinx.localerZsphinx.util.docutilsr
Zsphinx.util.typingrZsphinx.applicationrZsphinx.environmentrr1r4rr#r;rr[r!r!r!r"Ú<module>s* 	=+