a  zec@sddlZddlZddlZddlZddlZddlZddlmZddlm Z GdddZ ddZ dZ d Z d Zed Zd Zd ZddZedkrddlmZeddddS)N) calltip_w) HyperParserc@sXeZdZdddZddZddZddd Zd d Zd d ZddZ ddZ ddZ dS)CalltipNcCs0|durd|_n||_|j|_d|_|j|_dSN)editwintextactive_calltip_make_tk_calltip_window_calltip_window)selfrr C/opt/bitninja-python-dojo/embedded/lib/python3.9/idlelib/calltip.py__init__s zCalltip.__init__cCs d|_dSr)r r r r r closesz Calltip.closecCs t|jSr)rZ CalltipWindowrrr r r r szCalltip._make_tk_calltip_windowcCs|jr|jd|_dSr)rZhidetipr eventr r r remove_calltip_window$s zCalltip.remove_calltip_windowcCs|ddS)NTbreak open_calltiprr r r force_open_calltip_event)s z Calltip.force_open_calltip_eventcCs|ddSNFrrr r r try_open_calltip_event.szCalltip.try_open_calltip_eventcCs|jr|jjr|ddSr)rZ tipwindowrrr r r refresh_calltip_event5szCalltip.refresh_calltip_eventcCst|jd}|d}|s&|dS|jr`tt|dd\}}||f|jj|jj fkr`dS| |dz | }Wnt yd}Yn0|sdS||s| ddkrdS||}|sdS||_|j||d|ddS)Ninsert(r.)rrZget_surrounding_bracketsrrmapintsplitZ parenlineZparencolZ set_indexZget_expression ValueErrorfind fetch_tipr Zshowtip)r Z evalfuncsZhpZ sur_parenZ opener_lineZ opener_col expressionargspecr r r r9s6       zCalltip.open_calltipcCsPz|jjjjj}Wnty(d}Yn0|r@|dd|fiStt|SdS)NexecZget_the_calltip) rflistZpyshellZinterprpccltAttributeErrorZ remotecall get_argspec get_entity)r r&r*r r r r%ls  zCalltip.fetch_tip)N)N) __name__ __module__ __qualname__rrr rrrrrr%r r r r rs  3rcCs:|r6itjtj}z t||WSty4YdS0dSr)sysmodules__main____dict__eval BaseException)r& namespacer r r r-s   r-Uz z(?<=\()\w*\,?\s*zSee source or doczinvalid method signaturec CsPz |j}WntyYdS0t|tjr0|n|}ztt|}WnJty}z2t|}| t rxt WYd}~Sd}WYd}~n d}~00t|t r|dkrt }t |tkrtj|ttdn |r|gng}t|}|r<|dtdtD]D}|}|sqs&  s 1