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 :  /lib64/python3.9/site-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/mercurial/__pycache__/templateutil.cpython-39.pyc
a

�+�b���@s�ddlmZddlZddlZddlmZddlmZddlm	Z	mZm
Z
mZddlm
Z
mZGdd	�d	e	j�ZGd
d�de	j�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�dee�ZGdd�de�ZGdd�dee�ZGdd�de�ZGdd�de�ZGdd�de�ZGd d!�d!e�ZGd"d#�d#ee�ZGd$d%�d%e�ZGd&d'�d'e�Z dzd*d+�Z!d{d,d-�Z"d|d/d0�Z#d}d1d2�Z$d3d4�Z%d5d6�Z&d~d7d8�Z'd9d:�Z(d;d<�Z)d=d>�Z*d?d@�Z+dAdB�Z,dCdD�Z-dEdF�Z.dGdH�Z/dIdJ�Z0dKdL�Z1dMdN�Z2ddOdP�Z3d�dQdR�Z4d�dSdT�Z5d�dUdV�Z6dWdX�Z7dYdZ�Z8de1e9e)ee4e:e6iZ;d[d\�Z<d]d^�Z=d_d`�Z>dadb�Z?d�ddde�Z@dfdg�ZAdhdi�ZBdjdk�ZCdldm�ZDdndo�ZEdpdq�ZFdrds�ZGdtdu�ZHdvdw�ZIdxdy�ZJdS)��)�absolute_importN�)�_)�getattr)�error�pycompat�smartset�util)�dateutil�
stringutilc@seZdZdS)�ResourceUnavailableN��__name__�
__module__�__qualname__�rr�</usr/lib64/python3.9/site-packages/mercurial/templateutil.pyrsrc@seZdZdS)�TemplateNotFoundNr
rrrrrsrc@s�eZdZdZejZejdd��Zejdd��Z	ejdd��Z
ejdd	��Zejd
d��Zejdd
��Z
ejdd��Zejdd��Zejdd��Zejdd��ZdS)�wrappedz�Object requiring extra conversion prior to displaying or processing
    as value

    Use unwrapvalue() or unwrapastype() to obtain the inner object.
    cCsdS)zbTest if the specified item is in self

        The item argument may be a wrapped object.
        Nr��self�context�mapping�itemrrr�contains,szwrapped.containscCsdS)z�Return a member item for the specified key

        The key argument may be a wrapped object.
        A returned object may be either a wrapped object or a pure value
        depending on the self type.
        Nr�rrr�keyrrr�	getmember3szwrapped.getmembercCsdS)zjReturn the smallest item, which may be either a wrapped or a pure
        value depending on the self typeNr�rrrrrr�getmin<szwrapped.getmincCsdS)ziReturn the largest item, which may be either a wrapped or a pure
        value depending on the self typeNrrrrr�getmaxAszwrapped.getmaxcCsdS)z�Return new container of the same type which includes only the
        selected elements

        select() takes each item as a wrapped object and returns True/False.
        Nr�rrr�selectrrr�filterFszwrapped.filtercCsdS)zYield each template mappingNr�rrrrr�itermapsNszwrapped.itermapscCsdS)z�Join items with the separator; Returns a bytes or (possibly nested)
        generator of bytes

        A pre-configured template may be rendered per item if this container
        holds unprintable items.
        Nr�rrr�seprrr�joinRszwrapped.joincCsdS)z�Return a bytes or (possibly nested) generator of bytes representing
        the underlying object

        A pre-configured template may be rendered if the underlying object is
        not printable.
        Nrrrrr�show[szwrapped.showcCsdS)z2Return a boolean representation of the inner valueNrrrrr�tobooldszwrapped.toboolcCsdS)z�Move the inner value object out or create a value representation

        A returned value must be serializable by templaterfilters.json().
        Nrrrrr�tovaluehszwrapped.tovalueN)rrr�__doc__�abc�ABCMeta�
__metaclass__�abstractmethodrrrr r#r%r(r)r*r+rrrrr#s,








rc@s,eZdZdZejZdd�Zejdd��Z	dS)�mappablez:Object which can be converted to a single template mappingccs|�|�VdS�N)�tomapr$rrrr%uszmappable.itermapscCsdS)z2Create a single template mapping representing thisNrr$rrrr3xszmappable.tomapN)
rrrr,r-r.r/r%r0r3rrrrr1ps
r1c@speZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�wrappedbyteszWrapper for byte stringcCs
||_dSr2��_value�r�valuerrr�__init__�szwrappedbytes.__init__cCst|||�}||jvSr2)�	stringifyr6rrrrr�szwrappedbytes.containscCst�td�t�|j���dS�Ns%r is not a dictionary�r�
ParseErrorrr�bytestrr6rrrrr�s�zwrappedbytes.getmembercCs|�||t�Sr2��_getby�minrrrrr�szwrappedbytes.getmincCs|�||t�Sr2�r@�maxrrrrr �szwrappedbytes.getmaxcCs$|jst�td���|t�|j��S)Nsempty string)r6rr=rr�iterbytestr)rrr�funcrrrr@�szwrappedbytes._getbycCst�td�t�|j���dS)Ns%r is not filterabler<r!rrrr#�s�zwrappedbytes.filtercCst�td�t�|j���dS�Ns%r is not iterable of mappingsr<r$rrrr%�s�zwrappedbytes.itermapscCstt�|j�|�Sr2)�	joinitemsrrDr6r&rrrr(�szwrappedbytes.joincCs|jSr2r5rrrrr)�szwrappedbytes.showcCs
t|j�Sr2)�boolr6rrrrr*�szwrappedbytes.toboolcCs|jSr2r5rrrrr+�szwrappedbytes.tovalueN)rrrr,r9rrrr r@r#r%r(r)r*r+rrrrr4}sr4c@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�wrappedvaluez2Generic wrapper for pure non-list/dict/bytes valuecCs
||_dSr2r5r7rrrr9�szwrappedvalue.__init__cCst�td�|j��dS�Ns%r is not iterable�rr=rr6rrrrr�szwrappedvalue.containscCst�td�|j��dSr;rKrrrrr�szwrappedvalue.getmembercCst�td�|j��dSrJrKrrrrr�szwrappedvalue.getmincCst�td�|j��dSrJrKrrrrr �szwrappedvalue.getmaxcCst�td�|j��dSrJrKr!rrrr#�szwrappedvalue.filtercCst�td�|j��dSrFrKr$rrrr%�s�zwrappedvalue.itermapscCst�td�|j��dSrJrKr&rrrr(�szwrappedvalue.joincCs|jdurdSt�|j�S�N�)r6rr>rrrrr)�s
zwrappedvalue.showcCs0|jdurdSt|jt�r |jStt�|j��S)NF)r6�
isinstancerHrr>rrrrr*�s

zwrappedvalue.toboolcCs|jSr2r5rrrrr+�szwrappedvalue.tovalueN)rrrr,r9rrrr r#r%r(r)r*r+rrrrrI�srIc@sjeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�datezWrapper for date tuple�%d %dcCstt|�\|_|_||_dSr2)�map�int�	_unixtime�	_tzoffset�_showfmt)rr8Zshowfmtrrrr9�sz
date.__init__cCst�td���dS�Nsdate is not iterable�rr=rrrrrr�sz
date.containscCst�td���dS)Nsdate is not a dictionaryrWrrrrr�szdate.getmembercCst�td���dSrVrWrrrrr�szdate.getmincCst�td���dSrVrWrrrrr �szdate.getmaxcCst�td���dSrVrWr!rrrr#�szdate.filtercCst�td���dSrVrWr&rrrr(�sz	date.joincCs|j|j|jfSr2)rUrSrTrrrrr)�sz	date.showcCs|j|jd�S)N)sunixtimestzoffset�rSrTr$rrrr3�sz
date.tomapcCsdS�NTrrrrrr*�szdate.toboolcCs|j|jfSr2rXrrrrr+szdate.tovalueN)rP)rrrr,r9rrrr r#r(r)r3r*r+rrrrrO�s
rOc@szeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�hybrida�Wrapper for list or dict to support legacy template

    This class allows us to handle both:
    - "{files}" (legacy command-line-specific list hack) and
    - "{files % '{file}
'}" (hgweb-style with inlining and function support)
    and to access raw values:
    - "{ifcontains(file, files, ...)}", "{ifcontains(key, extras, ...)}"
    - "{get(extras, key)}"
    - "{files|json}"
    NcCs"||_||_||_||_||_dSr2)�_gen�_values�_makemap�_joinfmt�_keytype)r�gen�values�makemapZjoinfmtZkeytyperrrr9s
zhybrid.__init__cCst||||j�}||jvSr2)�unwrapastyper_r\rrrrrszhybrid.containscCs@t�|jd�st�td���t||||j�}|�||j�	|��S)N�get�not a dictionary)
r	�safehasattrr\rr=rrcr_�
_wrapvalue�getrrrrrszhybrid.getmembercCs|�||t�Sr2r?rrrrr"sz
hybrid.getmincCs|�||t�Sr2rBrrrrr %sz
hybrid.getmaxcCs*|jst�td���||j�}|�||�S�Nsempty sequence)r\rr=rrg)rrrrE�valrrrr@(s
z
hybrid._getbycCs,|durdSt�|d�r|Std|||j�S)Ns_makemap)r	rf�
hybriditemr])rrrjrrrrg.s
zhybrid._wrapvaluecsXt��jd�r,��fdd�t��j�D�}n��fdd��jD�}td|�j�j�j�S)Nrdcs&i|]\}}���||��r||�qSr�rg��.0�k�v�r"rrr�
<dictcomp>8s�z!hybrid.filter.<locals>.<dictcomp>cs g|]}���||��r|�qSrrl)rnrprqrr�
<listcomp>>rMz!hybrid.filter.<locals>.<listcomp>)	r	rfr\r�	iteritemsrZr]r^r_)rrrr"rarrqrr#6s
�z
hybrid.filterccs |j}|jD]}||�VqdSr2)r]r\)rrrb�xrrrr%As
zhybrid.itermapscst�fdd��jD�|�S)Nc3s|]}��|�VqdSr2)r^�rnru�rrr�	<genexpr>HrMzhybrid.join.<locals>.<genexpr>)rGr\r&rrwrr(Fszhybrid.joincCs.|j}|dur|�||d�St|�r*|�S|S)N� )r[r(�callable�rrrr`rrrr)Jszhybrid.showcCs
t|j�Sr2)rHr\rrrrr*Ssz
hybrid.toboolcs@|j}t�|d�r,��fdd�t�|�D�S��fdd�|D�S)Nrdcsi|]\}}|t��|��qSr��unwrapvaluerm�rrrrrrZs�z"hybrid.tovalue.<locals>.<dictcomp>csg|]}t��|��qSrr|rvr~rrrs^rMz"hybrid.tovalue.<locals>.<listcomp>)r\r	rfrrt)rrr�xsrr~rr+Vs�zhybrid.tovalue)N)rrrr,r9rrrr r@rgr#r%r(r)r*r+rrrrrZs
	rZc@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)rkz�Wrapper for non-list/dict object to support map operation

    This class allows us to handle both:
    - "{manifest}"
    - "{manifest % '{rev}:{node}'}"
    - "{manifest.rev}"
    cCs||_||_||_||_dSr2)r[�_keyr6r])rr`rr8rbrrrr9jszhybriditem.__init__cCs|�|j�Sr2)r]r�r$rrrr3pszhybriditem.tomapcCst|||j�}|�|||�Sr2)�makewrappedr6r)rrrr�wrrrrsszhybriditem.containscCst|||j�}|�|||�Sr2)r�r6r)rrrrr�rrrrwszhybriditem.getmembercCst|||j�}|�||�Sr2)r�r6r�rrrr�rrrr{szhybriditem.getmincCst|||j�}|�||�Sr2)r�r6r r�rrrr szhybriditem.getmaxcCst|||j�}|�|||�Sr2)r�r6r#)rrrr"r�rrrr#�szhybriditem.filtercCst|||j�}|�|||�Sr2)r�r6r()rrrr'r�rrrr(�szhybriditem.joincCs,|j}|durt�|j�St|�r(|�S|Sr2)r[rr>r6rzr{rrrr)�szhybriditem.showcCst|||j�}|�||�Sr2)r�r6r*r�rrrr*�szhybriditem.toboolcCst|||j�Sr2)�_unthunkr6rrrrr+�szhybriditem.tovalueN)rrrr,r9r3rrrr r#r(r)r*r+rrrrrkas	rkc@szeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�revslistaZWrapper for a smartset (a list/set of revision numbers)

    If name specified, the revs will be rendered with the old-style list
    template of the given name by default.

    The cachekey provides a hint to cache further computation on this
    smartset. If the underlying smartset is dynamically created, the cachekey
    should be None.
    NcCs,t|tj�sJ�||_||_||_||_dSr2)rNrZabstractsmartset�_repo�_revs�_name�cachekey)r�repoZrevs�namer�rrrr9�s
zrevslist.__init__cCst|||�}||jvSr2)�
unwrapintegerr�)rrrrZrevrrrr�szrevslist.containscCst�td���dS�NrerWrrrrr�szrevslist.getmembercCs|��}||j���Sr2)�_makehybriditemfuncr�rA�rrr�makehybriditemrrrr�szrevslist.getmincCs|��}||j���Sr2)r�r�rCr�rrrr �szrevslist.getmaxcs.|���|j���fdd��}t|j|dd�S)Ncs��|��Sr2r��r�r�r"rr�<lambda>�rMz!revslist.filter.<locals>.<lambda>�r�)r�r�r#r�r�)rrrr"Zfrevsrr�rr#�szrevslist.filterccs"|��}|jD]}||�VqdSr2)�_makemapfuncr�)rrrbr�rrrr%�s
zrevslist.itermapscs|����fdd�S)Ncstd||��Sr2)rkr��rbrrr��rMz.revslist._makehybriditemfunc.<locals>.<lambda>)r�rwrr�rr��szrevslist._makehybriditemfunccs.|j�|j��r��fdd�S�fdd�SdS)Ncs�|d�|iS�Nsctxrr��r�r�rrr��rMz'revslist._makemapfunc.<locals>.<lambda>csd�|iSr�rr�)r�rrr��rM)r�r�rwrr�rr��s
zrevslist._makemapfunccCst|j|�Sr2)rGr�r&rrrr(�sz
revslist.joincCs8|jr&dd�|jD�}t|||j|�S|�||d�SdS)NcSsg|]}d|�qS)s%dr)rnr�rrrrs�rMz!revslist.show.<locals>.<listcomp>ry)r�r��_showcompatlistr()rrrZsrevsrrrr)�sz
revslist.showcCs
t|j�Sr2)rHr�rrrrr*�szrevslist.toboolcCs|jSr2)r�rrrrr+�szrevslist.tovalue)NN)rrrr,r9rrrr r#r%r�r�r(r)r*r+rrrrr��s

r�c@sZeZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�ZdS)�_mappingsequencez�Wrapper for sequence of template mappings

    This represents an inner template structure (i.e. a list of dicts),
    which can also be rendered by the specified named/literal template.

    Template mappings may be nested.
    NrMcCs0|dur|durt�d��||_||_||_dS)Ns$name and tmpl are mutually exclusive)r�ProgrammingErrorr��_tmpl�_defaultsep)rr��tmplr'rrrr9�s�z_mappingsequence.__init__cCst�td���dS�Nsnot comparablerWrrrrr�sz_mappingsequence.containscCst�td���dSr�rWrrrrr�sz_mappingsequence.getmembercCst�td���dSr�rWrrrrr�sz_mappingsequence.getmincCst�td���dSr�rWrrrrr sz_mappingsequence.getmaxcCst�td���dS)Nsnot filterable without templaterWr!rrrr#sz_mappingsequence.filtercsbt�|�����}�jr.��fdd�|D�}n*�jrJ��fdd�|D�}nt�td���t||�S)Nc3s|]}���j|�VqdSr2)�processr��rn�m�rrrrrx
rMz(_mappingsequence.join.<locals>.<genexpr>c3s|]}���j|�VqdSr2)�expandr�r�r�rrrxrMs not displayable without template)�_iteroverlaymapsr%r�r�rr=rrG)rrrr'Zmapsiter�itemiterrr�rr(sz_mappingsequence.joincCs|�|||j�Sr2)r(r�rrrrr)sz_mappingsequence.showcsN����g}|���D]2}��||��|����fdd�t�|�D��q|S)Ncs&i|]\}}|�vr|t��|��qSrr|rm�rZknownres�lmrrrrs�z,_mappingsequence.tovalue.<locals>.<dictcomp>)Zknownresourcekeysr%�
overlaymap�appendrrt)rrr�items�nmrr�rr+s��z_mappingsequence.tovalue)NNrM)
rrrr,r9rrrr r#r(r)r+rrrrr��s
	
r�cs2eZdZdZd�fdd�	Zdd�Zd	d
�Z�ZS)�mappinggeneratorz�Wrapper for generator of template mappings

    The function ``make(context, *args)`` should return a generator of
    mapping dicts.
    rNrMcs$tt|��|||�||_||_dSr2)�superr�r9�_make�_args)r�make�argsr�r�r'��	__class__rrr9+szmappinggenerator.__init__cCs|j|g|j�R�Sr2�r�r�r$rrrr%0szmappinggenerator.itermapscCst|�|��Sr2)�	_nonemptyr%rrrrr*3szmappinggenerator.tobool)rNNrM�rrrr,r9r%r*�
__classcell__rrr�rr�$sr�cs2eZdZdZd
�fdd�	Zdd�Zdd	�Z�ZS)�mappinglistz%Wrapper for list of template mappingsNrMcstt|��|||�||_dSr2)r�r�r9�	_mappings)rZmappingsr�r�r'r�rrr9:szmappinglist.__init__cCs
t|j�Sr2)�iterr�r$rrrr%>szmappinglist.itermapscCs
t|j�Sr2)rHr�rrrrr*Aszmappinglist.tobool)NNrMr�rrr�rr�7sr�cs>eZdZdZd�fdd�	Zdd�Zdd�Z�fd	d
�Z�ZS)�mappingdictz�Wrapper for a single template mapping

    This isn't a sequence in a way that the underlying dict won't be iterated
    as a dict, but shares most of the _mappingsequence functions.
    Ncstt|��||�||_dSr2)r�r�r9�_mapping)rrr�r�r�rrr9Lszmappingdict.__init__cCs|jSr2)r�r$rrrr3Pszmappingdict.tomapcCsdSrYrrrrrr*Sszmappingdict.toboolcstt|��||�dS)Nr)r�r�r+rr�rrr+Yszmappingdict.tovalue)NN)	rrrr,r9r3r*r+r�rrr�rr�Es
r�cs(eZdZdZ�fdd�Zdd�Z�ZS)�mappingnonez�Wrapper for None, but supports map operation

    This represents None of Optional[mappable]. It's similar to
    mapplinglist([]), but the underlying value is not [], but None.
    cstt|��d�dSr2)r�r�r9rwr�rrr9dszmappingnone.__init__cCstg�Sr2)r�r$rrrr%gszmappingnone.itermaps)rrrr,r9r%r�rrr�rr�]sr�c@s�eZdZdZd dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
edd��Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZdS)!�mappedgeneratoraWrapper for generator of strings which acts as a list

    The function ``make(context, *args)`` should return a generator of
    byte strings, or a generator of (possibly nested) generators of byte
    strings (i.e. a generator for a list of byte strings.)
    rcCs||_||_dSr2r�)rr�r�rrrr9sszmappedgenerator.__init__cCst|||�}||�||�vSr2)r:r+rrrrrwszmappedgenerator.containscCs|j|g|j�R�Sr2r�r$rrrr[{szmappedgenerator._gencCst�td���dSr�rWrrrrr~szmappedgenerator.getmembercCs|�||t�Sr2r?rrrrr�szmappedgenerator.getmincCs|�||t�Sr2rBrrrrr �szmappedgenerator.getmaxcCs&|�||�}|st�td���||�Sri)r+rr=r)rrrrErrrrr@�szmappedgenerator._getbyccs8||g|�R�D]"}t|||�}|t|��r|VqdSr2)r:r4)rrr�r�r"ru�srrr�_filteredgen�szmappedgenerator._filteredgencCs||j|j|f}t|j|�Sr2)r�r�r�r�)rrrr"r�rrrr#�szmappedgenerator.filtercCst�td���dS)Nslist of strings is not mappablerWr$rrrr%�szmappedgenerator.itermapscCst|�|�|�Sr2)rGr[r&rrrr(�szmappedgenerator.joincCs|�||d�SrL)r(rrrrr)�szmappedgenerator.showcCst|�|��Sr2)r�r[rrrrr*�szmappedgenerator.toboolcs��fdd�|���D�S)Ncsg|]}t��|��qSr)r:rvr~rrrs�rMz+mappedgenerator.tovalue.<locals>.<listcomp>)r[rrr~rr+�szmappedgenerator.tovalueN)r)rrrr,r9rr[rrr r@�staticmethodr�r#r%r(r)r*r+rrrrr�ks 

r��key�valuecs>tj��durd�tj�t|����fdd����fdd��S)z>Wrap data to support both dict-like and string-like operationsNs%s=%scs�|��|iSr2r�ro)�datarr8rrr��rMzhybriddict.<locals>.<lambda>cs��|���|�fSr2rr�)r��fmt�prefmtrrr��rM�r�identityr>rZ)r�rr8r�r`r)r�r�rr�r8r�
hybriddict�s�r�cs8tj��durd�tj�t||�fdd���fdd��S)z>Wrap data to support both list-like and string-like operationsNs%scs�|iSr2r�rur�rrr��rMzhybridlist.<locals>.<lambda>cs��|�Sr2rr�)r�r�rrr��rMr�)r�r�r�r`r)r�r�r�r�
hybridlist�s
r�ryc	s>��fdd�t�|�D�}	t||||	||�}
t|��||
d�S)z�Wrap data like hybriddict(), but also supports old-style list template

    This exists for backward compatibility with the old-style template. Use
    hybriddict() for new template keywords.
    csg|]\}}�|�|i�qSrrrm�rr8rrrs�rMzcompatdict.<locals>.<listcomp>)rr8r�r`)rrtr�r�)rrr�r�rr8r��plural�	separator�c�frr�r�
compatdict�sr�c	Cs&t||||||�}t||p|||d�S)z�Wrap data like hybridlist(), but also supports old-style list template

    This exists for backward compatibility with the old-style template. Use
    hybridlist() for new template keywords.
    )r�r�r`)r�r�)	rrr�r��elementr�r�r�r�rrr�
compatlist�sr�csHdd��D�}t||||dd�}t����t|��fdd��fdd��S)z�Wrap list of (dest, source) file names to support old-style list
    template and field names

    This exists for backward compatibility. Use hybriddict for new template
    keywords.
    cSsg|]\}}||d��qS))�name�sourcerrmrrrrs�rMz(compatfilecopiesdict.<locals>.<listcomp>sfile_copies)r�cs||�|d�S)N)r��pathr�rr���copiesrrr��rMz&compatfilecopiesdict.<locals>.<lambda>csd|�|fS)Ns%s (%s)rr�r�rrr��rM)r�r	ZsortdictrZ)rrr�r�r�r�rr�r�compatfilecopiesdict�s


�r�cCs"t||||�}t||dd�tj�S)z�Wrap list of file names to support old-style list template and field
    names

    This exists for backward compatibility. Use hybridlist for new template
    keywords.
    cSs
||d�S)N)sfiler�rr�rrrr�rMz!compatfileslist.<locals>.<lambda>)r�rZrr�)rrr��filesr�rrr�compatfileslist�s�r�c#s$|s�d}|s4d|}��|�r0��|��VdS����s�t|dt�rZ|�|�Vn"|D]}t|�}|���|Vq^dSd|}	��|	�r���|	��V�f���fdd�	}
d�}��|�r�|��}nd}|D]}|
|�Vq�|dur�|
||d	�Vd
|}
��|
��r ��|
��VdS)aNReturn a generator that renders old-style list template

    name is name of key in template map.
    values is list of strings or dicts.
    plural is plural of name, if not simply name + 's'.
    separator is used to join values as a string

    expansion works like this, given name 'foo'.

    if values is empty, expand 'no_foos'.

    if 'foo' not in template map, return values as a string,
    joined by 'separator'.

    expand 'start_foos'.

    for each value, expand 'foo'. if 'last_foo' in template
    map, expand it instead of 'foo' for last key.

    expand 'end_foos'.
    �ssno_Nrsstart_cs~i}z|�|�WnRtttfydz|D]\}}|||<q,Wnttfy^||�<Yn0Yn0���|�}��||�Sr2)�update�AttributeError�	TypeError�
ValueErrorr�r�)rp�tagZvmapping�a�b�rrr�rr�one3sz_showcompatlist.<locals>.oneslast_)r�send_)Zpreloadr�rN�bytesr(�dictr��pop)rrr�rar�r�Znonamerpr�Z	startnamer�ZlastnameZlastZendnamerr�rr�s<





r�ccs�t|t�r|�||�}t|t�r(|Vn�t|t�rBt�d|��n�|durLn�t�|d�sft	�
|�Vnn|D]h}t|t�r�|�||�}t|t�r�|Vqj|dur�qjt�|d�s�t	�
|�Vqjt|||�D]
}|Vq�qjdS)z=Yield a single stream from a possibly nested set of iteratorssHMercurial IO including templates is done with bytes, not strings, got %rNs__iter__)rNrr)r��strrr�r	rfrr>�flatten)rr�thing�i�jrrrr�Rs2


��

r�cCs t|t�r|Sd�t|||��S)zETurn values into bytes by converting into text and concatenating themrM)rNr�r(r��rrr�rrrr:rs
r:cCs0|\}}|tur|S|tur&|d}qdSqdS)z`Find symbolic name for the given compiled expression; returns None
    if nothing found reliablyrN)�	runsymbol�	runfilter)�argrEr�rrr�findsymbolicnameys
r�cCs(zt|�WdSty"YdS0dS)NTF)�next�
StopIteration)Zxiterrrrr��s
r�cCst|tj�s|St|||�S)z&Evaluate a lazy byte string into value)rN�types�
GeneratorTyper:r�rrrr��sr�cCs|\}}||||�S)z�Evaluate given argument as a bare template object which may require
    further processing (such as folding generator of strings)r)rrr�rEr�rrr�
evalrawexp�sr�cCst|||�}t|||�S)z)Evaluate given argument to wrapped object)r�r�)rrr�r�rrr�evalwrapped�sr�cCs4t|t�r|St|||�}t|t�r,t|�St|�S)zLift object to a wrapped type)rNrr�r�r4rIr�rrrr��s

r�cCst||t|||��S)z%Evaluate given argument as value type)r}r��rrr�rrr�evalfuncarg�sr�cCs"t|t�r|�||�St|||�S)z.Move the inner value object out of the wrapper)rNrr+r�r�rrrr}�s
r}cCsT|\}}|tur4||||dd�}|dur@t�|�}n||||�}t|||��||�S)zCEvaluate given argument as boolean, but also takes boolean literalsN��default)r�rZ	parseboolr�r*�rrr�rEr�r�rrr�evalboolean�srcCst|||�}t||||�S)z`Evaluate given argument as a date tuple or a date string; returns
    a (unixtime, offset) tuple)r��
unwrapdate�rrr��errr�rrr�evaldate�srcCszt|t�r|�||�St|||�}zt�|�WStyRt�|pJt	d���Yn$tjyt|sf�t�|��Yn0dS)Nsnot a date tuple nor a string)
rNrOr+r}r
Z	parsedater�rr=r�rrr�rrrrr�s
rcCst|||�}t||||�Sr2)r�r�rrrr�evalinteger�src	CsDt|||�}z
t|�WSttfy>t�|p6td���Yn0dS)Nsnot an integer)r}rRr�r�rr=rrrrrr��s

r�cCst||t|||��Sr2)r:r�r�rrr�
evalstring�srcCs:|\}}|tur"|||||d�}n||||�}t|||�S)zXEvaluate given argument as string template, but returns symbol name
    if it is unknownr�)r�r:rrrr�evalstringliteral�s
r	cCs:zt|}Wn ty,t�d|��Yn0||||�S)zBMove the inner value object out of the wrapper and coerce its typesinvalid type specified: %r)�_unwrapfuncbytype�KeyErrorrr�)rrr��typr�rrrrcs
rccCst|�Sr2)rR�rrr�rrr�
runinteger
srcCs|Sr2rr
rrr�	runstringsrcs�fdd�}|S)Ncst�td����dS)Ns$recursive reference '%s' in template)r�Abortrr~�rrr�
showrecursionsz._recursivesymbolblocker.<locals>.showrecursionr)rrrrr�_recursivesymbolblockersrrMcCs~|�||�}|durP|��}t|�||<z|�||�}WntyN|}Yn0t|�rzz|||�WStyxYdS0|Sr2)�symbol�copyrr�rrzr)rrrr�rpZsafemappingrrrr�s
r�ccs|D]}t|||�VqdSr2)r�)rr�templater�rrr�runtemplate.src
Cs||\}}t|||�}t|dd�}zt||||�}||�WStjyv}z$tjt|�t||�d��WYd}~n
d}~00dS)NZ_intype��hint)r�rrcrr=r��_formatfiltererror)rrr�r��filtr�Zintype�errrr�3s
r�cCs4t�|j�}t|�}|s$td�|Std�||fS)Ns(incompatible use of template filter '%s's8template filter '%s' is not compatible with keyword '%s')rZsysbytesrr�r)r�r�fn�symrrrr>s�rccs0t|�D]"\}}|�||�}||d<|VqdS)zuGenerate combined mappings from the original mapping and an iterable
    of partial mappings to override the originalsindexN)�	enumerater�)rZorigmappingZnewmappingsr�r�r�rrrr�Isr�c

cs�z|�|�}WnRtjy`}z8t|�}|s.�td�|}tjt|�|d��WYd}~n
d}~00t|||�D]}	t||	|�VqndS)Ns+keyword '%s' does not support map operationr)r%rr=r�rr�r�r�)
rr�d�darg�targZditerrrrr�rrr�	_applymapRs(r#cCs(|\}}t|||�}tt||||fd�S)N)r�)r�r�r#)rrr�r!r"r rrr�runmap_sr$c

Cs�|\}}t|||�}t|t�r<|�||�|��}t|||�Sz|�|||�WStjy�}z8t	|�}|sl�t
d�|}	tjt|�|	d��WYd}~n
d}~00dS)Ns.keyword '%s' does not support member operationr)r�rNr1r�r3r�rrr=r�rr�)
rrr�r!Zmembr r�rrrrrr�	runmemberes
r%cCst|||td��}|S)Ns"negation needs an integer argument)rrr
rrr�	runnegateus�r&cCs`|\}}}t|||td��}t|||td��}z|||�WStyZt�td���Yn0dS)Ns#arithmetic only defined on integerssdivision by zero is not defined)rr�ZeroDivisionErrorrr)rrr�rE�left�rightrrr�
runarithmetic|s
��r*ccs,d}|D]}|rd}n
|r |V|VqdS)z9Join items with the separator; Returns generator of bytesTFNr)r�r'�firstrurrrrG�srG)r�r�NN)NN)r�r�NNry)NNNry)Nry)N)N)N)N)rM)KZ
__future__rr-r�Zi18nrrr�rrr	Zutilsr
rrrr�objectrr1r4rIrOrZrkr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r:r�r�r�r�r�r�r�r}rrrrr�rr	r�rRr
rcrrrr�rr�rr�r#r$r%r&r*rGrrrr�<module>s�M
1.(];I?=

�
�
�
K 

	



�	
	


Youez - 2016 - github.com/yon3zu
LinuXploit