-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/hgext/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/hgext/color.pyc


\,Tc@sZdZddlZddlmZmZmZmZmZm	Z	ddlm
Z
mZddlm
Z
iZejeZdZidd6d	d
6dd6d
d6dd6dd6dd6dd6dd6dd6dd6dd6dd 6d!d"6d#d$6d%d&6d'd(6d)d*6d+d,6d-d.6d/d06Zd1Zd2ZyddlZied3fd6ed4fd56ed6fd6ed7fd86ed7fd 6ed9fd96ed:fd:6edfd6ed;fd<6ed=fd6eejfd
6eejfd6eejfd6eejfd6eejfd6eejfd6eejfd6eejfd6aWne k
r]ianXi,d>d?6dd@6ddA6ddB6ddC6ddD6ddE6ddF6ddG6ddH6dIdJ6ddK6ddL6ddM6ddN6ddO6dPdQ6d>dR6dSdT6ddU6ddV6dWdX6ddY6ddZ6d>d[6dd\6dd]6dd^6d>d_6dSd`6d>da6ddb6dSdc6ddde6dSdf6ddg6ddh6didj6dIdk6dddl6d>dm6dndo6ddp6dIdq6a!drZ"dsZ#dtZ$duZ%dvZ&dwejfdxYZ'dyZ(dzZ)d{Z*ed|gd}d~Z+ej,dkr,dZ.n*ddl/Z/ddl0Z0e0j1j2Z3e0j4Z5dZ6de0j7fdYZ8de0j7fdYZ9de0j7fdYZ:dZ;dZ<dZ=dZ>dZ?dZ@dZAd
ZBdZCdZDdZEdZFidd6dd
6e?d6e>d6e?e>Bd6e=d6e=e?Bd6e=e>Bd6e?e>Be=Bd6e@d6dd"6eCd$6eBd&6eCeBBd(6eAd*6eAeCBd,6eAeBBd.6eCeBBeABd06eDd6eFd6eEd 6Z.eGe@eDeFeEgZHe3jIe;ZJeJdkseJe6krdZ.nRe:ZKe3jLeJe0jMeKs(dZ.n%eKjNZOe/jPde/jQe/jRBZSdZTdS(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

  rebase.rebased = blue
  rebase.remaining = red bold

  shelve.age = cyan
  shelve.newest = green bold
  shelve.name = blue bold

  histedit.remaining = red 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.
iN(tcmdutiltcommandstdispatcht
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|jdDytjWntjk
rg}iadSXxVtjD]H\}\}}|squntj|su|jd|t|=ququWtjdstjdr|dkr|j	t
d	niandS(sDInitialize terminfo data and the terminal if we're in terminfo mode.Ntautotterminfocss@|]6\}}|jdr|dtt|ffVqdS(scolor.iN(t
startswithtFalsetint(t.0tkeytval((s//usr/lib/python2.7/dist-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((s//usr/lib/python2.7/dist-packages/hgext/color.pyt_terminfosetups* cCs|dk}|otj|}|r4|r4dS|p[tjjddko[|j}|jddd}|}|dkrtjdkrdtjkrd}qd}n|dkria	t
s|dkr|jtd	|ndSt
jt
nj|dkria	nU|d
krmt||t	sq|d
kra|jtd	|nd}qqndS|s|r|r|SdS(NRtTERMtdumbR'R3tnttwin32tansis(warning: failed to set color mode to %s
R (Rt	parsebooltNonetostenvirontgett	formattedtconfigtnameR*t
w32effectsR2Rt_effectsR+R6(RtcoloroptRtalwaysRAR3trealmode((s//usr/lib/python2.7/dist-packages/hgext/color.pyt
_modesetups<*			
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.insertedshistedit.remainings	ui.prompts
log.changesetsrebase.rebasedsrebase.remainingsresolve.resolvedsresolve.unresolveds
shelve.ages
shelve.newests	blue boldsshelve.namesstatus.addedsstatus.cleans
status.copiedscyan bold underlinesstatus.deletedsstatus.ignoredsstatus.modifiedsstatus.removedsmagenta bold underlinesstatus.unknownstags.normals
tags.localcCst}|jdr(t}|d }nt|\}}|rKtj|S|rjtjtjd|Stjtjd|SdS(s%Helper function for render_effects().t_backgroundiR)R(N(R"tendswithtTrueR*R-R0ttparm(teffecttbgtattrR&((s//usr/lib/python2.7/dist-packages/hgext/color.pyt_effect_strs

cCs|s
|Stsrgdg|jD]}tt|^q$}ddj|d}dttdd}n2djddg|jD}td}dj|||gS(s-Wrap text in commands to turn on each effect.R
s;tmtcss|]}t|VqdS(N(R\(R$RY((s//usr/lib/python2.7/dist-packages/hgext/color.pys	<genexpr>3s(R*tsplittstrREtjoinR\(ttextteffectsR4tstarttstop((s//usr/lib/python2.7/dist-packages/hgext/color.pytrender_effects*s0cCs:x3tjD]%\}}tjt|diq
WdS(Nt
colortable(Rt_stylesR+tgetattr(RCtext((s//usr/lib/python2.7/dist-packages/hgext/color.pyt	extstyles8scCsKt}tr"|tkr"t}n%|tks>|d tkrGt}n|S(s(Determine if the effect is valid or not.i(R"R*RERW(RYtgood((s//usr/lib/python2.7/dist-packages/hgext/color.pytvalideffect<s		cCsx|jdD]\}}d|ks|jdr=qn|jd|}|rg}xG|D]?}t|r|j|qb|jtd||fqbWdj|t|<qqWdS(NR't.scolor.s:ignoring unknown color/effect %r (configured in color.%s)
t (	R,R!t
configlistRntappendR2RRbRi(Rtstatust
cfgeffectsRmR4((s//usr/lib/python2.7/dist-packages/hgext/color.pytconfigstylesEs
tcoloruicBs5eZedZdZdZdZdZRS(cs~jdkr%ttj|Sjj|r^djfdjjDSdjdjjDS(NR_c3s'|]\}}j||VqdS(N(tlabel(R$taRw(tself(s//usr/lib/python2.7/dist-packages/hgext/color.pys	<genexpr>\scss|]\}}|VqdS(N((R$RxRw((s//usr/lib/python2.7/dist-packages/hgext/color.pys	<genexpr>^s(	t
_colormodeR=tsuperRvt	popbuffert
_bufferstatestpopRbt_buffers(Rytlabeled((Rys//usr/lib/python2.7/dist-packages/hgext/color.pyR|Vs
R;cOs|jdkr(tt|j||S|jdd}|jry|jdjg|D]}t||f^qWn}|jdkrxk|D]"}t	|tt|j|qWn>tt|jg|D]}|j
t||^q|SdS(NRwR_iR:(RzR=R{RvtwriteR@RtextendRat
win32printRw(RytargstoptsRwRx((s//usr/lib/python2.7/dist-packages/hgext/color.pyRas	6
#cOs|jdkr(tt|j||S|jdd}|jr`|jdr`|j||S|jdkrxk|D]"}t|tt|j|qvWn>tt|jg|D]}|j	t
||^q|SdS(NRwR_iR:(RzR=R{Rvt	write_errR@R}RRRwRa(RyRRRwRx((s//usr/lib/python2.7/dist-packages/hgext/color.pyRos
#cCs|jdkr(tt|j||Sg}xX|jD]J}tj|d}|ri|j|q;t	|r;|j|q;q;Wdj
|}|rdj
g|jdD]}t||^qS|S(NR_Rps
(RzR=R{RvRwR`RiR@RrRnRbRg(RytmsgRwRdtlts((s//usr/lib/python2.7/dist-packages/hgext/color.pyRw}s	)(t__name__t
__module__R"R|RzRRRw(((s//usr/lib/python2.7/dist-packages/hgext/color.pyRvUs

		cCst|dkr*tjtdn|jtgtD]}||f^q:tj|d||}|j	dd}t
|tr|Stj|d||}tj|}tj|}|j
j||S(Nislabel expects two argumentsitrepoR_i(tlenRt
ParseErrorRR+tdictRERt_evalifliteralR@t
isinstanceRat	stringifyRRw(tcontexttmappingRtktthingRRw((s//usr/lib/python2.7/dist-packages/hgext/color.pyt
templatelabels,cCsg|jrdSt|ts:|jft_t|_nd}tjtd|tt	j
d<dS(NcSsIt||d}|t_|r6tt|n|||||S(NR'(RIRvRzRlRu(torigtui_RtcmdtcmdfuncR3((s//usr/lib/python2.7/dist-packages/hgext/color.pytcolorcmds	
t_runcommandRw(tplainRRvt	__class__t	__bases__RtwrapfunctionRRRtfuncs(RR((s//usr/lib/python2.7/dist-packages/hgext/color.pytuisetups	cCs/tjjdddtdtdfdS(NR_R'Rs2when to colorize (boolean, always, auto, or never)tTYPE(Rt
globaloptsRrR(R((s//usr/lib/python2.7/dist-packages/hgext/color.pytextsetups			t
debugcolors
hg debugcolorcKsiaxtjD]}|t|<qW|jd|j|jtdx1tjD]#\}}|jd|d|q[WdS(Nscolor mode: %s
savailable colors:
s%s
Rw(RiREtkeysRRzRR/(RRRRYRwtcolors((s//usr/lib/python2.7/dist-packages/hgext/color.pyRsR9t_COORDcBs&eZdejfdejfgZRS(tXtY(RRtctypestc_shortt_fields_(((s//usr/lib/python2.7/dist-packages/hgext/color.pyRst_SMALL_RECTcBs>eZdejfdejfdejfdejfgZRS(tLefttToptRighttBottom(RRRRR(((s//usr/lib/python2.7/dist-packages/hgext/color.pyRst_CONSOLE_SCREEN_BUFFER_INFOcBs;eZdefdefdefdefdefgZRS(tdwSizetdwCursorPositiontwAttributestsrWindowtdwMaximumWindowSize(RRRt_WORDRR(((s//usr/lib/python2.7/dist-packages/hgext/color.pyRs
				lliiii@ii@iitbold_backgrounds\[([^m]*)m([^]*)(.*)cKse|jdd}t}d}xh|jD]Z}tj|d}x?|jD]1}y|t||}WqStk
rqSXqSWq.W|jdsd|}ntjt	|}	zx|	rKx>|	j
djdD]$}
|
r|t|
|}qqWtj
t|||	j
d|tjt	|	j
d	}	qWWdtj
ttXdS(
NRwR_cSsT|dkrtS|tkr$||BS|dkr@|d@|d@BS|d@|d@BSdS(Niiipiii(torigattrtpassthrough(R&R[((s//usr/lib/python2.7/dist-packages/hgext/color.pytmapcolor'ssiR]ii(R@RR`RiRDtKeyErrorR!tretmatchtansiretgroupR#t	_kernel32tSetConsoleTextAttributetstdout(RcRRRwR[RRtstyleRYR^tsattr((s//usr/lib/python2.7/dist-packages/hgext/color.pyR#s,	

	#(Ut__doc__R>t	mercurialRRRRRtuimodRRRtmercurial.i18nRtcmdtabletcommandt
testedwithRER6RIR-RWR"tCOLOR_BLACKt	COLOR_REDtCOLOR_GREENtCOLOR_YELLOWt
COLOR_BLUEt
COLOR_MAGENTAt
COLOR_CYANtCOLOR_WHITER*tImportErrorRiR\RgRlRnRuRvRRRRRCR=RDRRtwindlltkernel32Rtc_ushortRt_INVALID_HANDLE_VALUEt	StructureRRRt_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_UNDERSCOREtsetRtGetStdHandleRtcsbitGetConsoleScreenBufferInfotbyrefRRtcompilet	MULTILINEtDOTALLRR(((s//usr/lib/python2.7/dist-packages/hgext/color.pyt<module>ns0.&#	%	,












						9					
						

Copyright © 2017 || Recoded By Mr.Bumblebee