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__/formatter.cpython-39.pyc
a

�+�bZi�@sdZddlmZmZddlZddlZddlZddlmZddl	m
Z
mZddlm
Z
ddlmZmZmZmZmZmZmZdd	lmZmZmZejZd
d�ZGdd
�d
e�ZGdd�de�Zdd�ZGdd�de�Z dd�Z!Gdd�de�Z"Gdd�de�Z#Gdd�de�Z$Gdd�de�Z%Gdd�de�Z&Gd d!�d!e�Z'Gd"d#�d#e�Z(Gd$d%�d%e�Z)e
j*d&d'�Gd(d)�d)e��Z+d*d+�Z,dGd,d-�Z-d.d/�Z.dHd0d1�Z/d2d3�Z0d4d5�Z1dId6d7�Z2dJd8d9�Z3e�Z4Gd:d;�d;ej5�Z6dKd=d>�Z7d?d@�Z8ej9dAdB��Z:ej9dCdD��Z;dEdF�Z<dS)La~Generic output formatting for Mercurial

The formatter provides API to show data in various ways. The following
functions should be used in place of ui.write():

- fm.write() for unconditional output
- fm.condwrite() to show some extra data conditionally in plain output
- fm.context() to provide changectx to template output
- fm.data() to provide extra data to JSON or template output
- fm.plain() to show raw text that isn't provided to JSON or template output

To show structured data (e.g. date tuples, dicts, lists), apply fm.format*()
beforehand so the data is converted to the appropriate data type. Use
fm.isplain() if you need to convert or format data conditionally which isn't
supported by the formatter API.

To build nested structure (i.e. a list of dicts), use fm.nested().

See also https://www.mercurial-scm.org/wiki/GenericTemplatingPlan

fm.condwrite() vs 'if cond:':

In most cases, use fm.condwrite() so users can selectively show the data
in template output. If it's costly to build data, use plain 'if cond:' with
fm.write().

fm.nested() vs fm.formatdict() (or fm.formatlist()):

fm.nested() should be used to form a tree structure (a list of dicts of
lists of dicts...) which can be accessed through template keywords, e.g.
"{foo % "{bar % {...}} {baz % {...}}"}". On the other hand, fm.formatdict()
exports a dict-type object to template, which can be accessed by e.g.
"{get(foo, key)}" function.

Doctest helper:

>>> def show(fn, verbose=False, **opts):
...     import sys
...     from . import ui as uimod
...     ui = uimod.ui()
...     ui.verbose = verbose
...     ui.pushbuffer()
...     try:
...         return fn(ui, ui.formatter(pycompat.sysbytes(fn.__name__),
...                   pycompat.byteskwargs(opts)))
...     finally:
...         print(pycompat.sysstr(ui.popbuffer()), end='')

Basic example:

>>> def files(ui, fm):
...     files = [(b'foo', 123, (0, 0)), (b'bar', 456, (1, 0))]
...     for f in files:
...         fm.startitem()
...         fm.write(b'path', b'%s', f[0])
...         fm.condwrite(ui.verbose, b'date', b'  %s',
...                      fm.formatdate(f[2], b'%Y-%m-%d %H:%M:%S'))
...         fm.data(size=f[1])
...         fm.plain(b'\n')
...     fm.end()
>>> show(files)
foo
bar
>>> show(files, verbose=True)
foo  1970-01-01 00:00:00
bar  1970-01-01 00:00:01
>>> show(files, template=b'json')
[
 {
  "date": [0, 0],
  "path": "foo",
  "size": 123
 },
 {
  "date": [1, 0],
  "path": "bar",
  "size": 456
 }
]
>>> show(files, template=b'path: {path}\ndate: {date|rfc3339date}\n')
path: foo
date: 1970-01-01T00:00:00+00:00
path: bar
date: 1970-01-01T00:00:01+00:00

Nested example:

>>> def subrepos(ui, fm):
...     fm.startitem()
...     fm.write(b'reponame', b'[%s]\n', b'baz')
...     files(ui, fm.nested(b'files', tmpl=b'{reponame}'))
...     fm.end()
>>> show(subrepos)
[baz]
foo
bar
>>> show(subrepos, template=b'{reponame}: {join(files % "{path}", ", ")}\n')
baz: foo, bar
�)�absolute_import�print_functionN�)�_)�hex�short)�attr)�error�pycompat�templatefilters�
templatekw�	templater�templateutil�util)�cborutil�dateutil�
stringutilcCst|td�tttjttf�S)z�Check if the given object can be directly passed in to formatter's
    write() and data() functions

    Returns False if the object is unsupported or must be pre-processed by
    formatdate(), formatdict(), or formatlist().
    N)�
isinstance�type�bool�intr
Zlong�float�bytes)�obj�r�9/usr/lib64/python3.9/site-packages/mercurial/formatter.py�isprintable�src@sDeZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	dS)�_nullconverterz=convert non-primitive data types to be processed by formatterFcCs|S)z$wrap nested data by appropriate typer��data�tmpl�seprrr�
wrapnested�sz_nullconverter.wrapnestedcCs|\}}t|�|fS�z(convert date tuple to appropriate format)r)�date�fmt�tsZtzrrr�
formatdate�sz_nullconverter.formatdatecCst|�S�z:convert dict or key-value pairs to appropriate dict format)�dict�r�key�valuer%r!rrr�
formatdict�sz_nullconverter.formatdictcCst|�S�z+convert iterable to appropriate list format)�list�r�namer%r!rrr�
formatlist�sz_nullconverter.formatlistN�
�__name__�
__module__�__qualname__�__doc__�storecontext�staticmethodr"r'r-r2rrrrr�s


rc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zd*d
d�Z	d+dd�Z
d,dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!d"�Zd#d$�Zd-d&d'�Zd(d)�ZdS).�
baseformatterFcCs(||_||_||_||_d|_t|_dS�N)�_ui�_topic�_opts�
_converter�_itemr�hexfunc)�self�ui�topic�opts�	converterrrr�__init__�szbaseformatter.__init__cCs|Sr;r�rBrrr�	__enter__�szbaseformatter.__enter__cCs|dur|��dSr;)�end)rB�exctypeZexcvalue�	tracebackrrr�__exit__�szbaseformatter.__exit__cCsdS)z0show a formatted item once all data is collectedNrrHrrr�	_showitem�szbaseformatter._showitemcCs|jdur|��i|_dS)z begin an item in the format listN�r@rNrHrrr�	startitem�s
zbaseformatter.startitem�%a %b %d %H:%M:%S %Y %1%2cCs|j�||�Sr#)r?r')rBr$r%rrrr'�szbaseformatter.formatdate�key�valueN� cCs|j�|||||�Sr()r?r-)rBrr+r,r%r!rrrr-�szbaseformatter.formatdictcCs|j�||||�Sr.)r?r2)rBrr1r%r!rrrr2�szbaseformatter.formatlistcKsxt�|�}tdd�|D��s J�|jjrtd|vrHd|vrH|d��|d<d|vrhd|vrh|d��|d<|j�|�dS)z=insert context objects to be used to render template keywordscss|]}|dvVqdS)>�fctx�ctx�repoNr��.0�krrr�	<genexpr>��z(baseformatter.context.<locals>.<genexpr>rUrVrWN)	r
�byteskwargs�allr?r8Z	changectx�repor@�update)rBZctxsrrr�context�s
zbaseformatter.contextcCst�S)z#set of field names to be referenced)�setrHrrr�datahint�szbaseformatter.datahintcKst�|�}|j�|�dS)z8insert data into item that's not shown in default outputN)r
r]r@r`�rBrrrrr�s
zbaseformatter.datacOs:|��}t|�t|�ks$J||f��|j�t||��dS)z3do default text output while assigning data to itemN��split�lenr@r`�zip)rB�fields�deftext�	fielddatarE�	fieldkeysrrr�write�szbaseformatter.writecOs2|��}t|�t|�ksJ�|j�t||��dS)z4do conditional write (primarily for plain formatter)Nre)rB�condrirjrkrErlrrr�	condwrite�szbaseformatter.condwritecKsdS)z$show raw text for non-templated modeNr�rB�textrErrr�plainszbaseformatter.plaincCsdS)zcheck for plain formatter usageFrrHrrr�isplainszbaseformatter.isplainr\cCs*g}|j�|||�|j|<t|j|j|�S)z9sub formatter to store nested data in the specified field)r?r"r@�_nestedformatterr<)rB�fieldr r!rrrr�nested	szbaseformatter.nestedcCs|jdur|��dS)zend output for the formatterNrOrHrrrrJs
zbaseformatter.end)rQ)rRrSNrT)NrT)Nr\)r4r5r6�
strict_formatrGrIrMrNrPr'r-r2rarcrrmrorrrsrvrJrrrrr:�s$	



r:cCst|||td�S)zformatter that prints nothing)rF)r:r)rCrDrErrr�
nullformattersrxc@s eZdZdZdd�Zdd�ZdS)rtz6build sub items and store them in the parent formattercCstj||di|d�||_dS)Nr\)rDrErF)r:rG�_data)rBrCrFrrrrrGs
�z_nestedformatter.__init__cCs|j�|j�dSr;�ry�appendr@rHrrrrN#sz_nestedformatter._showitemN)r4r5r6r7rGrNrrrrrtsrtcCst|t�rtt�|��S|S)z'iterate key-value pairs in stable order)rr)�sortedr
Z	iteritems)rrrr�
_iteritems's
r}c@sDeZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	dS)�_plainconverterz(convert non-primitive data types to textFcCst�d��dS)Ns%plainformatter should never be nested)r	ZProgrammingErrorrrrrr"3sz_plainconverter.wrapnestedcCst�||�S)z(stringify date tuple in the given format)rZdatestr�r$r%rrrr'7sz_plainconverter.formatdatecs6tj��durd�tj�|���fdd�t|�D��S)z*stringify key-value pairs separated by sepNs%s=%sc3s&|]\}}��|��|�fVqdSr;r�rYrZ�v�r%Zprefmtrrr[Csz-_plainconverter.formatdict.<locals>.<genexpr>)r
�identity�bytestr�joinr}r*rr�rr-<s�z_plainconverter.formatdictcs2tj��durd�tj�|���fdd�|D��S)z#stringify iterable separated by sepNs%sc3s|]}��|�VqdSr;r)rY�er�rrr[Nr\z-_plainconverter.formatlist.<locals>.<genexpr>)r
r�r�r�r0rr�rr2Gs
z_plainconverter.formatlistNr3rrrrr~.s



r~c@sZeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
ddd�Zdd�ZdS)�plainformatterzthe default text output schemecsJt�||||t�|jr t|_nt|_|�ur8|j|_n�fdd�|_dS)Ncs
��|�Sr;)rm)�srE��outrr�<lambda>]r\z)plainformatter.__init__.<locals>.<lambda>)	r:rGr~Z	debugflagrrArrm�_write�rBrCr�rDrErr�rrGTs
zplainformatter.__init__cCsdSr;rrHrrrrP_szplainformatter.startitemcKsdSr;rrdrrrrbszplainformatter.datacOs|j||fi|��dSr;�r�)rBrirjrkrErrrrmeszplainformatter.writecOs|r|j||fi|��dS)zdo conditional writeNr�)rBrnrirjrkrErrrrohszplainformatter.condwritecKs|j|fi|��dSr;r�rprrrrrmszplainformatter.plaincCsdS)NTrrHrrrrspszplainformatter.isplainNr\cCs|Sr;r)rBrur r!rrrrvsszplainformatter.nestedcCsdSr;rrHrrrrJwszplainformatter.end)Nr\)
r4r5r6r7rGrPrrmrorrrsrvrJrrrrr�Qs
r�c@s$eZdZdd�Zdd�Zdd�ZdS)�debugformattercCs.t�||||t�||_|j�d|j�dS)Ns%s = [
)r:rGr�_outrmr=r�rrrrG|szdebugformatter.__init__cCs"|j�dtj|jddd��dS)Ns    %s,
�r)�indent�level)r�rmrZpprintr@rHrrrrN�s�zdebugformatter._showitemcCst�|�|j�d�dS)Ns]
�r:rJr�rmrHrrrrJ�s
zdebugformatter.endN�r4r5r6rGrNrJrrrrr�{sr�c@s$eZdZdd�Zdd�Zdd�ZdS)�pickleformattercCs"t�||||t�||_g|_dSr;)r:rGrr�ryr�rrrrG�szpickleformatter.__init__cCs|j�|j�dSr;rzrHrrrrN�szpickleformatter._showitemcCs"t�|�|j�t�|j��dSr;)r:rJr�rm�pickle�dumpsryrHrrrrJ�s
zpickleformatter.endNr�rrrrr��sr�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�
cborformatterz2serialize items as an indefinite-length CBOR arraycCs*t�||||t�||_|j�tj�dSr;)r:rGrr�rmr�BEGIN_INDEFINITE_ARRAYr�rrrrG�szcborformatter.__init__cCs|j�d�t�|j���dS)Nr\)r�rmr�rZstreamencoder@rHrrrrN�szcborformatter._showitemcCst�|�|j�tj�dSr;)r:rJr�rmr�BREAKrHrrrrJ�s
zcborformatter.endN)r4r5r6r7rGrNrJrrrrr��sr�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�
jsonformatterTcCs.t�||||t�||_|j�d�d|_dS)N�[T)r:rGrr�rm�_firstr�rrrrG�szjsonformatter.__init__cCs�|jrd|_n|j�d�|j�d�d}t|j���D]@\}}|rJd}n|j�d�tj|dd�}|j�d||f�q8|j�d�dS)	NF�,s
 {
Ts,
)Zparanoids
  "%s": %ss
 })r�r�rmr|r@�itemsrZjson)rB�firstrZr��urrrrN�szjsonformatter._showitemcCst�|�|j�d�dS)N�
]
r�rHrrrrJ�s
zjsonformatter.endN)r4r5r6rwrGrNrJrrrrr��sr�c@sDeZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	dS)�_templateconverterz=convert non-primitive data types to be processed by templaterTcCstj|||d�S)z$wrap nested data by templatable type)r r!)rZmappinglistrrrrr"�sz_templateconverter.wrapnestedcCs
t�|�S)zreturn date tuple)rr$rrrrr'�sz_templateconverter.formatdatecs6t�t���������fdd�}tj����|d�S)zAbuild object that can be evaluated as either plain string or dictc3st�������VdSr;)r~r-r�rr%r+r!r,rr�f�sz(_templateconverter.formatdict.<locals>.f)r+r,r%�gen)rZsortdictr}rZ
hybriddict)rr+r,r%r!r�rr�rr-�s

�z_templateconverter.formatdictcs,t�������fdd�}tj���|d�S)zAbuild object that can be evaluated as either plain string or listc3st������VdSr;)r~r2r�rr%r1r!rrr��sz(_templateconverter.formatlist.<locals>.f)r1r%r�)r/rZ
hybridlist)rr1r%r!r�rr�rr2�sz_templateconverter.formatlistNr3rrrrr��s


r�c@sDeZdZddd�Zdd�Zdd�Zejdd	��Zd
d�Z	dd
�Z
dS)�templateformatterNcCs|t�||||t�||_|j|_t||tjt	|�tj
d�|_|rN|jj�
|�t||jgd��|_t��|_|�di�dS)N��defaults�	resources�cache)�	docheader�	docfooter�	separatorr�)r:rGr�r��ref�_tref�
loadtemplaterr�keywords�templateresourcesZdefaulttempl�_tr�r`�templatepartsmap�_parts�	itertools�count�_counter�_renderitem)rBrCr�rDrE�spec�overridetemplatesrrrrG�s"��
ztemplateformatter.__init__cCsB|j��}t|j�|d<}|dkr0|�di�|�|j|�dS)Nsindexrr�)r@�copy�nextr�r�r�)rB�item�indexrrrrNs

ztemplateformatter._showitemcCsZ||jvrdS|j|}|��D]\}}|dur t�|�||<q |j�|j�||��dSr;)r�r�rZwrappedvaluer�rmr�Zrender)rB�partr�r�rZr�rrrr�
s

ztemplateformatter._renderitemcCs|j�|j�Sr;)r�Zsymbolsusedr�rHrrr�_symbolsusedsztemplateformatter._symbolsusedcCs
|jdS)z5set of field names to be referenced from the templater)r�rHrrrrcsztemplateformatter.datahintcCst�|�|�di�dS)Nr�)r:rJr�rHrrrrJs
ztemplateformatter.end)N)r4r5r6rGrNr�rZ
propertycacher�rcrJrrrrr��s


r�T)�frozenc@s<eZdZe��Ze��Ze��Zejdd�Zejdd�Z	dS)�templatespecN)�default)
r4r5r6rZibr�r �mapfile�refargs�fprrrrr�!s
r�cCstddd�Sr;�r�rrrr�empty_templatespec*sr�cCst|dd|�Sr;r�)r�r�rrr�reference_templatespec.sr�cCs$tjrt|t�rJd��td|d�S)Nstmpl must not be a strr\)r
Zispy3r�strr�)r rrr�literal_templatespec2sr�cCst|d||d�S)N)r�r�)rDr�r�rrr�mapfile_templatespec8sr�c	Csv|s
t�Sd|vrt|�S|dvr*t|�S|�d�\}}}|dvrn|rn|�d�rnt�|�t||dd�d�Stj�	|�d	s�t�
d
|�p�t�
|�\}}|r�t|||�S|�d|�r�t|�S|dkr�|�
td
�t���t�td���d|vs�d|v�rntj�|��rntj�|��d��r0t|tj�|��St�|d��}|��}Wd�n1�s\0Yt|�St|�S)a�Find the template matching the given -T/--template spec 'tmpl'

    'tmpl' can be any of the following:

     - a literal template (e.g. '{rev}')
     - a reference to built-in template (i.e. formatter)
     - a map-file name or path (e.g. 'changelog')
     - a reference to [templates] in config file
     - a path to raw template file

    A map file defines a stand-alone template environment. If a map file
    selected, all templates defined in the file will be loaded, and the
    template matching the given topic will be rendered. Aliases won't be
    loaded from user config, but from the map file.

    If no map file selected, all templates in [templates] section will be
    available as well as aliases in [templatealias].
    �{>�cbor�pickle�debug�json�(>r�r��)N���)r�rsmap-cmdline.�	templatesslistsavailable styles: %s
sspecify a template�/�\smap-srb)r�r�r��	partition�endswithr
Z	parseexpr�os�pathrfZtry_open_templater�ZconfigrmrZ	stylelistr	ZAbort�isfile�basename�
startswith�realpathr�	posixfile�read)	rCrDr �funcZfsepZftailZmapnamer�r�rrr�lookuptemplate<s<
�� (r�cs^|j|ji}|jr,|��fdd�|D��n.|jrZ|D]"}d|j|f}|�vr6|||<q6|S)zCreate a mapping of {part: ref}c3s|]}|�vr||fVqdSr;r)rY�p��trrr[�r\z#templatepartsmap.<locals>.<genexpr>s%s:%s)r�r�r`)r�r�Z	partnamesZpartsmapr�r�rr�rr�~s
r�cCsD|jr|jrJ�|jr0tjj|j|j|||d�St||j|||d�S)zPCreate a templater from either a literal template or loading from
    a map filer�)r r�r
Zfrommapfiler��
maketemplater)rCr�r�r�r�rrrr��s��r�cCsJ|�d�}tj||||d�}|j�dd�|�d�D��|rF||jd<|S)z0Create a templater from a string template 'tmpl's
templatealias)r�r�r��aliasescss |]\}}|t�|�fVqdSr;)r
Z
unquotestringr�rrrr[�sz maketemplater.<locals>.<genexpr>r�r\)Zconfigitemsr
r�r`)rCr r�r�r�r�r�rrrr��s
��
r�c@steZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Ze
ed�ZdS)r�z@Resource mapper designed for the default templatekw and functionNcCsi||d�|_dS)N)�cacherW�ui)�_resmap)rBrCr_rrrrG�s�ztemplateresources.__init__cs��fdd����D�S)Ncs h|]}���|�dur|�qSr;)�_getsomerX��mappingrBrr�	<setcomp>�sz2templateresources.availablekeys.<locals>.<setcomp>)�	knownkeys�rBr�rr�r�
availablekeys�s�ztemplateresources.availablekeyscCshd�S)N>r�rUr�rW�revcacherVrrHrrrr��sztemplateresources.knownkeyscCs@||��vrdS|�||�}|tur<|j|||�}||<|Sr;)r�r��_placeholder�
_loadermap�rBr�r+r�rrr�lookup�sztemplateresources.lookupcCs|i}|�|�ri|d<|�|�r@|�|�r@t�||d�}||d<d|vr\|�|d�r\t|d<d|vrx|�|d�rxt|d<|S)Nr��nodesoriginalnoderVrU�path)�_hasnodespecrZ	runsymbol�_hasliteralr�)rBraZorigmappingZ
newmappingr�Zorignoderrr�populatemap�s
ztemplateresources.populatemapcCs"|�|�}|dur|S|j�|�Sr;)�getr�r�rrrr��s
ztemplateresources._getsomecCs||vot||�S)z<Test if a literal value is set or unset in the given mapping)�callable)rBr�r+rrrr��sztemplateresources._hasliteralcCs|�|�}t|�rdS|S)z1Return value of the given name if it is a literalN)rrr�rrr�_getliteral�s
ztemplateresources._getliteralcCsd|vpd|vS)z=Test if context revision is set or unset in the given mappingr�rVrr�rrrr��sztemplateresources._hasnodespeccCsR|�|d�}|�|d�}|dus(|dur,dSz
||WStjyLYdS0dS)NrWr�)r�rr	ZRepoLookupError)rBr�r_�noderrr�_loadctx�s
ztemplateresources._loadctxcCsR|�|d�}|�|d�}|dus(|dur,dSz
||WStjyLYdS0dS)NrVr�)r�rr	�LookupError)rBr��ctxr�rrr�	_loadfctx�s
ztemplateresources._loadfctx)rVrU)N)r4r5r6r7rGr�r�r�rr�r�rr�rrr�rrrrr��s

�r�r\c	
CsT|j|i}	|r||	d|j<|r.||	d|j<|r@||	d|j<t||||||	d�S)z]Build template formatter that handles customizable built-in templates
    such as -Tjson(...)s%s:docheaders%s:docfooters%s:separator)r�)r�r�)
rCr�rDrEr�r �	docheader�	docfooter�	separatorZ	templatesrrr�_internaltemplateformatters
�rcCs�t|||�dd��}|jdkrJ|jdurJt|||||d|jtjtjd�S|jdkrbt||||�S|jdkr�|jdur�t|||||d|jdd	d
d�	S|jdkr�t	||||�S|jdkr�|jdus�Jd
��t
||||�S|jdk�r|jdu�s�Jd
��t||||�S|j�s|j�s|j
�rB|jdu�s2Jd
��t|||||�S|�dd��r^t||||�S|�dd��rzt	||||�St||||�S)Nstemplater\r�s{dict(%s)|cbor})r r	r
r�s{dict(%s)|json}s[
 r�s,
 )r r	r
rr�zfunction-style not supportedr�r�sformatdebugs
formatjson)r�rr�r�rrr�r�r�r�r�r�r r�r�Z
configboolr�)rCr�rDrEr�rrr�	formatter sT�

�

r
c	csdt�|d��D}t||||��}|VWd�n1s80YWd�n1sV0YdS)zrCreate a formatter that writes outputs to the specified file

    Must be invoked using the 'with' statement.
    swbN)rr�r
)rC�filenamerDrEr��fmrrr�
openformatterOsrccs
|VdSr;r)rrrr�_neverendingZsrcCs$|rt|j||j|j�St|�SdS)z�Create a formatter backed by file if filename specified, else return
    the given formatter

    Must be invoked using the 'with' statement. This will never call fm.end()
    of the given formatter.
    N)rr<r=r>r)rrrrr�maybereopen_sr)N)N)NNN)NNN)r\r\r\)=r7Z
__future__rr�
contextlibr�r�Zi18nrrrrZ
thirdpartyr�r	r
rrr
rrZutilsrrrr�r�objectrr:rxrtr}r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Zresourcemapperr�rr
�contextmanagerrrrrrrr�<module>s\d$	
a
#* &2


B

_�
/




Youez - 2016 - github.com/yon3zu
LinuXploit