%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python3.8/idlelib/__pycache__/
Upload File :
Create Path :
Current File : //usr/local/lib/python3.8/idlelib/__pycache__/calltip.cpython-38.pyc

U

qac@sdZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
GdddZddZd	Z
d
ZdZedZd
ZdZddZedkrddlmZeddddS)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)HyperParserc@sXeZdZdddZddZddZddd	Zd
dZdd
ZddZ	ddZ
ddZdS)CalltipNcCs0|dkrd|_n||_|j|_d|_|j|_dSN)editwintextactive_calltip_make_tk_calltip_window_calltip_window)selfrr+/usr/local/lib/python3.8/idlelib/calltip.py__init__szCalltip.__init__cCs
d|_dSr)r
rrrr
closesz
Calltip.closecCst|jSr)rZ
CalltipWindowrrrrr
r	 szCalltip._make_tk_calltip_windowcCs|jr|jd|_dSr)rZhidetipreventrrr
remove_calltip_window$s
zCalltip.remove_calltip_windowcCs|ddS)z9The user selected the menu entry or hotkey, open the tip.Tbreakopen_calltiprrrr
force_open_calltip_event)s
z Calltip.force_open_calltip_eventcCs|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.
        FNrrrrr
try_open_calltip_event.szCalltip.try_open_calltip_eventcCs|jr|jjr|ddS)NF)rZ	tipwindowrrrrr
refresh_calltip_event5szCalltip.refresh_calltip_eventcCst|jd}|d}|s&|dS|jr`tt|dd\}}||f|jj|jj	fkr`dS|
|dz|}Wntk
rd}YnX|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.)rrZget_surrounding_bracketsrrmapintsplitZ	parenlineZparencolZ	set_indexZget_expression
ValueErrorfind	fetch_tipr
Zshowtip)rZ	evalfuncsZhpZ	sur_parenZopener_lineZ
opener_col
expressionargspecrrr
r9s6



zCalltip.open_calltipcCsRz|jjjjj}Wntk
r*d}YnX|rB|dd|fiStt|SdS)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.

        NexecZget_the_calltip)	rflistZpyshellZinterprpccltAttributeErrorZ
remotecallget_argspec
get_entity)rr%r)rrr
r$ls
zCalltip.fetch_tip)N)N)__name__
__module____qualname__rrr	rrrrrr$rrrr
rs
	
3rcCs8|r4tjtj}zt||WStk
r2YdSXdS)zwReturn the object corresponding to expression evaluated
    in a namespace spanning sys.modules and __main.dict__.
    N)sysmodules__main____dict__eval
BaseException)r%	namespacerrr
r,sr,Uz    z(?<=\()\w*\,?\s*zSee source or doczinvalid method signaturec	
CsLz
|j}Wntk
r YdSXt|tjr2|n|}ztt|}WnDtk
r}z&t|}|	t
rxt
WY
Sd}W5d}~XYnXt|tr|dkrt}t
|tkrtj|ttdn|r|gng}t|}|r8|dtdtD]D}|}|s
q8t
|tkr,|dtdd}||qd|}|pJtS)aReturn 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.
    Nz())subsequent_indent
z...)__call__r5
isinstancetypes
MethodTypestrinspectZ	signature	Exception
startswith_invalid_methodtype_default_callable_argspeclen	_MAX_COLStextwrapwrap_INDENTZgetdocr!
_MAX_LINESstripappendjoin)	obZob_callZfobr&errmsglinesdoclinerrr
r+s:





r+r2)mainzidlelib.idle_test.test_calltip)	verbosity)__doc__r2rBrer0rJr?ZidlelibrZidlelib.hyperparserrrr,rIrMrLcompileZ_first_paramrGrEr+r-ZunittestrWrrrr
<module>s(s
1

Zerion Mini Shell 1.0