Your IP : 216.73.216.213


Current Path : /opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pyc

�
��Wc@s�ddlZyddlmZWn!ek
rCddlmZnXd�Zdefd��YZd�Zd�Z	d	e
fd
��YZd�Zd�Z
dS(
i����N(tUnknownMessage(tUnknownMessageErrorcCs_|jd�}t|�}x*|jd�dD]}t||�}q/Wt||d�}|S(Nt.ii(tsplitt
__import__tgetattr(tmodule_nametklstpartstmtmptklass((sM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pyt	get_classst
NoSuchCheckercBseZd�Zd�ZRS(cCsd||_dS(NsChecker class %s was not found(tmessage(tselft
checker_class((sM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pyt__init__scCs|jS(N(R(R((sM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pyt__repr__s(t__name__t
__module__RR(((sM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pyR
s	cCs:x'|j�D]}t||�r
|Sq
Wt|��dS(N(tget_checkerst
isinstanceR
(tlinterRtchecker((sM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pytget_checkerscs�tjddkr(t||j�}nKyt||jj�}Wn/tk
rrt|t|j|j	��}nXt
||j����fd�}t||j|�dS(s�
    Augmenting a visit enables additional errors to be raised (although that case is
    better served using a new checker) or to suppress all warnings in certain circumstances.

    Augmenting functions should accept a 'chain' function, which runs the checker method
    and possibly any other augmentations, and secondly an Astroid node. "chain()" can be
    called at any point to trigger the continuation of other checks, or not at all to
    prevent any further checking.
    iics#��fd�}�|��dS(Ncs���dS(N(((tnodet
old_method(sM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pytchain7s((RR(taugmentationR(RsM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pytaugment_func6sN(
tsystversion_infoRtim_classt__self__t	__class__tAttributeErrorRRt__qualname__RRtsetattr(Rtchecker_methodRRR((RRsM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pyt
augment_visit!s
"tSuppresscBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCs||_g|_g|_dS(N(t_lintert	_suppresst_messages_to_append(RR((sM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pyR@s		cCs"|jj|_|j|j_|S(N(R*tadd_messaget_orig_add_message(R((sM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pyt	__enter__EscOs|jj||f�dS(N(R,tappend(Rtargstkwargs((sM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pyR-JscGs%x|D]}|jj|�qWdS(N(R+R0(Rtsymbolstsymbol((sM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pytsuppressMs
cCs�|j|j_xp|jD]e\}}td|d�rH|dj}n
|d}|d|jkrkqn|jj||�qWdS(NR4i(R.R*R-R,thasattrR4R+(Rtexc_typetexc_valtexc_tbtto_append_argstto_append_kwargstcode((sM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pyt__exit__Qs
(RRRR/R-R5R=(((sM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pyR)>s
				cCs/ddl}|jdt�t||||�S(Ni����s['supress_message' has been deprecated in favour of the correctly-spelled 'suppress_message'(twarningstwarntDeprecationWarningtsuppress_message(RR't
message_idt	test_funcR>((sM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pytsupress_message`s	cs�t�d��}yD|j|�}g|j|jfD]}|dk	r7|^q7�Wntk
rr|g�nX���fd�}t�||�dS(s�
    This wrapper allows the suppression of a message if the supplied test function
    returns True. It is useful to prevent one particular message from being raised
    in one particular case, while leaving the rest of the messages intact.
    t
msgs_storecs<t���*}�|�r+|j��n|�WdQXdS(N(R)R5(RRts(RR3RC(sM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pytdo_suppress~sN(Rtcheck_message_idtmsgidR4tNoneRR((RR'tmessage_id_or_symbolRCREtpylint_messageRFRG((RR3RCsM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pyRAgs5

(Rtpylint.utilsRtImportErrorRRt	ExceptionR
RR(tobjectR)RDRA(((sM/opt/alt/python27/lib/python2.7/site-packages/pylint_plugin_utils/__init__.pyt<module>s
					"