Your IP : 18.118.126.69


Current Path : /opt/alt/python33/lib/python3.3/site-packages/pip/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib/python3.3/site-packages/pip/__pycache__/log.cpython-33.pyc

�
7�Re�$c@s�dZddlZddlZddlZddlmZddlmZmZdd�Z	ej
ejfdd�Zd	d
�Z
Gdd�de�Ze�ZdS(
uLogging
iN(ubackwardcompat(ucoloramau
pkg_resourcescs�fdd�}|S(Ncs#djt��|tjjg�S(Nu(ujoinulistucoloramauStyleu	RESET_ALL(uinp(ucolors(u /tmp/pip-zej_zi-build/pip/log.pyuwrapped
su_color_wrap.<locals>.wrapped((ucolorsuwrapped((ucolorsu /tmp/pip-zej_zi-build/pip/log.pyu_color_wrapsu_color_wrapcCsmt|tj�s|n|j}||kr1dSt|d�rP|j�rPdS|jd�dkridSdS(NuisattyuTERMuANSIFT(	u
isinstanceucoloramauAnsiToWin32uwrappeduFalseuhasattruisattyuTrueuget(uconsumeruenvironustdu
real_consumer((u /tmp/pip-zej_zi-build/pip/log.pyushould_colors	ushould_colorcCs�dj|jd�dd��}dj|jd�dd��}|jd�\}}tt|�d�}dj||g�}tj|�tj|�kS(Nu.ii(ujoinusplitustruintu
pkg_resourcesu
parse_version(ucurrent_versionuremoval_versionumajoruminoruwarn_version((u /tmp/pip-zej_zi-build/pip/log.pyushould_warn&s""ushould_warncBs�|EeZdZdZejdZejZejZejejdZ	ejZZ
ejZejZeeee	eeegZ
ieejj�e6eejj�e6eejj�e6Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zddd�Z d+dd �Z"d!d"�Z#d#d$�Z$d%d&�Z%e&d'd(��Z'd)d*�Z(d+S(,uLoggeru�
    Logging object for use in command-line script.  Allows ranges of
    levels, to avoid some redundancy of displayed information.
    iicCs1g|_d|_d|_d|_d|_dS(NiF(u	consumersuindentuFalseuexplicit_levelsuNoneuin_progressuin_progress_hanging(uself((u /tmp/pip-zej_zi-build/pip/log.pyu__init__Ls
				uLogger.__init__cGs�tjjd�rsxn|D]S\}}t|d�rV|jj|tj|�f�q|jj||f�qWn|jj|�dS(Nuwinuwrite(	usysuplatformu
startswithuhasattru	consumersuappenducoloramauAnsiToWin32uextend(uselfu	consumersuleveluconsumer((u /tmp/pip-zej_zi-build/pip/log.pyu
add_consumersSs	uLogger.add_consumerscOs|j|j|||�dS(N(uloguDEBUG(uselfumsguargsukw((u /tmp/pip-zej_zi-build/pip/log.pyudebug_suLogger.debugcOs|j|j|||�dS(N(uloguINFO(uselfumsguargsukw((u /tmp/pip-zej_zi-build/pip/log.pyuinfobsuLogger.infocOs|j|j|||�dS(N(uloguNOTIFY(uselfumsguargsukw((u /tmp/pip-zej_zi-build/pip/log.pyunotifyesu
Logger.notifycOs|j|j|||�dS(N(uloguWARN(uselfumsguargsukw((u /tmp/pip-zej_zi-build/pip/log.pyuwarnhsuLogger.warncOs|j|j|||�dS(N(uloguERROR(uselfumsguargsukw((u /tmp/pip-zej_zi-build/pip/log.pyuerrorksuLogger.errorcOs|j|j|||�dS(N(uloguFATAL(uselfumsguargsukw((u /tmp/pip-zej_zi-build/pip/log.pyufatalnsuLogger.fatalcOsLddlm}t||�r5|j|||�n|j|||�dS(u�
        Logs deprecation message which is log level WARN if the
        ``removal_version`` is > 1 minor release away and log level ERROR
        otherwise.

        removal_version should be the version that the deprecated feature is
        expected to be removed in, so something that will not exist in
        version 1.7, but will in 1.6 would have a removal_version of 1.7.
        i(u__version__N(upipu__version__ushould_warnuwarnuerror(uselfuremoval_versionumsguargsukwargsu__version__((u /tmp/pip-zej_zi-build/pip/log.pyu
deprecatedqs
uLogger.deprecatedc
Osx|r|rtd��qn|p'|}|r=||}n|}d|j|}|jrpd||f}nx|jD]�\}}|j||�rz|jr�|tjtjfkr�d	|_tjj
d�tjj�nt|d�rc|d}t
|tj�r7|jj|dd��}	|	|�}n|j
|�t|d�rm|j�qmqp||�qzqzWdS(
Nu6You may give positional or keyword arguments, not bothu u%02i %su
uwritecSs|S(N((ux((u /tmp/pip-zej_zi-build/pip/log.pyu<lambda>�suLogger.log.<locals>.<lambda>uflushF(u	TypeErroruindentuexplicit_levelsu	consumersu
level_matchesuin_progress_hangingusysustdoutustderruFalseuwriteuflushuhasattrushould_coloruosuenvironuCOLORSuget(
uselfulevelumsguargsukwurendereduconsumer_leveluconsumeru
write_contentu	colorizer((u /tmp/pip-zej_zi-build/pip/log.pyulog�s6
			

u
Logger.logcCs|j|j�otjj�S(u$Should we display download progress?(ustdout_level_matchesuNOTIFYusysustdoutuisatty(uself((u /tmp/pip-zej_zi-build/pip/log.pyu_show_progress�suLogger._show_progresscCs�|js#td||jf��|j�rctjjd|j|�tjj�d|_	n	d|_	||_d|_dS(Nu0Tried to start_progress(%r) while in_progress %ru TF(
uin_progressuAssertionErroru_show_progressusysustdoutuwriteuindentuflushuTrueuin_progress_hanginguFalseuNoneulast_message(uselfumsg((u /tmp/pip-zej_zi-build/pip/log.pyustart_progress�s

		uLogger.start_progressudone.cCs�|jstd��|j�r�|jsYtjjd|j|d�tjj�q�tj	d�tj	d�tjj|d�tjj�nd|_d|_dS(Nu,Tried to end_progress without start_progressu...u
uF(uin_progressuAssertionErroru_show_progressuin_progress_hangingusysustdoutuwriteuflushuloggeru
show_progressuNoneuFalse(uselfumsg((u /tmp/pip-zej_zi-build/pip/log.pyuend_progress�s		

	uLogger.end_progresscCs�|jr�|dkr5tjjd�tjj�q�|jrgdtdt|j�t|��}nd}tjjdd|j	|j
||f�tjj�||_ndS(uaIf we are in a progress scope, and no log messages have been
        shown, write out another '.'u.u iuu	
%s%s%s%sN(uin_progress_hanginguNoneusysustdoutuwriteuflushulast_messageumaxulenuindentuin_progress(uselfumessageupadding((u /tmp/pip-zej_zi-build/pip/log.pyu
show_progress�s		)
uLogger.show_progresscCs|j||j��S(u9Returns true if a message at this level will go to stdout(u
level_matchesu
_stdout_level(uselfulevel((u /tmp/pip-zej_zi-build/pip/log.pyustdout_level_matches�suLogger.stdout_level_matchescCs4x*|jD]\}}|tjkr
|Sq
W|jS(u%Returns the level that stdout runs at(u	consumersusysustdoutuFATAL(uselfuleveluconsumer((u /tmp/pip-zej_zi-build/pip/log.pyu
_stdout_level�suLogger._stdout_levelcCslt|t�r^|j|j}}|dk	r>||kr>dS|dk	sV||krZdSdS||kSdS(um
        >>> l = Logger()
        >>> l.level_matches(3, 4)
        False
        >>> l.level_matches(3, 2)
        True
        >>> l.level_matches(slice(None, 3), 3)
        False
        >>> l.level_matches(slice(None, 3), 2)
        True
        >>> l.level_matches(slice(1, 3), 1)
        True
        >>> l.level_matches(slice(2, 3), 1)
        False
        NFT(u
isinstanceusliceustartustopuNoneuFalseuTrue(uselfuleveluconsumer_levelustartustop((u /tmp/pip-zej_zi-build/pip/log.pyu
level_matches�suLogger.level_matchescCs?|j}|dkr|dS|t|�kr7|dS||S(Niii����(uLEVELSulen(uclsulevelulevels((u /tmp/pip-zej_zi-build/pip/log.pyulevel_for_integers	uLogger.level_for_integercCs�g}g}xR|jD]G\}}|tjkr|j||f�|j|tjf�qqWx|D]}|jj|�qhW|jj|�dS(N(u	consumersusysustdoutuappendustderruremoveuextend(uselfu	to_removeuto_adduconsumer_leveluconsumeruitem((u /tmp/pip-zej_zi-build/pip/log.pyumove_stdout_to_stderr	s
uLogger.move_stdout_to_stderrN()u__name__u
__module__u__qualname__u__doc__ulogginguDEBUGu
VERBOSE_DEBUGuINFOuWARNuNOTIFYuWARNINGuERRORuFATALuLEVELSu_color_wrapucoloramauForeuYELLOWuREDuCOLORSu__init__u
add_consumersudebuguinfounotifyuwarnuerrorufatalu
deprecatedulogu_show_progressustart_progressuend_progressuNoneu
show_progressustdout_level_matchesu
_stdout_levelu
level_matchesuclassmethodulevel_for_integerumove_stdout_to_stderr(u
__locals__((u /tmp/pip-zej_zi-build/pip/log.pyuLogger7s@
		
		&
	uLogger(u__doc__usysuosuloggingupipubackwardcompatupip._vendorucoloramau
pkg_resourcesu_color_wrapustdoutustderrushould_colorushould_warnuobjectuLoggerulogger(((u /tmp/pip-zej_zi-build/pip/log.pyu<module>s�

?>