Ñò §ÚêLc@sOdZddkZddkZddkZddklZddklZddkZddd„ƒYZ d„Z d„Z e d joÃd „Z dd „Zd „Zd „Zd„Zdd„Zd„Zdefd„ƒYZd„ZeƒZe eeeeeeeei eieieieieieifZeeƒ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(t HyperParsertCallTipscBszeZdd gfgZdd„Zd„Zd„Zdd„Zd„Zd„Z d „Z d „Z d „Z d „Z RS(tedits Show call tips<>cCsI|djod|_dS||_|i|_d|_|i|_dS(N(tNoneteditwinttexttcalltipt_make_tk_calltip_windowt_make_calltip_window(tselfR((s(/usr/lib64/python2.6/idlelib/CallTips.pyt__init__s     cCs d|_dS(N(RR (R ((s(/usr/lib64/python2.6/idlelib/CallTips.pytclose"scCsti|iƒS(N(RtCallTipR(R ((s(/usr/lib64/python2.6/idlelib/CallTips.pyR%scCs(|io|iiƒd|_ndS(N(RthidetipR(R tevent((s(/usr/lib64/python2.6/idlelib/CallTips.pyt_remove_calltip_window)s  cCs|itƒ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.6/idlelib/CallTips.pytforce_open_calltip_event.scCs|itƒ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.6/idlelib/CallTips.pyttry_open_calltip_event4scCs/|io!|iiƒo|itƒ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.6/idlelib/CallTips.pytrefresh_calltip_event;scCsË|iƒt|idƒ}|idƒ}|pdS|i|dƒ|iƒ}| p| o|idƒdjodS|i|ƒ}|pdS|iƒ|_ |i i ||d|dƒdS(Ntinsertt(iiÿÿÿÿi( RRRtget_surrounding_bracketst set_indextget_expressiontfindt fetch_tipR Rtshowtip(R t evalfuncsthpt sur_parentnametarg_text((s(/usr/lib64/python2.6/idlelib/CallTips.pyRBs  &cCsgy|iiiii}Wn d}nX|o|idd|fhƒS|i|ƒ}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( RtflisttpyshelltinterptrpccltRt remotecallt get_entityt get_arg_text(R R#R*tentity((s(/usr/lib64/python2.6/idlelib/CallTips.pyRSs  cCs\|oQtiiƒ}|itiƒyt||ƒSWqXttfj odSXndS(sALookup name in a namespace spanning sys.modules and __main.dict__N( tsystmodulestcopytupdatet__main__t__dict__tevalt NameErrortAttributeErrorR(R R#t namespace((s(/usr/lib64/python2.6/idlelib/CallTips.pyR,ls(s Show call tips<>N(t__name__t __module__tmenudefsRR R RRRRRRRR,(((s(/usr/lib64/python2.6/idlelib/CallTips.pyRs        cCsZy|iiSWnEtj o9x4|iD]$}t|ƒ}|dj o|Sq)WnXdS(N(R tim_funcR7t __bases__t_find_constructorR(tclass_obtbasetrc((s(/usr/lib64/python2.6/idlelib/CallTips.pyR>vs   c Cs*d}|dj od}t|ƒtitifjo0t|ƒ}|djo d„}q—d}n0t|ƒtijo|i}d}n|}t|ƒtiti gjoí|i i }|i i ||!}|i pg}ttd„|ƒƒ}dgt|ƒt|ƒ|}td„||ƒ}|i id@o|idƒn|i id @o|id ƒnd i|ƒ}d tid d|ƒ}nt|ddƒ}|of|iƒ}|idƒ} | djp | djo d} n|o|d7}n||| 7}q&n|S(s:Get a string describing the arguments for the given objectticSsdS(N(R(((s(/usr/lib64/python2.6/idlelib/CallTips.pytŠsicSsdt|ƒS(s=%s(trepr(R#((s(/usr/lib64/python2.6/idlelib/CallTips.pyRC™scSs||S(((targtdflt((s(/usr/lib64/python2.6/idlelib/CallTips.pyRC›sis...is***s, s(%s)s\.\d+st__doc__s iFN(Rttypettypest ClassTypetTypeTypeR>t MethodTypeR<t FunctionTypet LambdaTypet func_codet co_argcountt co_varnamest func_defaultstlisttmaptlentco_flagstappendtjointretsubtgetattrtlstripR( tobR$t arg_offsettfobtargcountt real_argstdefaultstitemstdoctpos((s(/usr/lib64/python2.6/idlelib/CallTips.pyR-sF        !  R3cCsdS(s()N((((s(/usr/lib64/python2.6/idlelib/CallTips.pytt1´scCsdS(s (a, b=None)N((tatb((s(/usr/lib64/python2.6/idlelib/CallTips.pytt2µscGsdS(s(a, ...)N((Rgtargs((s(/usr/lib64/python2.6/idlelib/CallTips.pytt3¶scGsdS(s(...)N((Rj((s(/usr/lib64/python2.6/idlelib/CallTips.pytt4·scGsdS(s(a, ...)N((RgRj((s(/usr/lib64/python2.6/idlelib/CallTips.pytt5¸scOsdS(s(a, b=None, ..., ***)N((RgRhRjtkw((s(/usr/lib64/python2.6/idlelib/CallTips.pytt6¹scCs|\}}|\}}dS(s(, c, )N((t.0tct.2RgRhtdte((s(/usr/lib64/python2.6/idlelib/CallTips.pytt7ºstTCcBs_eZdZd d„Zd„Zd d„Zd„Zd„Zd„Z d d„Z d„Z RS( s(ai=None, ...)cGsdS(s(ai=None, ...)N((R taiRh((s(/usr/lib64/python2.6/idlelib/CallTips.pyR ¾scCsdS(s()N((R ((s(/usr/lib64/python2.6/idlelib/CallTips.pyRf¿scCsdS(s (ai, b=None)N((R RwRh((s(/usr/lib64/python2.6/idlelib/CallTips.pyRiÀscGsdS(s (ai, ...)N((R RwRj((s(/usr/lib64/python2.6/idlelib/CallTips.pyRkÁscGsdS(s(...)N((R Rj((s(/usr/lib64/python2.6/idlelib/CallTips.pyRlÂscGsdS(s (ai, ...)N((R RwRj((s(/usr/lib64/python2.6/idlelib/CallTips.pyRmÃscOsdS(s(ai, b=None, ..., ***)N((R RwRhRjRn((s(/usr/lib64/python2.6/idlelib/CallTips.pyRoÄscCs|\}}|\}}dS(s(, c, )N((R t.1Rqt.3RwRhRsRt((s(/usr/lib64/python2.6/idlelib/CallTips.pyRuÅsN( R9R:RGRR RfRiRkRlRmRoRu(((s(/usr/lib64/python2.6/idlelib/CallTips.pyRv¼s       c Csàtƒ}g}x¯|D]§}|id|i}|i}yd|ii|f}Wntj o |}nX|i|ƒ}||jo2|i|ƒd}||i|t|ƒfGHqqWdt|ƒt|ƒfGHdS(Ns s%s.%ss%s - expected %s, but got %ss%d of %d tests failed( RRGR9tim_classR7RRWR-RU( tteststcttfailedtttexpectedR#tqualified_nameR$tfmt((s(/usr/lib64/python2.6/idlelib/CallTips.pyttestÇs      #((RGRYR/RItidlelibRtidlelib.HyperParserRR3RR>R-R9RfRRiRkRlRmRoRutobjectRvR‚ttcR{(((s(/usr/lib64/python2.6/idlelib/CallTips.pyts.    e 1          3