AlkantarClanX12

Your IP : 18.227.49.73


Current Path : /proc/thread-self/root/lib64/python2.7/idlelib/
Upload File :
Current File : //proc/thread-self/root/lib64/python2.7/idlelib/CallTips.pyo

�
{fc@s�dZddlZddlZddlZddlZddlZddlmZddlm	Z	ddd��YZ
d�ZdZd	Z
dZd�Zed
kr�ddlmZeddd�ndS(sCallTips.py - An IDLE Extension to Jog Your Memory

Call Tips are floating windows which display function, class, and method
parameter and docstring information when you type an opening parenthesis, and
which disappear when you type a closing parenthesis.

i����N(t
CallTipWindow(tHyperParsertCallTipscBszeZdd
gfgZdd�Zd�Zd�Zdd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
RS(tedits
Show call tips<<force-open-calltip>>cCsG|dkrd|_dS||_|j|_d|_|j|_dS(N(tNoneteditwinttexttcalltipt_make_tk_calltip_windowt_make_calltip_window(tselfR((s(/usr/lib64/python2.7/idlelib/CallTips.pyt__init__s			cCs
d|_dS(N(RR	(R
((s(/usr/lib64/python2.7/idlelib/CallTips.pytclose#scCstj|j�S(N(RtCallTipR(R
((s(/usr/lib64/python2.7/idlelib/CallTips.pyR&scCs&|jr"|jj�d|_ndS(N(RthidetipR(R
tevent((s(/usr/lib64/python2.7/idlelib/CallTips.pyt_remove_calltip_window*s	
cCs|jt�dS(siHappens when the user really wants to open a CallTip, even if a
        function call is needed.
        N(topen_calltiptTrue(R
R((s(/usr/lib64/python2.7/idlelib/CallTips.pytforce_open_calltip_event/scCs|jt�dS(s�Happens when it would be nice to open a CallTip, but not really
        necessary, for example after an opening bracket, so function calls
        won't be made.
        N(RtFalse(R
R((s(/usr/lib64/python2.7/idlelib/CallTips.pyttry_open_calltip_event5scCs,|jr(|jj�r(|jt�ndS(siIf there is already a calltip window, check if it is still needed,
        and if so, reload it.
        N(Rt	is_activeRR(R
R((s(/usr/lib64/python2.7/idlelib/CallTips.pytrefresh_calltip_event<scCs�|j�t|jd�}|jd�}|s5dS|j|d�|j�}|su|ry|jd�dkrydS|j|�}|s�dS|j�|_	|j	j
||d|d�dS(Ntinsertt(ii����i(RRRtget_surrounding_bracketst	set_indextget_expressiontfindt	fetch_tipR	Rtshowtip(R
t	evalfuncsthpt	sur_parent
expressiontarg_text((s(/usr/lib64/python2.7/idlelib/CallTips.pyRCs
#cCsoy|jjjjj}Wntk
r2d}nX|rR|jdd|fi�S|j|�}t	|�SdS(sRReturn the argument list and docstring of a function or class

        If there is a Python subprocess, get the calltip there.  Otherwise,
        either fetch_tip() is running in the subprocess itself or it was called
        in an IDLE EditorWindow before any script had been run.

        The subprocess environment is that of the most recently run script.  If
        two unrelated modules are being edited some calltips in the current
        module may be inoperative if the module was not the last to run.

        To find methods, fetch_tip must be fed a fully qualified name.

        texectget_the_calltipN(
RtflisttpyshelltinterptrpcclttAttributeErrorRt
remotecallt
get_entitytget_arg_text(R
R#R*tentity((s(/usr/lib64/python2.7/idlelib/CallTips.pyRTs


cCsR|rNtjj�}|jtj�yt||�SWqNtk
rJdSXndS(sReturn the object corresponding to expression evaluated
        in a namespace spanning sys.modules and __main.dict__.
        N(	tsystmodulestcopytupdatet__main__t__dict__tevalt
BaseExceptionR(R
R#t	namespace((s(/usr/lib64/python2.7/idlelib/CallTips.pyR-ms
(s
Show call tips<<force-open-calltip>>N(t__name__t
__module__tmenudefsRRRRRRRRRRR-(((s(/usr/lib64/python2.7/idlelib/CallTips.pyRs								cCsVy|jjSWnAtk
rQx1|jD]"}t|�}|dk	r(|Sq(WnXdS(N(Rtim_funcR+t	__bases__t_find_constructorR(tclass_obtbasetrc((s(/usr/lib64/python2.7/idlelib/CallTips.pyR>{s
iUit icCsTd}y
|j}Wn3tk
rHt|�tjkrA|}qI|SnXd}t|�tjtjfkr�t|�}|dkr�d�}qd}nft|�tjkr�|j	}|j
dk	rd}qn-t|�tjkr�|j	}d}n|}t|�tjtjgkr^|j
j}|j
j||!}|jpIg}ttd�|��}dgt|�t|�|}td�||�}x�ddfD]�\}	}
}|j
j|	@r�|
|}||kr�|j|�q/d}
x"|d
|
|kr|
d7}
q�W|j|d
|
�q�q�Wdj|�}dtjdd|�}nt|�tkr�tj|tdt�n|r�|gng}t|tj�r�|j}nt|dd�}|rPxh|j dt!�t! D]P}|j"�}|sPnt|�tkr-|td d}n|j|�q�Wdj|�}n|S(s�Return a string describing the signature of a callable object, or ''.

    For Python-coded functions and methods, the first line is introspected.
    Delete 'self' parameter for classes (.__init__) and bound methods.
    The next lines are the first lines of the doc string up to the first
    empty line or _MAX_LINES.    For builtins, this typically includes
    the arguments in addition to the return value.
    ticSsdS(N(R(((s(/usr/lib64/python2.7/idlelib/CallTips.pyt<lambda>�RCicSsdt|�S(Ns=%s(trepr(tname((s(/usr/lib64/python2.7/idlelib/CallTips.pyRD�RCcSs||S(N((targtdflt((s(/usr/lib64/python2.7/idlelib/CallTips.pyRD�RCit*targsis**tkwargss%ss, s(%s)s(?<!\d)\.\d+s<tuple>tsubsequent_indentt__doc__s
is...N(iRIRJ(is**RK(#t__call__R7ttypettypest	ClassTypetTypeTypeR>Rt
MethodTypeR<tim_selftFunctionTypet
LambdaTypet	func_codetco_argcounttco_varnamest
func_defaultstlisttmaptlentco_flagstappendtjointretsubt	_MAX_COLSttextwraptwrapt_INDENTt
isinstanceRMtgetattrtsplitt
_MAX_LINEStstrip(tobtargspectob_callt
arg_offsettfobtargcountt	real_argstdefaultstitemstflagtpreRFtpre_nametitlinestdoctline((s(/usr/lib64/python2.7/idlelib/CallTips.pyR.�sj	

					!
?R4(tmainsidlelib.idle_test.test_calltipst	verbosityi(s    (RMR4RaR0RdRPtidlelibRtidlelib.HyperParserRRR>RcRjRfR.R9tunittestR|(((s(/usr/lib64/python2.7/idlelib/CallTips.pyt<module>s i		N