403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /usr/lib64/python3.9/site-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/lib64/python3.9/site-packages/mercurial/__pycache__/templatefuncs.cpython-39.opt-1.pyc
a

�+�b�x�@s�ddlmZddlZddlmZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZddlmZmZejZejZejZejZej Z ej!Z!ej"Z"ej#Z#iZ$e�%e$�Z%e%d�d	d
��Z&e%ddd
�dd��Z'e%dddhd�dd��Z(e%ddddhd�dd��Z)e%ddhd�dd��Z*e%d�d d!��Z+e%d"�d#d$��Z,e%d%dhd�d&d'��Z-e%d(d)dhd�d*d+��Z.e%d,d-d
�d.d/��Z/e%d0�d1d2��Z0e%d3�d4d5��Z1e%d6dhd�d7d8��Z2e%d9dhd�d:d;��Z3e%d<dhd�d=d>��Z4d?d@�Z5e%dA�dBdC��Z6e%dD�dEdF��Z7e%dG�dHdI��Z8e%dJ�dKdL��Z9e%dMdhd�dNdO��Z:e%dP�dQdR��Z;e%dS�dTdU��Z<e%dV�dWdX��Z=e%dY�dZd[��Z>e%d\�d]d^��Z?e%d_�d`da��Z@e%db�dcdd��ZAe%de�dfdg��ZBe%dh�didj��ZCe%dkd)hd�dldm��ZDe%dnd)dhd�dodp��Ze%dq�drds��ZEe%dt�dudv��ZFe%dwdxd
�dydz��ZGe%d{d)dhd�d|d}��ZHe%d~�dd���ZIe%d��d�d���ZJe%d��d�d���ZKe%d�d�d)dhd�d�d���ZLe%d��d�d���ZMd�d��ZNe$�O�ZPdS)��)�absolute_importN�)�_)�bin)�color�dagop�diffutil�encoding�error�minirst�obsutil�pycompat�	registrar�revset�
revsetlang�scmutil�templatefilters�
templatekw�templateutil�util)�dateutil�
stringutilsdate(date[, fmt])cCs�dt|�krdks(nt�td���t|||dtd��}d}t|�dkr^t|||d�}|durpt�|�St�||�SdS)z�Format a date. See :hg:`help dates` for formatting
    strings. The default is a Unix date format, including the timezone:
    "Mon Sep 04 15:13:13 2006 0700".r�s!date expects one or two argumentsrsdate expects a date informationN)�lenr
�
ParseErrorr�evaldate�
evalstringrZdatestr)�context�mapping�args�date�fmt�r"�=/usr/lib64/python3.9/site-packages/mercurial/templatefuncs.pyr 3s�
r sdict([[key=]value...])s*args **kwargs)�argspeccs�t��}|dD]V}t�|�}|s0t�td���||vsD||dvrVt�td�|��t��|�||<q|���fdd�t	�
|d�D��t�|�S)zvConstruct a dict from key-value pairs. A key may be omitted if
    a value expression can provide an unambiguous name.�argssdict key cannot be inferredskwargss!duplicated dict key '%s' inferredc3s"|]\}}|t��|�fVqdS�N��evalfuncarg)�.0�k�v�rrr"r#�	<genexpr>Zs�zdict_.<locals>.<genexpr>)rZsortdictr�findsymbolicnamer
rrr(�updater
�	iteritemsZ
hybriddict)rrr�datar+r*r"r,r#�dict_Ls
�r2s)diff([includepattern [, excludepattern]])�ctx�ui)�requirescsvt��dkrt�td������fdd�}���d�}���d�}t�|�}|j|�g|d�|d��|d	�}d
�	|�S)zCShow a diff, optionally
    specifying files to include or exclude.rs(diff expects zero, one, or two argumentscs.|t��kr*t���|���}|r*|gSgSr&)rr�strip)�i�s�rrrr"r#�getpatternsks
zdiff.<locals>.getpatternsr3r4rr)�matchZopts�)
rr
rr�resourcerZdiffallopts�diffr;�join)rrrr:�ctx�uiZdiffopts�chunksr"r9r#r>as
�r>sextdata(source)�source�cache)r$r5cCs�d|vrt�td���t|||d�}|sft�|d�}|rXtjtd�td�|d��nt�td���|�|d��di�}|�|d�}||vr�||}nt�	|�
�|�}||<|�|��d	�S)
zBShow a text read from the specified extdata source. (EXPERIMENTAL)rCsextdata expects one argumentsempty data source specifiedsdid you mean extdata('%s')?��hintrDsextdatar3r<)
r
rrrrr.r=�
setdefaultrZ
extdatasource�repo�get�rev)rrr�sourceZsym�cacher@r1r"r"r#�extdata|s"
�
rMsfiles(pattern)cCs`t|�dkst�td���t|||d�}|�|d�}|�|g�}t|�|��}t	�
||d|�S)zUAll files of the current changeset matching the pattern. See
    :hg:`help patterns`.rsfiles expects one argumentrr3sfile)rr
rrrr=r;�list�matchesrZcompatfileslist)rrr�rawr@�m�filesr"r"r#rR�srRs1fill(text[, width[, initialident[, hangindent]]])cCs�dt|�krdks(nt�td���t|||d�}d}d}d}dt|�kr\dkr�nnNt|||dtd��}z$t|||d�}t|||d	�}Wnty�Yn0t�||||�S)
zJFill many
    paragraphs with optional indentation. See the "fill" filter.r�s"fill expects one to four argumentsr�Lr<rsfill expects an integer width�)	rr
rrr�evalinteger�
IndexErrorr�fill)rrr�text�widthZ
initindentZ
hangindentr"r"r#rX�s&�rXsfilter(iterable[, expr])csrdt��krdks(nt�td���t���d�}t��dkrT��fdd�}n���fdd�}|���|�S)zsRemove empty elements from a list or a dict. If expr specified, it's
    applied to each element to test emptiness.rrs#filter expects one or two argumentsrcs|����Sr&)Ztobool)�wr,r"r#�select�szfilter_.<locals>.selectcs<t|tj�st�td������|����}t�|�d�S)Nsnot filterable by expressionr)	�
isinstancerZmappabler
rrZ
overlaymapZtomap�evalboolean)r[�lmr9r"r#r\�s)rr
rr�evalwrapped�filter)rrr�iterabler\r"r9r#�filter_�srcsformatnode(node)cCsJt|�dkrt�td���|�|d�}t|||d�}|jr@|St�|�S)z;Obtain the preferred form of a changeset hash. (DEPRECATED)rsformatnode expects one argumentr4r)	rr
rrr=rZ	debugflagrZshort)rrrrA�noder"r"r#�
formatnode�sresmailmap(author)�repocCstt|�dkrt�td���t|||d�}|�|d�}|�|d�}d|vrd|j�d�}t�	|�|d<t�
|d|�S)zNReturn the author, updated according to the value
    set in the .mailmap filersmailmap expects one argumentrrDrfsmailmaps.mailmap)rr
rrrr=ZwvfsZtryreadrZparsemailmapZmapname)rrrZauthorrLrHr1r"r"r#�mailmap�srgs@pad(text, width[, fillchar=' '[, left=False[, truncate=False]]])s!text width fillchar left truncatec	Csd|vsd|vrt�td���t|||dtd��}t|||d�}d}d}d}d|vr�t|||d�}tt�|��dkr�t�td	���d
|vr�t|||d
�}d|vr�t|||d�}|t	�
t�|��}|dkr�|r�t	jt�|�||d
�S|dkr�|S|�r|||S|||SdS)z#Pad text with a
    fill character.stextswidths#pad() expects two to four argumentsspad() expects an integer widthF� sfillcharrs%pad() expects a single fill charactersleftstruncater)ZleftsideN)r
rrrVrrrZstripeffectsr^r	ZcolwidthZtrim)	rrrrZrY�truncate�leftZfillcharZ	fillwidthr"r"r#�pad�s8�rks&indent(text, indentchars[, firstline])cCsxdt|�krdks(nt�td���t|||d�}t|||d�}|}t|�dkrht|||d�}tj|||d�S)z�Indents all non-empty lines
    with the characters given in the indentchars string. An optional
    third parameter will override the indent for the first line only
    if present.rrUs'indent() expects two or three argumentsrr)�	firstline)rr
rrrr�indent)rrrrYrmrlr"r"r#rm*srmsget(dict, key)c
Cs�t|�dkrt�td���t|||d�}t|||d�}z|�|||�WStjy�}z&td�}tjt|�|d��WYd}~n
d}~00dS)z�Get an attribute/key from an object. Some keywords
    are complex types. This function allows you to obtain the value of an
    attribute on these types.rsget() expects two argumentsrrs&get() expects a dict as first argumentrEN)rr
rrr`�
evalrawexpZ	getmember�bytes)rrrZdictarg�key�errrFr"r"r#rI>srIs config(section, name[, default])cCs|�|d�j}t||||t�S)z5Returns the requested hgrc config option as a string.r4)r=�config�_configr�rrr�fnr"r"r#rrQsrrs$configbool(section, name[, default])cCs|�|d�j}t||||t�S)z6Returns the requested hgrc config option as a boolean.r4)r=�
configboolrsr^rtr"r"r#rvXsrvs#configint(section, name[, default])cCs|�|d�j}t||||t�S)z7Returns the requested hgrc config option as an integer.r4)r=�	configintrsrVrtr"r"r#rw_srwcCs~dt|�krdks(nt�td���t|||d�}t|||d�}t|�dkrp||||d�}||||�S|||�SdS)NrrUs%config expects two or three argumentsrr)rr
rr�evalstringliteral)rrrZconfigfnZ	defaultfn�section�name�defaultr"r"r#rsfsrssif(expr, then[, else])cCsldt|�krdks(nt�td���t|||d�}|rLt|||d�St|�dkrht|||d�SdS)z?Conditionally execute based on the result of
    an expression.rrUs!if expects two or three argumentsrrN)rr
rrr^rn)rrr�testr"r"r#�if_vsr}s*ifcontains(needle, haystack, then[, else])cCs�dt|�krdks(nt�td���t|||d�}z"t|||d�}|�|||�}Wntjyrd}Yn0|r�t|||d�St|�dkr�t|||d�SdS)	zNConditionally execute based
    on whether the item "needle" is in "haystack".rUrSs*ifcontains expects three or four argumentsrrFrN)rr
rrr`rn�contains)rrrZhaystackZneedle�foundr"r"r#�
ifcontains�s
r�s ifeq(expr1, expr2, then[, else])cCs�dt|�krdks(nt�td���t|||d�}t|||d�}||kr`t|||d�St|�dkr|t|||d�SdS)zBConditionally execute based on
    whether 2 items are equivalent.rUrSs$ifeq expects three or four argumentsrrrN)rr
rrrrn)rrrr|r;r"r"r#�ifeq�sr�sjoin(list, sep)cCsfdt|�krdks(nt�td���t|||d�}d}t|�dkrXt|||d�}|�|||�S)z&Join items in a list with a delimiter.rrs!join expects one or two argumentsrrh)rr
rrr`rr?)rrrZjoinsetZjoinerr"r"r#r?�sr?slabel(label, expr)cCsRt|�dkrt�td���|�|d�}t|||d�}t|||d�}|�||�S)z�Apply a label to generated content. Content with
    a label applied can result in additional post-processing, such as
    automatic colorization.rslabel expects two argumentsr4rr)rr
rrr=rrx�label)rrrrA�thingr�r"r"r#r��sr�slatesttag([pattern])cCsHt|�dkrt�td���d}t|�dkr:t|||d�}t�|||�S)aThe global tags matching the given pattern on the
    most recent globally tagged ancestor of this changeset.
    If no such tags exist, the "{tag}" template resolves to
    the string "null". See :hg:`help revisions.patterns` for the pattern
    syntax.
    rs&latesttag expects at most one argumentNr)rr
rrrrZshowlatesttags)rrr�patternr"r"r#�	latesttag�sr�slocaldate(date[, tz])c	Cs�dt|�krdks(nt�td���t|||dtd��}t|�dkr�d}t|||d�}t|t�r~t�	|�\}}|r~d}|dur�zt
|�}Wq�ttfy�t�td���Yq�0nt�
�d}t�|d|f�S)zIConverts a date to the specified timezone.
    The default is local date.rrs&localdate expects one or two argumentsrs$localdate expects a date informationNslocaldate expects a timezone)rr
rrrr(r]rorZ
parsetimezone�int�	TypeError�
ValueErrorZmakedaterr )rrrr ZtzoffsetZtzZ	remainderr"r"r#�	localdate�s,�
r�s
max(iterable)c
Ks~t|�dkrt�td���t|||d�}z|�||�WStjyx}z&td�}tjt|�|d��WYd}~n
d}~00dS)zReturn the max of an iterablersmax expects one argumentrs(max first argument should be an iterablerEN)rr
rrr`Zgetmaxro�rrr�kwargsrbrqrFr"r"r#�max_�sr�s
min(iterable)c
Ks~t|�dkrt�td���t|||d�}z|�||�WStjyx}z&td�}tjt|�|d��WYd}~n
d}~00dS)zReturn the min of an iterablersmin expects one argumentrs(min first argument should be an iterablerEN)rr
rrr`Zgetminror�r"r"r#�min_
sr�s	mod(a, b)cCs>t|�dkst�td���dd�}t�||||d|df�S)z0Calculate a mod b such that a / b + a mod b == arsmod expects two argumentscSs||Sr&r")�a�br"r"r#�<lambda>$r<zmod.<locals>.<lambda>rr)rr
rrrZ
runarithmetic)rrr�funcr"r"r#�mods�r�sobsfateoperations(markers)c	Csrt|�dkrt�td���t|||d�}zt�|�}tj|dd�WSt	t
fyltd�}t�|��Yn0dS)�CCompute obsfate related information based on markers (EXPERIMENTAL)rs&obsfateoperations expects one argumentrs	operation�rzs6obsfateoperations first argument should be an iterableN)rr
rrr(rZmarkersoperationsr�
hybridlistr��KeyError�rrr�markersr1�errmsgr"r"r#�obsfateoperations*s
r�sobsfatedate(markers)c	Cstt|�dkrt�td���t|||d�}zt�|�}tj|ddd�WSt	t
fyntd�}t�|��Yn0dS)	r�rs obsfatedate expects one argumentrsdates%d %d)rzr!s0obsfatedate first argument should be an iterableN)rr
rrr(rZmarkersdatesrr�r�r�r�r"r"r#�obsfatedate<s
r�sobsfateusers(markers)c
Cstt|�dkrt�td���t|||d�}zt�|�}tj|dd�WSt	t
tfyntd�}t�|��Yn0dS)r�rs!obsfateusers expects one argumentrsuserr�s>obsfateusers first argument should be an iterable of obsmakersN)rr
rrr(rZmarkersusersrr�r�r�r�)rrrr�r1�msgr"r"r#�obsfateusersOs
�r�s obsfateverb(successors, markers)cCsrt|�dkrt�td���t|||d�}t|||d�}zt�||�WStyltd�}t�|��Yn0dS)zFCompute obsfate related information based on successors (EXPERIMENTAL)rs!obsfateverb expects two argumentsrrs.obsfateverb first argument should be countableN)rr
rrr(r�obsfateverbr�)rrrZ
successorsr�r�r"r"r#r�dsr�s
relpath(path)cCs@t|�dkrt�td���|�|d�}t|||d�}|�|�S)zhConvert a repository-absolute path into a filesystem path relative to
    the current working directory.rsrelpath expects one argumentrfr)rr
rrr=rZpathto)rrrrH�pathr"r"r#�relpathvs
r�srevset(query[, formatargs...])c
s�t|�dkst�td���t��|d�}���d���fdd�}t|�dkr�d}��fdd	�|dd�D�}|tj|g|�R��}n>���d
�}|�di�}	|}||	vr�|	|}n||�}||	|<t	j
�|d|d
�S)z8Execute a revision set query. See
    :hg:`help revset`.rs$revset expects one or more argumentsrfcs tj�j|t���d�}|��S)N)�lookup)�	revsetmodr;rAZlookupfn)�exprrQ)rHr"r#�query�szrevset.<locals>.queryrNcsg|]}t��|��qSr"r')r)r�r,r"r#�
<listcomp>�r<zrevset.<locals>.<listcomp>rDsrevsetcachesrevision)rz�cachekey)rr
rrrr=rZ
formatspecrGr�revslist)
rrrrPr�rpZ
formatargsZrevsrLZrevsetcacher")rrrHr#r�s"
rsrstdoc(text, style)cCsLt|�dkrt�td���t|||d�}t|||d�}tj||dgd�S)zFormat reStructuredText.rsrstdoc expects two argumentsrrsverbose)�styleZkeep)rr
rrrr�format)rrrrYr�r"r"r#�rstdoc�s
r�ssearch(pattern, text)c	Cst|�dkrt�td���t|||d�}t|||d�}zt�|�}Wn&tjynt�td�|��Yn0|��tt	�
|j��@}|r�t�td�d�dd	�t
|�D��|d
���|�|�}|s�t��Sd|�d�i}|�dd	�t|��d�D��|�t	�
|����tj|d
d�S)z�Look for the first text matching the regular expression pattern.
    Groups are accessible as ``{1}``, ``{2}``, ... in %-mapped template.rssearch expects two argumentsrrs!search got an invalid pattern: %ss2invalid group %(group)s in search pattern: %(pat)ss, css|]}d|VqdS)s'%s'Nr")r)�gr"r"r#r-�r<zsearch.<locals>.<genexpr>)sgroupspat�0css|]\}}d||fVqdS)s%dNr")r)r7r+r"r"r#r-�r<s{0})Ztmpl)rr
rrr�re�compileZknownresourcekeys�setr
Zbyteskwargs�
groupindexr?�sorted�searchrZmappingnone�groupr/�	enumerate�groups�	groupdictZmappingdict)	rrr�pat�src�patreZ	badgroupsr;r_r"r"r#r��s4
����	
r�sseparate(sep, args...)s	sep *argsccsdd|vrt�td���t|||d�}d}|dD],}t|||�}|sHq2|rRd}n|V|Vq2dS)z,Add a separator between non-empty arguments.sseps&separate expects at least one argumentTr%FN)r
rrr)rrr�sep�first�argZargstrr"r"r#�separate�sr�sshortest(node, minlength=4)c	CsFdt|�krdks(nt�td���t|||d�}d}t|�dkr^t|||dtd��}|�|d�}d|jj}t|�|kr�|St|�|kr�zt	|�}Wnt
y�|YS0nPzt�||�}Wn4tj
y�|jj}Yntj�y�|YS0|�s|S|�|d�}zt�||||�WStj�y@|YS0d	S)
z1Obtain the shortest representation of
    a node.rrs'shortest() expects one or two argumentsrrSs'shortest() expects an integer minlengthrfrDN)rr
rrrrVr=Z
nodeconstantsZnodelenrr�rZresolvehexnodeidprefixZWdirUnsupportedZwdirid�LookupErrorZshortesthexnodeidprefixZRepoLookupError)	rrrZhexnodeZ	minlengthrHZ
hexnodelenrdrLr"r"r#�shortest�sB�
r�sstrip(text[, chars])cCsfdt|�krdks(nt�td���t|||d�}t|�dkr^t|||d�}|�|�S|��S)z[Strip characters from a string. By default,
    strips all leading and trailing whitespace.rrs"strip expects one or two argumentsr)rr
rrrr6)rrrrY�charsr"r"r#r6s
r6s%sub(pattern, replacement, expression)ccs�t|�dkrt�td���t|||d�}t|||d�}t|||d�}zt�|�}Wn&tjy~t�td�|��Yn0z|�||�VWn&tjy�t�td�|��Yn0dS)	z8Perform text substitution
    using regular expressions.rUssub expects three argumentsrrrssub got an invalid pattern: %ss"sub got an invalid replacement: %sN)rr
rrrr�r��sub)rrrr�Zrplr�r�r"r"r#r�&sr�sstartswith(pattern, text)cCsLt|�dkrt�td���t|||d�}t|||d�}|�|�rH|SdS)ziReturns the value from the "text" argument
    if it begins with the content from the "pattern" argument.rs startswith expects two argumentsrrr<)rr
rrr�
startswith)rrrZpatnrYr"r"r#r�=s
r�ssubsetparents(rev, revset)s
rev revsetcCs�d|vsd|vrt�td���|�|d�}t�|||d�}t�|||d�}t|tj�sht�td���|�	||�}|j
}|r�|�|d�}|�di�}	||	vr�|	|}
q�t�
||�}
|
|	|<ntj
|||d�}
t�||
�|��S)	z@Look up parents of the rev in the sub graph given by the revset.srevsrevsets#subsetparents expects two argumentsrfs&subsetparents expects a queried revsetrDssubsetparentswalker)Zstartrev)r
rrr=rrVr`r]r�Ztovaluer�rGrZsubsetparentswalkerZ
parentsset)rrrrHrJ�qZsubsetrprLZwalkercacheZwalkerr"r"r#�
subsetparentsLs$

r�sword(number, text[, separator])cCs�dt|�krdks0nt�td�t|���t|||dtd��}t|||d�}t|�dkrtt|||d�}nd}|�|�}|t|�ks�|t|�kr�dS||SdS)	z"Return the nth word from a string.rrUs+word expects two or three arguments, got %drsword expects an integer indexrNr<)rr
rrrVr�split)rrrZnumrYZsplitter�tokensr"r"r#�wordss$��
r�cCs"t�|j�D]\}}|t|<qdS)z2Load template function from specified registrarobjN)r
r0Z_table�funcs)rAZextnameZregistrarobjrzr�r"r"r#�loadfunction�sr�)QZ
__future__rr�Zi18nrrdr�rrrr	r
rrr
rrr�rrrrrrZutilsrrrnr`r(r^rrVrrxr�Ztemplatefuncr r2r>rMrRrXrcrergrkrmrIrrrvrwrsr}r�r�r?r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r6r�r�r�r�r��valuesZ
i18nfunctionsr"r"r"r#�<module>s�H



�

�






�
)












 










&


,


�
"


Youez - 2016 - github.com/yon3zu
LinuXploit