403Webshell
Server IP : 74.208.236.16  /  Your IP : 216.73.217.15
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : u102440577 ( 7172810)
PHP Version : 8.4.26
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /kunden/lib/python3/dist-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/lib/python3/dist-packages/mercurial/__pycache__/templater.cpython-313.pyc
�

6�hr���"�SrSSKJr SSKrSSKrSSKJrJrJr SSK	J
r
 SSKJr SSK
JrJrJrJrJrJrJrJrJr SS	KJrJr 0S
S_SS
_SS_SS_SS_SS_SS_SS_SS_SS_SS_S S!_S"S#_S$S%_S&S'_S(S_rScS)jrSdS*jrSeS+jrSfS,jrS-rS.rS/r S0r!S1r"S2r#S3r$S4r%S5r&S6r'S7r(S8r)S9r*S:r+S;r,S<r-S=r.S>r/S?r0S@r1SAr20S SB_S$SC_S"SD_S&\)_SESF_S\,_S\*_S\+_SG\/_SH\1_SI\2_SSJ_SSK_SL\-_SSM_SSN_r3\3Ri5r5\3S"\5S '"SOSP\Rl5r7SQr8SRr9"SSST5r:"SUSV\:5r;"SWSX5r<SYr=SZr>S[r?"S\S]5r@"S^S_5rAS`rBScSgSajjrCScShSbjjrDg)ia�Slightly complicated template engine for commands and hgweb

This module provides low-level interface to the template engine. See the
formatter and cmdutil modules if you are looking for high-level functions
such as ``cmdutil.rendertemplate(ctx, tmpl)``.

Internal Data Types
-------------------

Template keywords and functions take a dictionary of current symbols and
resources (a "mapping") and return result. Inputs and outputs must be one
of the following data types:

bytes
    a byte string, which is generally a human-readable text in local encoding.

generator
    a lazily-evaluated byte string, which is a possibly nested generator of
    values of any printable types, and  will be folded by ``stringify()``
    or ``flatten()``.

None
    sometimes represents an empty value, which can be stringified to ''.

True, False, int, float
    can be stringified as such.

wrappedbytes, wrappedvalue
    a wrapper for the above printable types.

date
    represents a (unixtime, offset) tuple.

hybrid
    represents a list/dict of printable values, which can also be converted
    to mappings by % operator.

hybriditem
    represents a scalar printable value, also supports % operator.

revslist
    represents a list of revision numbers.

mappinggenerator, mappinglist
    represents mappings (i.e. a list of dicts), which may have default
    output format.

mappingdict
    represents a single mapping (i.e. a dict), which may have default output
    format.

mappingnone
    represents None of Optional[mappable], which will be mapped to an empty
    string by % operation.

mappedgenerator
    a lazily-evaluated list of byte strings, which is e.g. a result of %
    operation.
�)�annotationsN)�BinaryIO�Optional�Tuple�)�_)�FileNotFoundError)	�config�encoding�error�parser�pycompat�templatefilters�
templatefuncs�templateutil�util)�resourceutil�
stringutil�()�N)�groupr�))�funcrrN�.)�NN)rrN�%)�NN)rrN�|)rNN)rrN�*)�NN)rr N�/)r NN)r!r N�+)�NN)r"r#N�-)r#N)�negate�)r$r#N�=)�NN)�keyvaluer(N�,)�NN)�listr+Nr)rNNNN�integer)rr-NNN�symbol)rr.NNN�string)rr/NNN�template)rr0NNN�endc#��# �Un[R"U5nXB:Ga�XnUR5(aGOoUS;a	USU4v� GO`US;a US-n[XX%5uptSXv4v� US-nGO:US:XajXUS-S;a_XS-nUS-=pdXB:a-XnUS	:XaUS-
nMX�:XaS
XUU4v� GO�US-
nXB:aM-[R
"[
S5U5eUR5(a=UnXB:a&XnUR5(dOUS-
nXB:aM&SXUU4v� US-nGOxUS	:XaXUS-S
;dUS:Xa�XUS-S;a�US:XaUS-
nS
n	OSn	XUS-n
US-=pdXB:a�URSXB5(aUS-
nM#URX�U5(aC[R"XU5nU	S:Xa[US[U55SnX�U4v� US-
nO�US-
nXB:aM�[R
"[
S5U5eUR5(dUS;aHUnUS-
nXB:a,XnUR5(dUS:XdOUS-
nXB:aM,XUnSX�4v� US-nO-XS:XaSSU4v� g[R
"[
S5U5eUS-
nXB:aGM�U(a [R
"[
S5U5eSSU4v� g7f)zZParse a template expression into a stream of tokens, which must end
with term if specifieds(=,).%|+-*/Ns"'rr0�rr+)sr'sr"�\r/�unterminated stringr-)s\'s\"r()sr\'sr\"s\\\r#r�_r.r1ssyntax errorsunterminated template expansion)
r�bytestr�isspace�_parsetemplater�
ParseErrorr�isdigit�
startswithr
�unescapestr�len�isalnum)�program�start�end�term�pos�c�s�data�d�token�quote�syms            �5/usr/lib/python3/dist-packages/mercurial/templater.py�tokenizerMzsT����C����w�'�G�

�)��L���9�9�;�;��
�.�
 ��d�C�.� �
�&�[��a��A�&�w�3�:�I�D���(�(��1�H�C�
�$�Y�7��q��1�^�C��a�� �A��A�g��A��)��L����:��1�H�C���6�$�g��n�a�8�8���q����)��&�&�q�)?�'@�!�D�D�
�Y�Y�[�[��A��)��L���y�y�{�{���q���	�)�
�w��~�q�1�1��1�H�C�
��J��c�A�g�&�*:�:��D�y��c�A�g�&�*<�<��D�y��q���!��#���#��'�*�E��A�g��A��)��%�%�i��:�:��1�H�C���%�%�e�#�6�6�"�-�-�g��n�=�D���+�-�d�A�s�4�y�A�!�D�� ��*�*��1�H�C���q���'�)�*�&�&�q�)?�'@�!�D�D�
�Y�Y�[�[�A��I��A��1�H�C��)��L���	�	���q�D�y���q���	�)�
�C�.�C��c�%�%��1�H�C�
�Y��4��%�%���"�"�1�_�#5�s�;�;��q���A�)�B����q�!C�D�e�L�L��4��
��s(�B=K'�A K'�#CK'�;A1K'�.AK'�8/K'c��/n[XX#5H[upVnUS:XaURXV45 M US:XaURU5 M9US:XaXG4s $[R"SU-5e [R"S5e)a�
>>> _parsetemplate(b'foo{bar}"baz', 0, 12)
([('string', 'foo'), ('symbol', 'bar'), ('string', '"baz')], 12)
>>> _parsetemplate(b'foo{bar}"baz', 0, 12, quote=b'"')
([('string', 'foo'), ('symbol', 'bar')], 9)
>>> _parsetemplate(b'foo"{bar}', 0, 9, quote=b'"')
([('string', 'foo')], 4)
>>> _parsetemplate(br'foo\"bar"baz', 0, 12, quote=b'"')
([('string', 'foo"'), ('string', 'bar')], 9)
>>> _parsetemplate(br'foo\\"bar', 0, 10, quote=b'"')
([('string', 'foo\\')], 6)
r/r0r1sunexpected type: %s�!unterminated scanning of template)�
_scantemplate�appendr�ProgrammingError)�tmplrA�stoprJ�parsed�typ�valrDs        rLr9r9�s����F�&�t�D�@�
��#��)���M�M�3�*�%�
�K�
��M�M�#��
�F�]��;���(�(�)?�#�)E�F�F�A��
 �
 �!E�
F�F�c#�# �Sn[US[U5US9Hup4nU(aX%4-v� US:Xa gX54nM! [R"S5e7f)a�Scan (type, start, end) positions of outermost elements in template

If raw=True, a backslash is not taken as an escape character just like
r'' string in Python. Note that this is different from r'' literal in
template in that no template fragment can appear in r'', e.g. r'{foo}'
is a literal '{foo}', but ('{foo}', raw=True) is a template expression
'foo'.

>>> list(scantemplate(b'foo{bar}"baz'))
[('string', 0, 3), ('template', 3, 8), ('string', 8, 12)]
>>> list(scantemplate(b'outer{"inner"}outer'))
[('string', 0, 5), ('template', 5, 14), ('string', 14, 19)]
>>> list(scantemplate(b'foo\\{escaped}'))
[('string', 0, 5), ('string', 5, 13)]
>>> list(scantemplate(b'foo\\{escaped}', raw=True))
[('string', 0, 4), ('template', 4, 13)]
Nr)�rawr1rO)rPr>rrR)rSrZ�lastrVrWrDs      rL�scantemplater\�s\���$�D�&�t�Q��D�	�s�C�
��#����-���&�=���:�D�
D��
 �
 �!E�
F�F�s�AAc#�^^^
# �SU-n[R[R/UnUm
[R"[5nT
T:Ga1[U
UU4Sj[R"U55SS9nUS:aSU"TT
T5T
4v� Tm
O�TX�S-n	Sn
U(d#UT
-
[TT
URS55-
n
U
S	-S:XaSU"TT
US-
5U	-T
4v� US-m
M�UT
:�aSU"TT
U5T
4v� X�:XaS
SUS-4v� gUR[TUS-TS55unm
TRST
5(d [R"[S
5T
5eSX�4v� T
S-
m
T
T:aGM1U(a [R"[S5U5eS
ST
4v� g![Ran[UT5 eSnAff=f7f)zEParse template string into chunks of strings and template expressions�{c3�J># �UHnTRUTT5v� M g7f�N)�find)�.0rErDrTrSs  ���rL�	<genexpr>� _scantemplate.<locals>.<genexpr>%s#����M�2L�Q����1�c�4�(�(�2L�s� #c��US:U4$)Nr�)�ns rL�<lambda>�_scantemplate.<locals>.<lambda>&s��q�1�u�a�jrX)�keyrr/rr4r+r1N�}�
invalid tokenr0r5)r
r=r�identity�elements�minr7r>�rstrip�parserMr<rr:r�_addparseerrorhint)rSrArTrJrZ�sepchars�unescape�prgrE�bs�parseres�instrDs` `          @rLrPrPs������e�|�H��"�"�H�$5�$5�6�s�;�H�
�C��
�
�h��A�*��D�j��M�(�2B�2B�8�2L�M�(��A��1�u� �(�4��D�>�":�C�@�@�����Q�Q���A��B���#�g��T�#�a�[�%7�%7��%>�!?�?���A�v��{� �(�4��a�!�e�+<�"=��"A�3�G�G��!�e����3�w� �(�4��A�;�"7��=�=��z��t�Q��U�+�+���G�G�H�T�1�q�5�$��$E�F�M�H�c��?�?�4��-�-��&�&�q�)9�':�C�@�@���,�,��1�H�C�G�D�j�J��"�"�1�%;�#<�e�D�D��
�4��
��������4��&�
���s>�AG�C	F3�G�A+F3�'F3�*	G�3G�
G�G�Gc���URcgURnUSURS5nURSS5nUS-SUS-U---S-[S5-Ulg)N�
s\n� rs^ shere)�location�count�replacer�hint)rxrS�loc�offsets    rLrrrrPsn���}�}���
�-�-�C��$�3�Z�
�
�e�
$�F��<�<��v�&�D�
�u��t�s�Q�w��'7�8�8�5�@�1�W�:�M�D�IrXc� �[U[5(dU$USnUS:waU4[SUSS55-$[U5S:Xde[SUS55nU(dg[U5S:XaUSSS	:XaUS$U4U-$)
a�Expand list of templates to node tuple

>>> def f(tree):
...     print(pycompat.sysstr(prettyformat(_unnesttemplatelist(tree))))
>>> f((b'template', []))
(string '')
>>> f((b'template', [(b'string', b'foo')]))
(string 'foo')
>>> f((b'template', [(b'string', b'foo'), (b'symbol', b'rev')]))
(template
  (string 'foo')
  (symbol 'rev'))
>>> f((b'template', [(b'symbol', b'rev')]))  # template(rev) -> str
(template
  (symbol 'rev'))
>>> f((b'template', [(b'template', [(b'string', b'foo')])]))
(string 'foo')
rr0c3�8# �UHn[U5v� M g7fr`��_unnesttemplatelist�rb�xs  rLrc�&_unnesttemplatelist.<locals>.<genexpr>ws���F�X��0��3�3�X���rNr+c3�8# �UHn[U5v� M g7fr`r�r�s  rLrcr�zs���7�w�!�"�1�%�%�w�r�)r/rXr/)�
isinstance�tupler>)�tree�op�xss   rLr�r�`s���&�d�E�"�"���	
�a��B�	�[���u�u�F�T�!�"�X�F�F�F�F��t�9��>��>�	�7�t�A�w�7�	7�B�
��	�R��A��"�Q�%��(�i�/��!�u���u�r�z�rXc�x�[US[U55upU[U5:XdS5e[SU45$)zParse template string into treers$unquoted template should be consumedr0)r9r>r�)rSrUrDs   rLrqrq�s>�� ��q�#�d�)�4�K�F��#�d�)��D�D�D����V�4�5�5rXc�j�[U5$![Ran[X5 eSnAff=f)a�Parse a template expression into tree

>>> parseexpr(b'"foo"')
('string', 'foo')
>>> parseexpr(b'foo(bar)')
('func', ('symbol', 'foo'), ('symbol', 'bar'))
>>> from . import error
>>> from . import pycompat
>>> try:
...   parseexpr(b'foo(')
... except error.ParseError as e:
...   pycompat.sysstr(e.message)
...   e.location
'not a prefix: end'
4
>>> try:
...   parseexpr(b'"foo" "bar"')
... except error.ParseError as e:
...   pycompat.sysstr(e.message)
...   e.location
'invalid token'
7
N)�
_parseexprrr:rr)�exprrxs  rL�	parseexprr��s3��0��$���������4�&�
���s�

�2�-�2c	��[R"[5nUR[US[	U555up#U[	U5:wa [
R"[S5U5e[U5$)Nrrl)	r
rnrqrMr>rr:rr�)r�rur�rDs    rLr�r��s]���
�
�h��A������q�#�d�)�4�5�I�D�
�c�$�i�����q�!1�2�C�8�8��t�$�$rXc�0�[R"US5$)N)r-r/r.)r
�prettyformat�r�s rLr�r��s�����t�%G�H�HrXc�l�U(d[R"[S55eUSnX#"X5$)z1Compile parsed template tree to (func, data) pairsmissing argumentr�rr:r)�exp�context�
curmethods�ts    rL�
compileexpr��s2������q�!4�5�6�6��A��A��=��&�&rXc�h�USS:XaUS$[R"[S5US-5e)Nrr.rsexpected a symbol, got '%s'r�)r�s rL�	getsymbolr��s7��
�1�v����1�v�
�
�
�
�1�;�<�s�1�v�E�
F�FrXc�V�U(d/$USS:Xa[US5US/-$U/$)Nrr,rr+��getlist)r�s rLr�r��s5����	���t�w���q��t�}��!��v�%�%�
�3�JrXc��USS;a[X[5$USS:XaURUS5$[R"[S55e)z[Compile given template tree or load named template from map file;
returns (func, data) pairr)r0r/r.rsexpected template specifier)r��methods�_loadrr:r�r�r�s  rL�gettemplater��sV���1�v�)�)��#��0�0�
�1�v����}�}�S��V�$�$�
�
�
�1�;�<�
=�=rXc�F�[R"[S5U-5e)Ns$recursive reference '%s' in template)r�
InputErrorr)r��mappingrjs   rL�_runrecursivesymbolr��s��
�
�
�1�D�E��K�
L�LrXc�v�USSVs/sHn[X![5PM nn[RU4$s snf�Nr)r�r�r�runtemplate)r�r��e�ctmpls    rL�
buildtemplater��s9��69�!�"�g�>�g��Z��G�
,�g�E�>��$�$�e�,�,��
?s�6c�l�[US5nX!R;a6URUn[USU[5n[R
XC44$X!R;a1URUn[USU[X%R5nXV4$[R"[S5U-5e)Nr+r�unknown function '%s')r��_filtersr�r�r�	runfilter�_funcs�_buildfuncargs�_argspecrr:r)r�r�rg�filt�arg�f�argss       rL�buildfilterr��s����#�a�&��A���������"����Q���'�2���&�&���4�4��N�N���N�N�1����c�!�f�g�w��:�:�F���y��
�
�
�1�5�6��:�
;�;rXc�n�[USU[5n[USU5n[RX#44$�Nrr+)r�r�r�r�runmap)r�r��darg�targs    rL�buildmapr��s7���c�!�f�g�w�/�D��s�1�v�w�'�D����$��.�.rXc�l�[USU[5n[US5n[RX#44$r�)r�r�r�r�	runmember)r�r�r��membs    rL�buildmemberr��s5���c�!�f�g�w�/�D��S��V��D��"�"�T�L�1�1rXc�N�[USU[5n[RU4$r�)r��exprmethodsr�	runnegate)r�r�r�s   rL�buildnegater��s%��
�S��V�W�k�
2�C��"�"�C�(�(rXc�z�[USU[5n[USU[5n[RX#U44$r�)r�r�r�
runarithmetic)r�r��func�left�rights     rL�buildarithmeticr�s<���c�!�f�g�{�3�D��s�1�v�w��4�E��&�&��U�(;�<�<rXc���[US5nX!R;a1URUn[USU[X#R5nX44$X!R
;ak[USU[USS9n[
U5S:wa"[R"[S5U-5eUR
Un[RUSU44$[R"[S5U-5e)Nrr+)�argspecsfilter %s expects one argumentrr�)r�r�r�r�r�r�r>rr:rrr�)r�r�rgr�r�s     rL�	buildfuncr�s����#�a�&��A��N�N���N�N�1����c�!�f�g�{�A�z�z�J���y�������c�!�f�g�{�A�t�L���t�9��>��"�"�1�%F�#G�!�#K�L�L����Q����&�&��a��!��5�5�
�
�
�1�5�6��:�
;�;rXc�^^�UU4SjnUU4SjnU(dU"[U55$[R"U5=upxp�n[R"[U5UUSSS9n[R
"5nU(aU"UR
U55X�'U
(aU"UR
U
55X�'URU"U55 U$)a�Compile parsed tree of function arguments into list or dict of
(func, data) pairs

>>> context = engine(lambda t: (templateutil.runsymbol, t))
>>> def fargs(expr, argspec):
...     x = _parseexpr(expr)
...     n = getsymbol(x[1])
...     return _buildfuncargs(x[2], context, exprmethods, n, argspec)
>>> list(fargs(b'a(l=1, k=2)', b'k l m').keys())
['l', 'k']
>>> args = fargs(b'a(opts=1, k=2)', b'**opts')
>>> list(args.keys()), list(args[b'opts'].keys())
(['opts'], ['opts', 'k'])
c�b>�[R"UU4SjUR555$)Nc3�F># �UHupU[UTT54v� M g7fr`�r�)rb�kr�r�r�s   ��rLrc�6_buildfuncargs.<locals>.compiledict.<locals>.<genexpr>(s$����
�@J���Q�
�1�g�z�2�3�
�s�!)r�sortdict�items)r�r�r�s ��rL�compiledict�#_buildfuncargs.<locals>.compiledict's'����}�}�
�@B���
�
�
�	
rXc�J>�UVs/sHn[UTT5PM sn$s snfr`r�)r�r�r�r�s  ��rL�compilelist�#_buildfuncargs.<locals>.compilelist,s$���<>�?�B�q�
�1�g�z�2�B�?�?��?s� r)r.)�keyvaluenode�keynode)r�r
�splitargspec�
buildargsdictrr��pop�update)
r�r�r��funcnamer�r�r��_poskeys�varkey�_keys�optkey�treeargs�compargss
 ``          rLr�r�s���� 
�
@���7�3�<�(�(�17�0C�0C�G�0L�L�#�H�e�g��#�#������ ���H��}�}��H�
�&�x�|�|�F�';�<���
�&�x�|�|�F�';�<����O�O�K��)�*��OrXc�@�[R"[S55e)Ns*can't use a key-value pair in this contextr�)r��contents  rL�buildkeyvaluepairr�Es��
�
�
�1�J�K�
L�LrXc�P�[R"[S5[S5S9e)Ns can't use a list in this contextscheck place of comma and parens�rr�r�s  rL�	buildlistr�Is'��
�
�
�	�
-�.�
�1�
2��rXc�,�[RUS4$r�)r�
runinteger�r�rEs  rLrhrhRs��l�5�5�q��t�<rXc�,�[RUS4$r�)r�	runstringr�s  rLrhrhS���\�3�3�Q�q�T�:rXc�,�[RUS4$r�)r�	runsymbolr�s  rLrhrhTr�rXrc�*�[USU[5$r�)r�r�r�s  rLrhrhVs��:�a��d�A�{�;rXrr)r,c��[XS5$)Nc�
�X-$r`rf��a�bs  rLrh�<lambda>.<locals>.<lambda>]���!�%rX�r�r�s  rLrhrh]����q�-?�@rXc��[XS5$)Nc�
�X-
$r`rfrs  rLrhr^rrXrr�s  rLrhrh^rrXr%c��[XS5$)Nc�
�X-$r`rfrs  rLrhr`rrXrr�s  rLrhrh`rrXc��[XS5$)Nc�
�X-$r`rfrs  rLrhras��!�&rXrr�s  rLrhrhas���q�-@�ArXc�H�\rSrSrSr\"S5r\"\5r	\S5r
Srg)�_aliasrulesiiz2Parsing and expansion rule set of template aliasesstemplate aliasc��USS:Xa"USSS:XaUSS[US54$USS:XaUSSS:XaUSSUS/4$gg)zFReturn (name, args) if tree is func(...) or ...|filter; otherwise
Nonerrrr.r+rNr�r�s rL�_trygetfunc�_aliasrules._trygetfuncosu����7�g��$�q�'�!�*�	�"9���7�1�:�w�t�A�w�/�/�/���7�d�?�t�A�w�q�z�Y�6���7�1�:��Q��y�(�(� 7�?rXrfN)�__name__�
__module__�__qualname__�__firstlineno__�__doc__r�_section�staticmethodr��_parser�__static_attributes__rfrXrLrris,��<��"�#�H�
�*�
%�F��)��)rXrc�V�[RU5n[RX 5$)z'Return new tree of aliases are expanded)rr��expand)r��aliases�aliasmaps   rL�
expandaliasesr!ys#���#�#�G�,�H����h�-�-rXc�X�[U5S:dUSS;dUSUS:waU$USS$)z9unwrap quotes if any; otherwise returns unmodified stringr+r�'"���r)r>)rFs rL�
unquotestringr%�s6��
�1�v��z�Q�q�T��'�1�Q�4�1�R�5�=����Q�r�7�NrXc��\rSrSrSr\Rr\RS5r	\RS5r
\RS5r\RS5rSr
g)	�resourcemapperi�z%Mapper of internal template resourcesc��g)�BReturn a set of available resource keys based on the given mappingNrf��selfr�s  rL�
availablekeys�resourcemapper.availablekeys���rXc��g)�'Return a set of supported resource keysNrf�r+s rL�	knownkeys�resourcemapper.knownkeys�r.rXc��g)z:Return a resource for the key if available; otherwise NoneNrf�r+r�rjs   rL�lookup�resourcemapper.lookup�r.rXc��g)z[Return a dict of additional mapping items which should be paired
with the given new mappingNrf�r+r��origmapping�
newmappings    rL�populatemap�resourcemapper.populatemap�r.rXrfN)rrrrr�abc�ABCMeta�
__metaclass__�abstractmethodr,r2r6r<rrfrXrLr'r'�sx��/��K�K�M����Q��Q�	���6��6�	���I��I�	���&��&rXr'c�,�\rSrSrSrSrSrSrSrg)�nullresourcemapperi�c��[5$r`��setr*s  rLr,� nullresourcemapper.availablekeys��	���u�rXc��[5$r`rEr1s rLr2�nullresourcemapper.knownkeys�rHrXc��gr`rfr5s   rLr6�nullresourcemapper.lookup�s��rXc��0$r`rfr9s    rLr<�nullresourcemapper.populatemap�s���	rXrfN)	rrrrr,r2r6r<rrfrXrLrCrC�s�����rXrCc�j�\rSrSrSrSSjrSrSrSrSr	S	r
S
rSrSr
S
rSrSrSrSrg)�enginei�axtemplate expansion engine.

template expansion works like this. a map file contains key=value
pairs. if value is quoted, it is treated as string. otherwise, it
is treated as name of template file.

templater is asked to expand a key in map. it looks up key, and
looks for strings like this: {foo}. it expands {foo} by looking up
foo in map, and substituting it. expansion is recursive: it stops
when there is no more {foo} to replace.

expansion also allows formatting and filtering.

format uses key to expand each item in list. syntax is
{key%format}.

filter uses function to transform value. syntax is
{key|filter1|filter2|...}.Nc��XlUc0nX l[RUlUc0nUc
[5nX0lX@l0Ul0Ul	gr`)
�_loaderr�r�funcsr�rC�	_defaults�
_resources�_cache�
_tmplcache)r+�loader�filters�defaults�	resourcess     rL�__init__�engine.__init__�sT�����?��G��
�#�)�)������H���*�,�I�!��#�������rXc	��URR5nURRU5nUR5VVs0sH3upVXS;d'UR	URU55(dM1XV_M5 nnnUR
U5 UR
URRXU55 U$s snnf)z^Create combined mapping from the original mapping and partial
mapping to override the original)rUr2r,r��
isdisjoint�_defaultrequiresr�r<)r+r:r;�knownres�newresr��vr�s        rL�
overlaymap�engine.overlaymap�s���
�?�?�,�,�.�����.�.�z�:��$�)�)�+�
�+����
��$�$�T�%:�%:�1�%=�>�	
�A�D�+�	�
�	���z�"�����O�O�'�'��:�F�	
����
s�	0C�=Cc�z�URRU5nUb[U5(dg[USS5$)z?Resource keys required by the specified default symbol functionrf�	_requires)rT�get�callable�getattr)r+rjrcs   rLr`�engine._defaultrequires�s5���N�N���s�#���9�H�Q�K�K���q�+�r�*�*rXc��SnX RR5;aURU5nUcURRU5nU$)z:Resolve symbol to value or function; None if nothing foundN)rUr2rhrT�r+r�rjrcs    rL�symbol�
engine.symbol�sF�����o�o�/�/�1�1����C� �A��9����"�"�3�'�A��rXc�8�URRU5$)r))rUr,r*s  rL�availableresourcekeys�engine.availableresourcekeys�s�����,�,�W�5�5rXc�6�URR5$)r0)rUr2r1s rL�knownresourcekeys�engine.knownresourcekeys�s�����(�(�*�*rXc��URRX5nUc"[R"[	S5U-5eU$)zFReturn internal data (e.g. cache) used for keyword/function
evaluations#template resource not available: %s)rUr6r�ResourceUnavailablerrms    rL�resource�engine.resource�sE��
�O�O�"�"�7�0���9��2�2��8�9�C�?��
��rXc���XR;aDURU5n[U4URU'[X [5URU'URU$! URU	e=f)z!load, parse, and cache a template)rVrRr�r�r�)r+r�r�s   rLr��engine._loadsi���K�K�����Q��A�1�1�5�D�K�K��N�
�!+�A�W�!=����A���{�{�1�~���
��K�K��N��s�A#�#A3c��XR;a([U5n[X [5URU'URU$)z"Parse and cache a literal template)rWrqr�r��r+rSr�s   rLr�
engine._parses9�����&��d��A�$.�q��$@�D�O�O�D�!����t�$�$rXc�\�URU5 g![Ra gf=f)z:Load, parse, and cache the specified template if availableTF)r�r�TemplateNotFound�r+r�s  rL�preload�engine.preloads-��	��J�J�q�M����,�,�	��	�s��+�+c�L�URU5up4URX4U5$)z�Perform expansion. t is name of map element to expand.
mapping contains added elements for use during expansion. Is a
generator.)r��_expand)r+r�r�r�rGs     rL�process�engine.process$s$���Z�Z��]�
���|�|�D��0�0rXc�L�URU5up4URX4U5$)z�Perform expansion over a literal template

No user aliases will be expanded since this is supposed to be called
with an internal template string.
)rr�)r+rSr�r�rGs     rLr�
engine.expand+s%���[�[��&�
���|�|�D��0�0rXc	��URRU0U5nU(aURU5 Un[R"XU"XU55$r`)rUr<r�r�flatten)r+r�rGr��extramappings     rLr��engine._expand4sL�����2�2�4��W�E�������(�"�G��#�#�D�4��t�3L�M�MrX)rVrTr�r�rRrUrW)NNN)rrrrrr\rdr`rnrqrtrxr�rr�r�rr�rrfrXrLrPrP�sI��"�&
��*+��6�+���%��1�1�NrXrPc�&�[5nU(d[S5$[R"U5n/nUH>nUR	S5nUSS;aMUSS:XdM*URUS5 M@ SR
[U55$)	Ns7no templates found, try `hg debuginstall` for more inforr$)sorigsrejrsmap-cmdliners, )�templatedirr�os�listdir�splitrQ�join�sorted)�path�dirlist�	stylelist�filer�s     rLr�r�?s����=�D���K�L�L��j�j���G��I����
�
�4� ����9�)�)����8�~�%����U�1�X�&���:�:�f�Y�'�(�(rXc���[RRU5(a[R"US5$[
R"[S5U-[S5[5-S9e)N�rbsstyle '%s' not foundsavailable styles: %sr�)	r�r��existsr�	posixfiler�Abortrr�)�mapfiles rL�
_open_mapfiler�NsU��	�w�w�~�~�g����~�~�g�u�-�-�
�+�+�	�
!�"�W�,�
�&�
'�)�+�
5��rXc�$^
^^�[R(a0UR[R5nSR	U5n[
RRU5m
[R"5mU
UU4SjmUR5nTRXSS0TS9 0n0n/nTRSS5nU(GaWUSS;GaM[
RR[
RR	T
U55n[
RRU5(d�[5n	U	b�[
RR[
RR	X�55n
[
RRU
5(aU
nOc[
RR[
RR	U
S	55n[
RRU5(aUn[!U5n[#X5upEnTR%S5H�up�U(d0[&R("[+S
5TR-SU55eUSS;aKUSUS:wa0[&R("[+S5TR-SU55e[/U5XL'M�US:wdM�[
RR	T
U5X\'M� UR1TR%S
55 XEU4$)z.Load template elements from the given map filer!c�>�SnT(ax[RR[RRTU55n[RR	U5(a[
R"US5nU(d�[RU;aUn[R"SU5nO�[5nU(aw[RR[RRXP55n[RR	U5(a[
R"US5nU(a$UR5nTRWUUUT	S9 gg![a SnN:f=f)Nr�smercurial.templates)�sections�remap�include)r�r��normpathr��isfilerr�r�ossepr�
open_resourcer	r��readrq)
�relr�r��subresource�abs�dirrG�base�confr�s
       ���rLr��_readmapfile.<locals>.includecs�������'�'�"�"�2�7�7�<�<��c�#:�;�C��w�w�~�~�c�"�"�"�n�n�S�%�8����~�~�S�(���'�".�"<�"<�.��#�K�"�m����'�'�*�*�2�7�7�<�<��+A�B�C��w�w�~�~�c�*�*�&*�n�n�S�%�&@����#�#�%�D��J�J���!���
�
���)�'�"&�K�'�s�!E-�-E<�;E<rX�	templates)r�r�s__base__rr#smaps
missing valuer$sunmatched quotess
templatealias)r�	iswindowsr�r�r�r�r��dirnamer
r�rqrhr�r�r�r�r��_readmapfiler�rr:r�sourcer%�extend)�fpr��
name_pathsrG�cache�tmaprrWr�r��p2�p3rjr�r�r�s             @@@rLr�r�WsI������
�]�]�8�>�>�2�
��)�)�J�'��
�7�7�?�?�7�#�D��=�=�?�D��>�7�7�9�D��J�J�w�S�,�$7��J�I��E�
�D��G�
�(�(�<��
-�C�
�s�1�v�V�#��w�w��������T�3� 7�8���w�w�~�~�d�#�#��-�C����W�W�%�%�b�g�g�l�l�3�&<�=���7�7�>�>�"�%�%��D����)�)�"�'�'�,�,�r�6�*B�C�B��w�w�~�~�b�)�)�!��
�4�
 ��+�B�5���W��J�J�|�,�����"�"��"�#�T�[�[��s�%C��
��q�6�V���1�v��R�� ��&�&��)�*�D�K�K��c�,J���'�s�+�E�J�
�K�
������T�3�/�D�I�-��N�N�4�:�:�.�/�0����rXc�<�\rSrSrSrSrSrSrSrSr	Sr
S	rg
)rXi�z2Load template fragments optionally from a map filec�z�Uc0nUR5Ul0Ul[R	U5Ulgr`)�copyr��_maprr��	_aliasmap)r+r�rs   rLr\�loader.__init__�s2���=��E��Z�Z�\��
���	�$�-�-�g�6��rXc�H�XR;=(d XR;$r`)r�r��r+rjs  rL�__contains__�loader.__contains__�s���j�j� �4�C�9�9�$4�4rXc�>�XR;a8[URU5up#UR5URU'URURU5$![a4n[
R"[S5URS-5eSnAf[apn[S5URU[R"URS54-n[URS[R"U55eSnAff=f)�?Get parsed tree for the given template name. Use a local cache.s"%s" not in template maprNstemplate file %s: %sr)r��
open_templater�r��KeyErrorrr�rr��OSErrorr�forcebytestrr�strfromlocalr)r+r�r�r�rx�reasons      rL�load�loader.load�s����J�J��
K�+�D�I�I�a�L�9��� "���	��
�
�1�
��{�{�4�:�:�a�=�)�)���
�"�3�3��1�2�T�Y�Y�q�\�A�����
K��2�3��I�I�a�L��+�+�D�I�I�a�L�9�7����d�i�i��l�H�,A�,A�&�,I�J�J��
K�s$�7A&�&
D�0/B�
D�,A+D�Dc�~�[U5nUR(a [RURU5nU$r`)rqr�rrr}s   rLr�
loader._parse�s-���$�K���>�>��"�"�4�>�>�1�5�A��rXc�&�U(dgUSnUS:XabUSnXBS;agUSRU5 X@R;dX@R;a!URUR	U5U5 gUS;agUS:Xa6USR[US55 URUSU5 gUS:Xa6USR[US55 URUSU5 gUSSHnURXR5 M g)Nrr.r>r/r-rr+r)�addr�r��_findsymbolsusedr�r�)r+r��symsr�rFr�s      rLr��loader._findsymbolsused�s����
�!�W��
��?��Q��A���G�|����G�K�K��N��J�J��!�y�y�.��%�%�d�i�i��l�D�9��
�(�(��
��:���G�K�K�	�$�q�'�*�+��!�!�$�q�'�4�0��
��=���G�K�K�	�$�q�'�*�+��!�!�$�q�'�4�0���a�b��A��!�!�!�*�rXc�p�[5[54nURURU5U5 U$�z�Look up (keywords, filters/functions) referenced from the name
template 't'

This may load additional templates from the map file.
)rFr�r�)r+r�r�s   rL�symbolsused�loader.symbolsused�s.����s�u�~�����d�i�i��l�D�1��rX)r�r�r�N)rrrrrr\r�r�rr�r�rrfrXrLrXrX�s#��<�7�5�*�$�+�6rXrXc��\rSrSrSSjr\SSj5rSr\S5r	\S5r
\S5rS	rS
r
SrSrS
rSrSrg)�	templateri�Nc��[RR5nU(aURU5 [	XE5Ul[
UR
RX�U5UlXgsUl	Ul
g)aCreate template engine optionally with preloaded template fragments

- ``filters``: a dict of functions to transform a value into another.
- ``defaults``: a dict of symbol values/functions; may be overridden
  by a ``mapping`` dict.
- ``resources``: a resourcemapper object to look up internal data
  (e.g. cache), inaccessible from user template.
- ``cache``: a dict of preloaded template fragments.
- ``aliases``: a list of alias (name, replacement) pairs.

self.cache may be updated later to register additional template
fragments.
N)rrYr�r�rXrRrPr��_proc�	_minchunk�	_maxchunk)	r+rYrZr[r�r�minchunk�maxchunk�
allfilterss	         rLr\�templater.__init__�s]��.%�,�,�1�1�3�
�����g�&��e�-����D�L�L�-�-�z�Y�O��
�)1�&����rXc		��U"X4XV/Xx5n	U(d[U5n[X!5upjnU	RRR	U5 X�Rl[RU5U	RlU	$)z,Create templater from the specified map file)	r�r�rRr�r�r�rr�r�)�clsr�r�rYrZr[r�r�r�r�r�rs            rL�frommapfile�templater.frommapfilesk��
��9�R��L����w�'�B�+�B�8���W�	�	�	�����u�%��	�	��)�2�2�7�;��	�	���rXc��XR;$r`)rRr�s  rLr��templater.__contains__.s���l�l�"�"rXc�.�URR$r`)rRr�r1s rLr��templater.cache1s���|�|�!�!�!rXc�.�URR$r`)r�r�r1s rLr��templater._filters6s���z�z�"�"�"rXc�.�URR$r`)r�rTr1s rLrZ�templater.defaults:s���z�z�#�#�#rXc�8�URRU5$)r�)rRr�r�s  rLr��templater.load>s���|�|� � ��#�#rXc�$�URS5$)z�Look up (keywords, filters/functions) referenced from the default
unnamed template

This may load additional templates from the map file.
rX)r�r1s rL�symbolsuseddefault�templater.symbolsuseddefaultBs������$�$rXc�8�URRU5$r�)rRr�r�s  rLr��templater.symbolsusedJs���|�|�'�'��*�*rXc�&�URSU5$)z?Render the default unnamed template and return result as stringrX)�renderr*s  rL�
renderdefault�templater.renderdefaultRs���{�{�3��(�(rXc�B�SRURX55$)z?Render the specified named template and return result as stringrX)r��generate)r+r�r�s   rLr��templater.renderVs���x�x��
�
�a�1�2�2rXc��URRX5nUR(a)[R"X0RUR
S9nU$)zNReturn a generator that renders the specified named template and
yields chunks)ro�max)r�r�r�r�increasingchunksr�)r+r�r��streams    rLr��templater.generateZsC�����#�#�A�/���>�>��*�*��N�N�����F��
rX)rRr�r�r�)NNNNrf��)NNNNNrr)rrrrr\�classmethodr�r��propertyr�r�rZr�r�r�r�r�r�rrfrXrLr�r��s����������<�<�����������*#��"��"��#��#��$��$�$�%�+�)�3�rXr�c���[RR[RR[R
S55n[RR
U5(aU$S$)z6return the directory used for template files, or None.r�N)r�r�r�r�r�datapath�isdir)r�s rLr�r�esH��
�7�7���B�G�G�L�L��)>�)>��M�N�D��7�7�=�=��&�&�4�0�D�0rXc�4�[RRU5(d$[RRU5(aU[	USS94$Uc
[5nUb+[RR
X5nU[	USS94$[R(a0UR[R5nSR
U5nURS5nSR
SS/USS-5nU[R"XTS54$)	z�returns a file-like object for the given template, and its full path

If the name is a relative path and we're in a frozen binary, the template
will be read from the mercurial.templates package instead. The returned path
will then be the relative path.
�rb)�modeNr!rs	mercurialr�r$)
r�r�r��isabs�openr�r�rr�r�r�rr�)�name�templatepathr�r��
name_parts�package_names      rLr�r�ks���
�w�w�~�~�d���r�w�w�}�}�T�2�2��T�$�T�*�*�*���"�}�����G�G�L�L��,���$�q�t�$�$�$����
�Z�Z����/�
��y�y��$�����D�!�J��9�9�l�L�9�J�s��O�K�L�L���"�"�<�B��@��rXc�F�[X5$![[4a gf=f)N)NN)r�r��ImportError)rrs  rL�try_open_templater�s)����T�0�0���[�!����s�

� � r`)rX)F)rXF)r�bytesr�Optional[bytes]�returnzTuple[bytes, BinaryIO])rrrrrz*Tuple[Optional[bytes], Optional[BinaryIO]])Er�
__future__rr>r��typingrrr�i18nrrr	�r
rrr
rrrr�utilsrrrnrMr9r\rPrrr�rqr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��basealiasrulesrr!r%r'rCrPr�r�r�rXr�r�r�rrfrXrL�<module>r!s=��:�x#�
�	�����
�
�
����
C��	�
,��	�
,�	�
	�
,��	�
*�
�	�
*��	�
*��	�
5��	�
1��	�
-��	�
%���1���/���/�� �3�!�"�'�#��*h�VG�4G�:1�h
N�  �F6��>%�I�'�G��
>�M�-�

<�/�2�)�
=�<�+�\M����<��
�:���:����	�

�;��	�+�
�	�+��	�(���Y���"���Y��	�
@��	�
@���{��	�
@�� 	�
A�!��(�
�
�
��!�)�,��
��
)�&�'�'�
)� .��&�&�.���NN�NN�b)��T �nH�H�Vi�i�X1�26�"�
�"�.�"��"�L26��
��.��/�rX

Youez - 2016 - github.com/yon3zu
LinuXploit