AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 3.144.101.157
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib64/python2.7/site-packages/hgext/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /lib64/python2.7/site-packages/hgext/color.pyo
�
Hq�Qc@s�dZddlZddlmZmZmZmZmZddlm	Z	m
Z
ddlmZdZ
idd6d	d
6dd6d
d6dd6dd6dd6dd6dd6dd6dd6dd6dd 6d!d"6d#d$6d%d&6d'd(6d)d*6d+d,6d-d.6d/d06Zd1�Zd2�ZyddlZied3fd6ed4fd56ed6fd6ed7fd86ed7fd 6ed9fd96ed:fd:6edfd6ed;fd<6ed=fd6eejfd
6eejfd6eejfd6eejfd6eejfd6eejfd6eejfd6eejfd6aWnek
rBeanXi&d>d?6dd@6ddA6ddB6ddC6ddD6ddE6ddF6ddG6ddH6dIdJ6ddK6ddL6ddM6ddN6ddO6dPdQ6d>dR6dSdT6ddU6ddV6dWdX6ddY6ddZ6dd[6dd\6dSd]6d>d^6dSd_6dd`6dda6dbdc6dIdd6dedf6d>dg6dhdi6ddj6dIdk6Zdl�Zdm�Z dn�Z!do�Z"dpejfdq��YZ#dr�Z$ds�Z%dt�Z&ej'dukr�dZ)n*ddl*Z*ddl+Z+e+j,j-Z.e+j/Z0dZ1dve+j2fdw��YZ3dxe+j2fdy��YZ4dze+j2fd{��YZ5d|Z6d}Z7dZ8d~Z9dZ:dZ;d�Z<d
Z=d�Z>d�Z?d�Z@d�ZAidd6dd
6e:d6e9d6e:e9Bd6e8d6e8e:Bd6e8e9Bd6e:e9Be8Bd6e;d6d�d"6e>d$6e=d&6e>e=Bd(6e<d*6e<e>Bd,6e<e=Bd.6e>e=Be<Bd06e?d�6eAd6e@d 6Z)eBe;e?eAe@g�ZCe.jDe6�ZEeEdks�eEe1kr�dZ)nRe5�ZFe.jGeEe+jHeF��s�dZ)n%eFjIZJe*jKd�e*jLe*jMB�ZNd��ZOdS(�s

colorize output from some commands

This extension modifies the status and resolve commands to add color
to their output to reflect file status, the qseries command to add
color to reflect patch status (applied, unapplied, missing), and to
diff-related commands to highlight additions, removals, diff headers,
and trailing whitespace.

Other effects in addition to color, like bold and underlined text, are
also available. By default, the terminfo database is used to find the
terminal codes used to change color and effect.  If terminfo is not
available, then effects are rendered with the ECMA-48 SGR control
function (aka ANSI escape codes).

Default effects may be overridden from your configuration file::

  [color]
  status.modified = blue bold underline red_background
  status.added = green bold
  status.removed = red bold blue_background
  status.deleted = cyan bold underline
  status.unknown = magenta bold underline
  status.ignored = black bold

  # 'none' turns off all effects
  status.clean = none
  status.copied = none

  qseries.applied = blue bold underline
  qseries.unapplied = black bold
  qseries.missing = red bold

  diff.diffline = bold
  diff.extended = cyan bold
  diff.file_a = red bold
  diff.file_b = green bold
  diff.hunk = magenta
  diff.deleted = red
  diff.inserted = green
  diff.changed = white
  diff.trailingwhitespace = bold red_background

  resolve.unresolved = red bold
  resolve.resolved = green bold

  bookmarks.current = green

  branches.active = none
  branches.closed = black bold
  branches.current = green
  branches.inactive = none

  tags.normal = green
  tags.local = black bold

The available effects in terminfo mode are 'blink', 'bold', 'dim',
'inverse', 'invisible', 'italic', 'standout', and 'underline'; in
ECMA-48 mode, the options are 'bold', 'inverse', 'italic', and
'underline'.  How each is rendered depends on the terminal emulator.
Some may not be available for a given terminal type, and will be
silently ignored.

Note that on some systems, terminfo mode may cause problems when using
color with the pager extension and less -R. less with the -R option
will only display ECMA-48 color codes, and terminfo mode may sometimes
emit codes that less doesn't understand. You can work around this by
either using ansi mode (or auto mode), or by using less -r (which will
pass through all terminal control codes, not just color control
codes).

Because there are only eight standard colors, this module allows you
to define color names for other color slots which might be available
for your terminal type, assuming terminfo mode.  For instance::

  color.brightblue = 12
  color.pink = 207
  color.orange = 202

to set 'brightblue' to color slot 12 (useful for 16 color terminals
that have brighter colors defined in the upper eight) and, 'pink' and
'orange' to colors in 256-color xterm's default color cube.  These
defined colors may then be used as any of the pre-defined eight,
including appending '_background' to set the background to that color.

By default, the color extension will use ANSI mode (or win32 mode on
Windows) if it detects a terminal. To override auto mode (to enable
terminfo mode, for example), set the following configuration option::

  [color]
  mode = terminfo

Any value other than 'ansi', 'win32', 'terminfo', or 'auto' will
disable color.
i����N(tcommandstdispatcht
extensionstuitutil(t	templaterterror(t_tinternalitnoneitblackitredi tgreeni!tyellowi"tbluei#tmagentai$tcyani%twhiteitboldititalicit	underlineitinversei(tblack_backgroundi)tred_backgroundi*tgreen_backgroundi+tyellow_backgroundi,tblue_backgroundi-tpurple_backgroundi.tcyan_backgroundi/twhite_backgroundcCsts
dS|d
krdStjd�|jd�D��ytj�Wntjk
rg}iadSXxVtj�D]H\}\}}|s�quntj|�su|jd|�t|=ququWtjd�s�tjd�r|dkr|j	t
d	��niandS(sDInitialize terminfo data and the terminal if we're in terminfo mode.Ntautotterminfocss@|]6\}}|jd�r|dtt|�ffVqdS(scolor.iN(t
startswithtFalsetint(t.0tkeytval((s1/usr/lib64/python2.7/site-packages/hgext/color.pys	<genexpr>�s	tcolorsno terminfo entry for %s
tsetaftsetabs>no terminfo entry for setab/setaf: reverting to ECMA-48 color
(sautoR(t_terminfo_paramstupdatetconfigitemstcursest	setuptermRtitemsttigetstrtdebugtwarnR(RtmodeteR$tb((s1/usr/lib64/python2.7/site-packages/hgext/color.pyt_terminfosetupxs* cCs�|d}|dk}|o)tj|�}|r>|r>dS|petjjd�dkoe|j�}|jddd�}|}|dkr�tjdkr�dtjkr�d}q�d}n|dkria	t
s|dkr�|jtd	�|�ndSt
jt
�nj|dkr&ia	nU|d
krwt||�t	s{|d
krk|jtd	�|�nd}q{ndS|s�|r�|r�|SdS(NR&RtTERMtdumbR2tnttwin32tansis(warning: failed to set color mode to %s
R(Rt	parsebooltNonetostenvirontgett	formattedtconfigtnameR)t
w32effectsR1Rt_effectsR*R5(RtoptstcoloroptRtalwaysR@R2trealmode((s1/usr/lib64/python2.7/site-packages/hgext/color.pyt
_modesetup�s>
*			
tsgr0tsmsotstandouttsmultrevtreversetblinktdimtinvist	invisibletsitmsred bolds
grep.matchsgrep.linenumbersgrep.revsgrep.changesgrep.seps
grep.filenames	grep.users	grep.datesbookmarks.currentsbranches.actives
black boldsbranches.closedsbranches.currentsbranches.inactivesdiff.changedsdiff.deleteds
diff.difflines	cyan bolds
diff.extendedsdiff.file_as
green boldsdiff.file_bs	diff.hunks
diff.insertedsbold red_backgroundsdiff.trailingwhitespacesdiffstat.deletedsdiffstat.inserteds	ui.prompts
log.changesetsresolve.resolvedsresolve.unresolvedsstatus.addedsstatus.cleans
status.copiedscyan bold underlinesstatus.deletedsstatus.ignoreds	blue boldsstatus.modifiedsstatus.removedsmagenta bold underlinesstatus.unknownstags.normals
tags.localcCs�t}|jd�r(t}|d }nt|\}}|rKtj|�S|rjtjtjd�|�Stjtjd�|�SdS(s%Helper function for render_effects().t_backgroundi����R(R'N(R!tendswithtTrueR)R,R/ttparm(teffecttbgtattrR%((s1/usr/lib64/python2.7/site-packages/hgext/color.pyt_effect_strs

cCs�|s
|Stsrgdg|j�D]}tt|�^q$}ddj|�d}dttd�d}n2djd�dg|j�D��}td�}dj|||g�S(s-Wrap text in commands to turn on each effect.R	s;tmtcss|]}t|�VqdS(N(R\(R#RY((s1/usr/lib64/python2.7/site-packages/hgext/color.pys	<genexpr>#s(R)tsplittstrRDtjoinR\(ttextteffectsR3tstarttstop((s1/usr/lib64/python2.7/site-packages/hgext/color.pytrender_effectss0cCs:x3tj�D]%\}}tjt|di��q
WdS(Nt
colortable(Rt_stylesR*tgetattr(RBtext((s1/usr/lib64/python2.7/site-packages/hgext/color.pyt	extstyles(sc	Cs�x�|jd�D]�\}}d|ks|jd�r=qn|jd|�}|rg}xz|D]r}tr�|tkr�|j|�qb|tks�|d tkr�|j|�qb|jtd�||f�qbWdj|�t	|<qqWdS(NR&t.scolor.i����s:ignoring unknown color/effect %r (configured in color.%s)
t (
R+R t
configlistR)RDtappendR1RRbRi(Rtstatust
cfgeffectstgoodR3((s1/usr/lib64/python2.7/site-packages/hgext/color.pytconfigstyles,s
tcoloruicBs5eZed�ZdZd�Zd�Zd�ZRS(csq�jdkr%tt��j|�S|rQdj�fd��jj�D��Sdjd��jj�D��S(NR_c3s'|]\}}�j||�VqdS(N(tlabel(R#taRv(tself(s1/usr/lib64/python2.7/site-packages/hgext/color.pys	<genexpr>Dscss|]\}}|VqdS(N((R#RwRv((s1/usr/lib64/python2.7/site-packages/hgext/color.pys	<genexpr>Fs(t
_colormodeR<tsuperRut	popbufferRbt_bufferstpop(Rxtlabeled((Rxs1/usr/lib64/python2.7/site-packages/hgext/color.pyR{?sR:cOs�|jdkr(tt|�j||�S|jdd�}|jry|jdjg|D]}t|�|f^qW�n}|jdkr�xk|D]"}t	|tt|�j|�q�Wn>tt|�jg|D]}|j
t|�|�^q�|�SdS(NRvR_i����R9(RyR<RzRutwriteR?R|textendRat
win32printRv(RxtargsRERvRw((s1/usr/lib64/python2.7/site-packages/hgext/color.pyRIs	6
#cOs�|jdkr(tt|�j||�S|jdd�}|jdkryxk|D]"}t|tt|�j|�qPWn>tt|�jg|D]}|jt|�|�^q�|�SdS(NRvR_R9(	RyR<RzRut	write_errR?R�RvRa(RxR�RERvRw((s1/usr/lib64/python2.7/site-packages/hgext/color.pyR�Ws
#cCs�|jdkr(tt|�j||�Sg}x<|j�D].}tj|d�}|r;|j|�q;q;Wdj	|�}|r�dj	g|jd�D]}t
||�^q��S|S(NR_Rns
(RyR<RzRuRvR`RiR?RpRbRg(RxtmsgRvRdtlts((s1/usr/lib64/python2.7/site-packages/hgext/color.pyRvcs	)(t__name__t
__module__R!R{RyRR�Rv(((s1/usr/lib64/python2.7/site-packages/hgext/color.pyRu>s
			cCst|�dkr*tjtd���ntj|dd|||dd��}tj||tj||��}|jdd�}t	|t
�r�|Stj|dd|||dd��}tj||tj||��}tj|�}tj|�}|jj||�S(Nislabel expects two argumentsiitrepoR_(
tlenRt
ParseErrorRRt	stringifytruntemplatetcompiletemplateR?t
isinstanceRaRRv(tcontexttmappingR�tthingR�Rv((s1/usr/lib64/python2.7/site-packages/hgext/color.pyt
templatelabelrs++cCsj|j�rdSt|jt�s=|jft_t|_nd�}tjtd|�tt	j
d<dS(NcSsEt||�}|t_|r2t�t|�n|||||�S(N(RIRuRyRlRt(torigtui_REtcmdtcmdfuncR2((s1/usr/lib64/python2.7/site-packages/hgext/color.pytcolorcmd�s	
t_runcommandRv(tplaint
issubclasst	__class__Rut	__bases__RtwrapfunctionRR�Rtfuncs(RR�((s1/usr/lib64/python2.7/site-packages/hgext/color.pytuisetup�s	cCs/tjjdddtd�td�f�dS(NR_R&Rs2when to colorize (boolean, always, auto, or never)tTYPE(Rt
globaloptsRpR(R((s1/usr/lib64/python2.7/site-packages/hgext/color.pytextsetup�s			R8t_COORDcBs&eZdejfdejfgZRS(tXtY(R�R�tctypestc_shortt_fields_(((s1/usr/lib64/python2.7/site-packages/hgext/color.pyR��st_SMALL_RECTcBs>eZdejfdejfdejfdejfgZRS(tLefttToptRighttBottom(R�R�R�R�R�(((s1/usr/lib64/python2.7/site-packages/hgext/color.pyR��st_CONSOLE_SCREEN_BUFFER_INFOcBs;eZdefdefdefdefdefgZRS(tdwSizetdwCursorPositiontwAttributestsrWindowtdwMaximumWindowSize(R�R�R�t_WORDR�R�(((s1/usr/lib64/python2.7/site-packages/hgext/color.pyR��s
				l��l��iiii@i�i@i�itbold_backgrounds\[([^m]*)m([^]*)(.*)cKsM|jdd�}t}d�}xP|j�D]B}tj|d�}x'|j�D]}|t||�}qSWq.W|jd�s�d|}ntjt|�}	z�x�|	r3x>|	j	d�jd�D]$}
|
r�|t
|
�|�}q�q�Wtjt
|�||	j	d�|�tjt|	j	d	��}	q�WWdtjt
t�XdS(
NRvR_cSsT|dkrtS|tkr$||BS|dkr@|d@|d@BS|d@|d@BSdS(Ni����iipi�ii�(torigattrtpassthrough(R%R[((s1/usr/lib64/python2.7/site-packages/hgext/color.pytmapcolorssiR]ii(R?R�R`RiRCR tretmatchtansiretgroupR"t	_kernel32tSetConsoleTextAttributetstdout(RcR�RERvR[R�R�tstyleRYR^tsattr((s1/usr/lib64/python2.7/site-packages/hgext/color.pyR��s&	
	#(Pt__doc__R=t	mercurialRRRRtuimodRRRtmercurial.i18nRt
testedwithRDR5RIR,RWR!tCOLOR_BLACKt	COLOR_REDtCOLOR_GREENtCOLOR_YELLOWt
COLOR_BLUEt
COLOR_MAGENTAt
COLOR_CYANtCOLOR_WHITER)tImportErrorRiR\RgRlRtRuR�R�R�RBR<RCR�R�twindlltkernel32R�tc_ushortR�t_INVALID_HANDLE_VALUEt	StructureR�R�R�t_STD_OUTPUT_HANDLEt_STD_ERROR_HANDLEt_FOREGROUND_BLUEt_FOREGROUND_GREENt_FOREGROUND_REDt_FOREGROUND_INTENSITYt_BACKGROUND_BLUEt_BACKGROUND_GREENt_BACKGROUND_REDt_BACKGROUND_INTENSITYt_COMMON_LVB_REVERSE_VIDEOt_COMMON_LVB_UNDERSCOREtsetR�tGetStdHandleR�tcsbitGetConsoleScreenBufferInfotbyrefR�R�tcompilet	MULTILINEtDOTALLR�R�(((s1/usr/lib64/python2.7/site-packages/hgext/color.pyt<module>es(&#	%	-












				4					
						

Anon7 - 2022
AnonSec Team