\dcdZddlZddlZddlZddlZddlZddlZddlmZddl m Z GddZ dZ dZ d Zd Zejd Zd Zd ZdZedkrddlmZedddSdS)zPop up a reminder of how to call a function. 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. N) calltip_w) HyperParsercHeZdZd dZdZdZd dZdZdZdZ d Z d Z dS) CalltipNch| d|_dS||_|j|_d|_|j|_dSN)editwintextactive_calltip_make_tk_calltip_window_calltip_window)selfr s ..\python\lib\idlelib\calltip.py__init__zCalltip.__init__s; ?DLLL"DL DI"&D #'#?D cd|_dSr)r rs rclosez Calltip.closes#rc4tj|jSr)r CalltipWindowr rs rr zCalltip._make_tk_calltip_window s&ty111rcX|jr"|jd|_dSdSr)r hidetiprevents rremove_calltip_windowzCalltip.remove_calltip_window$s:   '   ' ' ) ) )"&D    ' 'rc0|ddS)z9The user selected the menu entry or hotkey, open the tip.Tbreak open_calltiprs rforce_open_calltip_eventz Calltip.force_open_calltip_event)s $wrc0|ddS)zHappens 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. FNrrs rtry_open_calltip_eventzCalltip.try_open_calltip_event.s %     rc^|jr#|jjr|ddSdSdS)NF)r tipwindowrrs rrefresh_calltip_eventzCalltip.refresh_calltip_event5sH   %4#6#@ %   e $ $ $ $ $ % % % %rct|jd}|d}|s|dS|jrQt t |dd\}}||f|jj|jj fkrdS| |d | }n#t$rd}YnwxYw|sdS||s| ddkrdS||}|sdS||_|j||d|ddS)zMaybe close an existing calltip and maybe open a new calltip. Called from (force_open|try_open|refresh)_calltip_event functions. insert(Nr.)rr get_surrounding_bracketsrr mapintsplit parenlineparencol set_indexget_expression ValueErrorfind fetch_tipr showtip)r evalfuncshp sur_paren opener_line opener_col expressionargspecs rrzCalltip.open_calltip9s x 0 0//44    & & ( ( ( F   &)#y|/A/A#/F/F&G&G #Kj)$.0C0LMNN Yq\""" **,,JJ   JJJ   F ""$$$ jooc22b88 F..,,  F"2244 ##GYq\9Q<HHHHHs7C CCc |jjjjj}n#t $rd}YnwxYw|r|dd|fiStt|S)aDReturn the argument list and docstring of a function or class. If there is a Python subprocess, get the calltip there. Otherwise, either this fetch_tip() is running in the subprocess or it was called in an IDLE running without the subprocess. 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. Nexecget_the_calltip) r flistpyshellinterprpccltAttributeError remotecall get_argspec get_entity)rr=rEs rr6zCalltip.fetch_tipls \'/6=FF   FFF   7$$V->&0]B88 8z*5566 6s  --r) __name__ __module__ __qualname__rrr rr r"r%rr6rrrrs@@@@$$$222''''  !!!%%%1I1I1If77777rrc|rerrmsglinesdoclines rrHrHs+ rr )9:: B''Cg',,-- #hh >>/ * * " " " " " " "GGGGGG #t,D+G y((]7I I I I I;B.Jwii  .  C IIdJ//  <  D::<rs,   ++++++p7p7p7p7p7p7p7p7f      rz-.. /,.0.0.0b zD )Q777777r