%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__/pyshell.cpython-38.pyc

U

q©ßa]àã
@sÔddlZedkr ejdejd<zddlTWn*ek
rVedejdedƒ‚YnXejdkržz ddl	Z	dZ
e	 d	¡ e
¡Wnee
efk
rœYnXdd
lmZedkrðeƒat ¡ddlmZetƒejd
detdedƒ‚ddlmZddlZddlZddlZddlmZddlZddlZddlZddl m!Z!ddl"Z"ddl#Z#ddl$Z$ddl%Z%ddl&m'Z'ddl(m)Z)ddl*m+Z+ddl*m,Z,ddl-m.Z.m/Z/ddl0m1Z1ddl2m3Z3ddl*m4Z4ddlm5Z5m6Z6m7Z7ddl8m9Z9dZ:dZ;eja<d;dd„Z=da>d d!„Z?e?d"ƒdej@fd#d$„ZAeAe_@Gd%d&„d&e.ƒZBGd'd(„d(e1ƒZCGd)d*„d*e'ƒZDGd+d,„d,e9ƒZEGd-d.„d.e4jFƒZGd/d0„ZHGd1d2„d2eƒZIGd3d4„d4e3ƒZJd5d6„ZKd7ZLd8d9„ZMedkrÈeMƒe?d:ƒdS)<éNÚ__main__zidlelib.pyshell)Ú*zJ** IDLE can't import Tkinter.
Your Python may not be configured for Tk. **©ÚfileéÚwin32Zshcore)Ú
messageboxg!@©Úfix_scalingzIdle Cannot Startz"Idle requires tcl/tk 8.5+, not %s.©Úparent)ÚInteractiveInterpreter)Úpython_version)ÚTextWrapper)ÚColorDelegator)ÚidleConf©Údebugger)Ú
debugger_r)ÚEditorWindowÚ
fixwordbreaks)ÚFileList)ÚOutputWindow)Úrpc)Úidle_formatwarningÚStdInputFileÚ
StdOutputFile)Ú
UndoDelegatorz	127.0.0.1c	CsP|dkrt}z&| t|||||d¡| d¡Wnttfk
rJYnXdS)aShow Idle-format warning (after replacing warnings.showwarning).

    The differences are the formatter called, the file=None replacement,
    which can be None, the capture of the consequence AttributeError,
    and the output of a hard-coded prompt.
    N)Úlineú>>> )Úwarning_streamÚwriterÚAttributeErrorÚOSError)ÚmessageÚcategoryÚfilenameÚlinenorr©r(ú+/usr/local/lib/python3.8/idlelib/pyshell.pyÚidle_showwarningEsÿr*cCs0|rtdkr,tjatt_ntdk	r,tt_dadS)z>Replace warning.showwarning with idle_showwarning, or reverse.N)Ú_warnings_showwarningÚwarningsÚshowwarningr*)Úcapturer(r(r)Úcapture_warningsXsr/TcCsXtj}i}t|ƒD].}|dd…|dd…dkr| |¡||<q||ƒ| |¡dS)aoExtend linecache.checkcache to preserve the <pyshell#...> entries

    Rather than repeating the linecache code, patch it to save the
    <pyshell#...> entries, call the original linecache.checkcache()
    (skipping them), and then restore the saved entries.

    orig_checkcache is bound at definition time to the original
    method, allowing it to be patched.
    Nréÿÿÿÿú<>)Ú	linecacheÚcacheÚlistÚpopÚupdate)r&Zorig_checkcacher3ÚsaveÚkeyr(r(r)Úextended_linecache_checkcachegsr9c@s~eZdZdZdd„Zdddddd	gZd dd„Zd
d„Zd!dd„Zd"dd„Z	dd„Z
dd„Zdd„Zdd„Z
dd„Zdd„ZdS)#ÚPyShellEditorWindowz6Regular text edit window in IDLE, supports breakpointscGs”g|_tj|f|žŽ|j d|j¡|j d|j¡|j d|jj¡t	j
 tj
d¡|_|jj|fdd„}|j |¡|jjrˆ| ¡| ¡dS)Nú<<set-breakpoint-here>>ú<<clear-breakpoint-here>>z<<open-python-shell>>zbreakpoints.lstcSs| ¡|ƒdS©N)Úrestore_file_breaks)Zold_hookÚselfr(r(r)Úfilename_changed_hookŒsz;PyShellEditorWindow.__init__.<locals>.filename_changed_hook)ÚbreakpointsrÚ__init__ÚtextÚbindÚset_breakpoint_hereÚclear_breakpoint_hereÚflistÚ
open_shellÚosÚpathÚjoinrZuserdirÚbreakpointPathÚioZfilename_change_hookZset_filename_change_hookr&r>Úcolor_breakpoint_text)r?Úargsr@r(r(r)rBs ÿÿ
zPyShellEditorWindow.__init__)ZCutz<<cut>>Úrmenu_check_cut)ZCopyz<<copy>>Zrmenu_check_copy)ZPastez	<<paste>>Úrmenu_check_paste)NNN)zSet Breakpointr;N)zClear Breakpointr<NTcCsD|jdkrdS|r(t ¡}t |d¡}n
dddœ}|j d|¡dS)z,Turn colorizing of breakpoint text on or offNÚbreakÚ)Ú
foregroundÚ
backgroundÚBREAK)rMrÚCurrentThemeÚGetHighlightrCZ
tag_config)r?ZcolorÚthemeZcfgr(r(r)rNžs

z)PyShellEditorWindow.color_breakpoint_textcCsˆ|j}|jj}| dd|d|d¡z|j |¡Wn tk
rX|j |¡YnXz|jj	j
j}| ||¡WnYnXdS)NrVz%d.0r)
rCrMr&Útag_addrAÚindexÚ
ValueErrorÚappendrGÚpyshellÚinterprrE)r?r'rCr&Údebugr(r(r)Úset_breakpointªsz"PyShellEditorWindow.set_breakpointNcCs>|j}|jj}|s| ¡dStt| d¡ƒƒ}| |¡dS)NÚinsert)rCrMr&ÚbellÚintÚfloatr[ra)r?ÚeventrCr&r'r(r(r)rE¸sz'PyShellEditorWindow.set_breakpoint_herecCsŠ|j}|jj}|s| ¡dStt| d¡ƒƒ}z|j |¡WnYnX| 	ddd¡z|j
jjj
}| ||¡WnYnXdS)NrbrVúinsert linestartzinsert lineend +1char)rCrMr&rcrdrer[rAÚremoveÚ
tag_removerGr^r_rrF)r?rfrCr&r'r`r(r(r)rFÁs$ÿz)PyShellEditorWindow.clear_breakpoint_herecCsd|jr`|j}|jj}|s$| ¡dSg|_| ddt¡z|jjj	j
}| |¡WnYnXdS)NrVú1.0)rArCrMr&rcriZENDrGr^r_rÚclear_file_breaks)r?rCr&r`r(r(r)rkÔsz%PyShellEditorWindow.clear_file_breaksc
Cs|j}|jj}z$t|jdƒ}| ¡}W5QRXWntk
rJg}YnXzjt|jdƒT}|D]}| |d¡s`| |¡q`| 	¡|j}|rª| |dt
|ƒd¡W5QRXWnTtk
r
}z4t|jddƒsúd|j_
tjdd	t
|ƒ|jd
W5d}~XYnXdS)z#Save breakpoints when file is savedÚrÚwú=Ú
Úbreakpoint_error_displayedFTz
IDLE Errorz$Unable to update breakpoint list:
%s)Útitler$rN)rArMr&ÚopenrLÚ	readlinesr#Ú
startswithr!Úupdate_breakpointsÚstrÚgetattrÚrootrprÚ	showerrorrC)r?Zbreaksr&ÚfpÚlinesZnew_filerÚerrr(r(r)Ústore_file_breaksãs2
(ÿýz%PyShellEditorWindow.store_file_breaksc	Cs¢|j ¡|jdkrdS|jj}|dkr,dStj |j¡ržt|jdƒ}| 	¡}W5QRX|D]>}| 
|d¡r^t|t|ƒdd…ƒ}|D]}| 
|¡qŒq^dS)Nrlrnr)rCr6rMr&rIrJÚisfilerLrrrsrtÚevalÚlenra)r?r&rzr{rZbreakpoint_linenumbersZbreakpoint_linenumberr(r(r)r>
s

z'PyShellEditorWindow.restore_file_breakscCs$|j}| d¡}| |¡}||_dS)z3Retrieves all the breakpoints in the current windowrVN)rCZ
tag_rangesÚranges_to_linenumbersrA)r?rCÚrangesZlinenumber_listr(r(r)rus

z&PyShellEditorWindow.update_breakpointscCsbg}tdt|ƒdƒD]H}tt||jƒƒ}tt||djƒƒ}||kr| |¡|d7}q@q|S)Nrér)Úranger€rdreÚstringr])r?r‚r{r[r'Úendr(r(r)r%s
z)PyShellEditorWindow.ranges_to_linenumberscCs| ¡t |¡dS)z7Extend base method - clear breaks when module is closedN)rkrÚ_close©r?r(r(r)r‡6szPyShellEditorWindow._close)T)N)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rBÚrmenu_specsrNrarErFrkr}r>rurr‡r(r(r(r)r:~s&ú	

	
*r:c@s"eZdZdZeZdZddd„ZdS)ÚPyShellFileListz8Extend base class: IDLE supports a shell and breakpointsNcCs8|jr|jj ¡nt|ƒ|_|jr2|j ¡s2dS|jSr=)r^ÚtopÚwakeupÚPyShellÚbegin©r?rfr(r(r)rHEs

zPyShellFileList.open_shell)N)r‰rŠr‹rŒr:rr^rHr(r(r(r)rŽ<srŽc@s0eZdZdZdd„Zdd„Zdd„Zdd	„Zd
S)ÚModifiedColorDelegatorz8Extend base class: colorizer for the shell window itselfcCst |¡| ¡dSr=)rrBÚLoadTagDefsrˆr(r(r)rBSs
zModifiedColorDelegator.__init__cCs*| ddd¡| ddd¡t |¡dS)NZTODOrjÚiomarkZSYNC)rirZrÚrecolorize_mainrˆr(r(r)r—Wsz&ModifiedColorDelegator.recolorize_mainc	CsJt |¡t ¡}|j dddœt |d¡t |d¡t |d¡dœ¡dS)N)rUrTÚstdoutÚstderrÚconsole)Ústdinr˜r™rš)rr•rrWÚtagdefsr6rX)r?rYr(r(r)r•\s



üz"ModifiedColorDelegator.LoadTagDefscCs|jD]}| |dd¡qdS)Nr–r†)rœri)r?Útagr(r(r)Úremovecolorsfs
z#ModifiedColorDelegator.removecolorsN)r‰rŠr‹rŒrBr—r•ržr(r(r(r)r”Ps

r”c@s$eZdZdZddd„Zddd„ZdS)	ÚModifiedUndoDelegatorz;Extend base class: forbid insert/delete before the I/O markNcCsNz$|j |dd¡r"|j ¡WdSWntk
r8YnXt ||||¡dS©Nú<r–)ÚdelegateÚcomparercÚTclErrorrrb)r?r[ÚcharsÚtagsr(r(r)rbns

zModifiedUndoDelegator.insertcCsLz$|j |dd¡r"|j ¡WdSWntk
r8YnXt |||¡dSr )r¢r£rcr¤rÚdelete)r?Zindex1Zindex2r(r(r)r§ws

zModifiedUndoDelegator.delete)N)N)r‰rŠr‹rŒrbr§r(r(r(r)rŸks
	rŸc@seZdZdd„ZdS)ÚMyRPCClientcCst‚dS)z0Override the base class - just re-raise EOFErrorN)ÚEOFErrorrˆr(r(r)Ú
handle_EOFƒszMyRPCClient.handle_EOFN)r‰rŠr‹rªr(r(r(r)r¨sr¨cCs^d|pd›d}|t|ƒkrNt|t|ƒdƒ\}}||d›|›|d›S|dd…SdS)z¹Return width long restart line formatted with filename.

    Fill line with balanced '='s, with any extras and at least one at
    the beginning.  Do not end with a trailing space.
    z= RESTART: ZShellz =rƒrnNéþÿÿÿ)r€Údivmod)Úwidthr&rZdivÚmodr(r(r)Úrestart_line‡s
r¯c@seZdZdd„ZdZdZdZdd„Zdd„Zdd	„Z	d?dd
„Z
dd„Zdd„Zdd„Z
dd„Zd@dd„ZdZdd„ZdZdd„Zdd„Zdd„Zd d!„Zd"Zd#d$„ZdAd%d&„Zd'd(„Zd)d*„Zd+d,„ZdBd-d.„Zd/d0„Zd1d2„Zd3d4„Z d5d6„Z!d7d8„Z"d9d:„Z#d;d<„Z$d=d>„Z%dS)CÚModifiedInterpretercCsB||_tjdj}tj||dd|_d|_t|_	|j
jj|_
dS)Nr)ÚlocalsF)Ú	tkconsoleÚsysÚmodulesÚ__dict__r
rBÚ
restartingÚsubprocess_arglistÚPORTÚportÚcompileÚcompilerÚflagsÚoriginal_compiler_flags)r?r²r±r(r(r)rB—szModifiedInterpreter.__init__NcCs&|jdkr| ¡|_t |j¡|_dSr=)r·Úbuild_subprocess_arglistÚ
subprocessÚPopenÚ
rpcsubprocrˆr(r(r)Úspawn_subprocess¤s

z$ModifiedInterpreter.spawn_subprocesscCs\|jdkstdƒ‚dd„tjDƒ}tjddddd	d
}d|f}tjg|d|t|jƒgS)
Nrz/Socket should have been assigned a port number.cSsg|]}d|‘qS)z-Wr()Ú.0Úsr(r(r)Ú
<listcomp>¬sz@ModifiedInterpreter.build_subprocess_arglist.<locals>.<listcomp>ÚmainÚGeneralzdelete-exitfuncFÚbool)ÚdefaultÚtypez&__import__('idlelib.run').run.main(%r)ú-c)r¹ÚAssertionErrorr³ÚwarnoptionsrÚ	GetOptionÚ
executablerv)r?rmZ	del_exitfZcommandr(r(r)r¾©sÿ
ÿ
z,ModifiedInterpreter.build_subprocess_arglistc	Cs\t|jf}tdƒD]8}t |¡zt|ƒ|_WqXWqtk
rHYqXq| ¡dS|jj	 
¡d|_tdkrˆ|jj	 t
jt
jd¡| ¡|jj	 d¡z|j ¡Wn t
jk
rÌ| ¡YdSX|j d|j¡|j d|jj¡|j d|jj¡|j d|jj¡|j d	|jj¡|j d
t¡|j d|¡|jdd
| ¡|jS)Nérré
ršr›r˜r™rGr2r_T©Úwith_cwd)ÚHOSTr¹r„ÚtimeÚsleepr¨Úrpccltr#Údisplay_port_binding_errorÚlistening_sockÚgetsocknamer¸Ú
setsockoptÚsocketÚ
SOL_SOCKETÚSO_REUSEADDRrÂÚ
settimeoutÚacceptÚtimeoutÚdisplay_no_subprocess_errorÚregisterr²r›r˜r™rGr2Ú
transfer_pathÚpoll_subprocess)r?ÚaddrÚir(r(r)Ústart_subprocessµsB



ÿz$ModifiedInterpreter.start_subprocessFrScCs2|jr|jSd|_| ¡}|r<zt |j¡WnYnX|j ¡| ¡|j}|j}d|_| 	¡z|j 
¡Wn tjk
r–| 
¡YdSX|j|d| ¡|j dd¡| d¡| t|j|ƒ¡|j dd¡|j dd¡|s| ¡|rt |j¡| ¡|j|jj_d|_|jS)	NTFrÒr–úend-1croÚrestartÚleft)r¶r×ÚgetdebuggerrZclose_subprocess_debuggerÚcloseÚterminate_subprocessr²Ú	executingrÂràrÜrárâräÚ
stop_readlinerCr§r!r¯r­Úmark_setÚmark_gravityÚ
showpromptZrestart_subprocess_debuggerÚload_breakpointsr½rºr»r¼)r?rÓr&r`ršZ
was_executingr(r(r)Úrestart_subprocessàsF

z&ModifiedInterpreter.restart_subprocesscCs|j dddi¡dS)NÚexecZinterrupt_the_serverr()r×Z
remotecallrˆr(r(r)Z__request_interruptsz'ModifiedInterpreter.__request_interruptcCstj|jd ¡dS)N)Útarget)Ú	threadingÚThreadÚ'_ModifiedInterpreter__request_interruptÚstartrˆr(r(r)Úinterrupt_subprocesssz(ModifiedInterpreter.interrupt_subprocesscCs~|jdk	r|jj |j¡z|jj ¡Wntk
r>YnXz|j ¡Wntk
rbYnX| ¡d|j_	d|_dS)NF)
Ú_afteridr²rCZafter_cancelr×rÙrír"rîrïrˆr(r(r)Úkill_subprocesss
z#ModifiedInterpreter.kill_subprocesscCsPz|j ¡Wntk
r$YdSXz|j ¡Wntk
rJYdSXdS)z"Make sure subprocess is terminatedN)rÁÚkillr#Úwaitrˆr(r(r)rî!sz(ModifiedInterpreter.terminate_subprocesscCs2|rdg}| tj¡ntj}| d|f¡dS)NrSzRif 1:
        import sys as _sys
        _sys.path = %r
        del _sys
        
)Úextendr³rJÚ
runcommand)r?rÓrJr(r(r)rä.süz!ModifiedInterpreter.transfer_pathc
Cs8|j}|dkrdSz|j|jdd}Wn4tttfk
rZ|jjrJYdSd}| ¡YnX|r|j 	¡d|_|\}}|jj
}|dkr¤|dk	rìtt|ƒ|dnH|dkrÂ|j 
d¡rì| ¡n*|dkrìd}t||tjdt|||dz|j ¡Wntk
rYnX|jjs4|jj |jj|j¡|_dS)	Ngš™™™™™©?)rZOKrZ	EXCEPTIONú<<toggle-jit-stack-viewer>>ÚERRORz/pyshell.ModifiedInterpreter: Subprocess ERROR:
)r×ZpollresponseÚ
active_seqr©r#ÚKeyboardInterruptr²ÚclosingrõÚresetoutputršÚprintÚreprÚgetvarÚremote_stack_viewerr³Ú
__stderr__Úendexecutingr"rCÚafterÚpollintervalrårý)r?ZcltÚresponseÚhowZwhatršÚerrmsgr(r(r)rå=sD


ÿz#ModifiedInterpreter.poll_subprocesscCs
||_dSr=r)r?rr(r(r)ÚsetdebuggereszModifiedInterpreter.setdebuggercCs|jSr=rrˆr(r(r)rìhszModifiedInterpreter.getdebuggercCs|jj d|j¡dS)a’Initiate the remote stack viewer from a separate thread.

        This method is called from the subprocess, and by returning from this
        method we allow the subprocess to unblock.  After a bit the shell
        requests the subprocess to open the remote stack viewer which returns a
        static object looking at the last exception.  It is queried through
        the RPC mechanism.

        i,N)r²rCrrrˆr(r(r)Úopen_remote_stack_viewerks
z,ModifiedInterpreter.open_remote_stack_viewercCs°ddlm}|j dddi¡}|dkr6|jj ¡dS| |j|¡}ddlm	}m
}t|jjƒ}t 
¡}t |d¡d}|||dd	}	|	jjd
dd||	jd|ƒ}
|
 ¡dS)
Nr)Ú
debugobj_rröZstackviewer)rG)ÚScrolledCanvasÚTreeNodeÚnormalrU)ÚbgZhighlightthicknessrZboth)ÚexpandÚfill)Úidlelibrr×Úremotequeuer²rxrcZStubObjectTreeItemZidlelib.treerrZToplevelrrWrXÚframeÚpackZcanvasr)r?rZoidÚitemrrrrYrUZscZnoder(r(r)rxsz'ModifiedInterpreter.remote_stack_viewerrcCs| |¡}| ||¡dS)z1Like runsource() but assumes complete exec sourceN)ÚstuffsourceÚexecfile©r?Úsourcer&r(r(r)Ú
execsource‹s
zModifiedInterpreter.execsourcec	Cs®|dkrFt |¡.}| ¡}tr<dtj |¡›d|d}W5QRXzt||dƒ}WnHtt	fk
rž|j
 ¡td|j
j
dt ||¡|j
 ¡YnX| |¡dS)zExecute an existing fileNz__file__ = r'''z'''
z
del __file__rözB*** Error in script or command!
Traceback (most recent call last):r)ÚtokenizerrÚreadÚuse_subprocessrIrJÚabspathrºÚ
OverflowErrorÚSyntaxErrorr²rr	r™r
ÚshowsyntaxerrorróÚruncode)r?r&r%rzÚcoder(r(r)r#s&ÿÿ
þzModifiedInterpreter.execfilecCs&| |¡}t|tƒst‚t |||¡S)zBExtend base class method: Stuff the source in the line cache first)r"Ú
isinstancervrÌr
Ú	runsourcer$r(r(r)r1¤s
zModifiedInterpreter.runsourcecCs>d|j}|jd|_| d¡}t|ƒdd||ftj|<|S)z"Stuff source in the filename cachez<pyshell#%d>rror)ÚgidÚsplitr€r2r3)r?r%r&r{r(r(r)r"­s


zModifiedInterpreter.stuffsourcecCs| d|f¡dS)z>Prepend sys.path with file's directory if not already includeda(if 1:
            _filename = %r
            import sys as _sys
            from os.path import dirname as _dirname
            _dir = _dirname(_filename)
            if not _dir in _sys.path:
                _sys.path.insert(0, _dir)
            del _filename, _sys, _dirname, _dir
            
N)r©r?r&r(r(r)Úprepend_syspathµsøz#ModifiedInterpreter.prepend_syspathcCsÄ|j}|j}| ddd¡t ¡\}}}t|ddƒp:|p:d}t|ddƒpJd}t|d	dƒpZd
}	|	d
krl|d7}|dkr‚d|	d}
nd|d|	df}
| ||
¡| ¡| d
|¡| 	¡dS)z§Override Interactive Interpreter method: Use Colorizing

        Color the offending position instead of printing it and pointing at it
        with a caret.

        rrjr†ÚmsgrSz<no detail available>r'rÚoffsetrziomark + %d charsz&iomark linestart + %d lines + %d charszSyntaxError: %s
N)
r²rCrir³Úexc_inforwZcolorize_syntax_errorrr!ró)r?r&r²rCrÊÚvalueÚtbr6r'r7Úposr(r(r)r-Ás$ÿz#ModifiedInterpreter.showsyntaxerrorcCs6|j ¡| ¡t |¡|j d¡r2|j ¡dS)z1Extend base class method to reset output properlyrN)r²rÚchecklinecacher
Ú
showtracebackrÚopen_stack_viewerrˆr(r(r)r=Ûs


z!ModifiedInterpreter.showtracebackcCs>tj}t| ¡ƒD]&}|dd…|dd…dkr||=qdS)Nrr0r1)r2r3r4Úkeys)r?Úcr8r(r(r)r<ãsz"ModifiedInterpreter.checklinecachecCs@|jjr| ¡dS|jr0|j dd|fi¡nt||jƒdS)z*Run the code without invoking the debuggerrrör.r)r²rïÚdisplay_executing_dialogr×rrör±)r?r/r(r(r)részModifiedInterpreter.runcommandcCsL|jjr| ¡| ¡|j}zúzT|j ¡|sR|j	dk	rR|j	 
dd|fi¡|_n |rf| ||j
¡nt||j
ƒWn tk
r¶|jjs°tjddd|jjdr¦‚q²| ¡n‚Yn`trätd|jjd	| ¡|j ¡n,|jjrd
|j_td|jjd	n| ¡YnXW5tsFz|j ¡Wntk
rDYnXXdS)úOverride base class methodNrör.zExit?zDo you want to exit altogether?Zyes©rÉrz IDLE internal error in runcode()rFr)r²rïrõr<rr)rr"Úbeginexecutingr×Z
asyncqueuerÚrunr±röÚ
SystemExitrrZaskyesnorCr=r	r™Úcanceled)r?r/rr(r(r)r.õsR

ÿü
ÿ
zModifiedInterpreter.runcodecCs|jj |¡S)rB)r²r™r!)r?rÄr(r(r)r!#szModifiedInterpreter.writecCstjdd|jjddS)NzPort Binding ErroraAIDLE can't bind to a TCP/IP port, which is necessary to communicate with its Python execution server.  This might be because no networking is installed on this computer.  Run IDLE with the -n command line switch to start without a subprocess and refer to Help/IDLE Help 'Running without a subprocess' for further details.r©rryr²rCrˆr(r(r)rØ's
øz.ModifiedInterpreter.display_port_binding_errorcCstjdd|jjddS)NzSubprocess Connection Errorz¢IDLE's subprocess didn't make connection.
See the 'Startup failure' section of the IDLE doc, online at
https://docs.python.org/3/library/idle.html#startup-failurerrHrˆr(r(r)râ2s
ûz/ModifiedInterpreter.display_no_subprocess_errorcCstjdd|jjddS)NzAlready executingzYThe Python Shell window is already executing a command; please wait until it is finished.rrHrˆr(r(r)rA:s
üz,ModifiedInterpreter.display_executing_dialog)FrS)F)N)N)&r‰rŠr‹rBrýr×rÁrÂr¾rèrõrúrürþrîrärrårrrìrrr2r&r#r1r"r5r-r=r<rr.r!rØrârAr(r(r(r)r°•sF	+
,

&

	
.r°csšeZdZdeƒZeZeZddddddgZ	e
jdgZd	Zd
dl
mZdUd
d„Zdd„Zd	Zd	Zd	Zd	Zd	Zd	Zdd„Zdd„ZdVdd„Zdd„ZdWdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Z d%d&„Z!d'd(„Z"d)d*„Z#d+d,„Z$d-Z%d.d/„Z&d0d1„Z'd2d3„Z(d4d5„Z)dXd6d7„Z*d8d9„Z+d:d;„Z,d<d=„Z-d>d?„Z.d@dA„Z/dYdBdC„Z0dZdDdE„Z1d[dFdG„Z2dHdI„Z3dJdK„Z4dLdM„Z5d\dOdP„Z6‡fdQdR„Z7‡fdSdT„Z8‡Z9S)]r‘zIDLE Shell )rZ_File)ZeditZ_Edit)r`Z_Debug)ÚoptionsZ_Options)ZwindowZ_Window)ÚhelpZ_Help)ZSqueezeú<<squeeze-current-text>>Fr)ÚHistoryNcCs$tr&|j}|dddkr&| dd¡t|ƒ|_|dkrVtƒ}t|ƒ| ¡t|ƒ}t	 
||dd¡d|_d|_t
tdƒr‚tjnd|_|j d	¡d
|_|j|_|j}|jdd| d
|j¡| d|j¡| d|j¡| d|j¡| d|j¡| d|j¡| d|j¡tr8| d|j¡| d|j¡|  |¡}| d|j!¡tj"|_#tj$|_%tj&|_'ddl(m)}t*|d|j+|j,ƒ|_&t-|d|j+|j,ƒ|_"t-|d|j+dƒ|_$t-|d|j+|j,ƒ|_.tsà|j"t_"|j$t_$|j&t_&zddl/}|j0|_1Wntj2t_$‚YnX| 3|j¡|_4d|_5dS)NrƒrÚshell)rMZShe_llTéÚps1rror0Úchar)Úwrapz<<newline-and-indent>>z<<plain-newline-and-indent>>z<<interrupt-execution>>z<<end-of-file>>z<<open-stack-viewer>>ú<<toggle-debugger>>rz<<view-restart>>z<<restart-shell>>rK)Úiomenur›r˜r™Úbackslashreplaceršé2)6r)Ú
menu_specsrbr°r_ÚTkrÚwithdrawrŽrrBZusetabsZindentwidthÚhasattrr³rOÚsys_ps1r3Zprompt_last_lineÚpromptrCZ	configurerDÚenter_callbackÚlinefeed_callbackÚcancel_callbackÚeof_callbackr>Útoggle_debuggerÚtoggle_jit_stack_viewerÚview_restart_markÚ
restart_shellZSqueezerZsqueeze_current_text_eventr˜Úsave_stdoutr™Úsave_stderrr›Ú
save_stdinrrSrÚencodingÚerrorsrršÚpydocZ
plainpagerZpagerr
rLÚhistoryr)r?rGÚmsrxrCZsqueezerrSrir(r(r)rB^s€

ÿÿÿÿÿzPyShell.__init__cCstjddS)NT)Z
shell_only)rZ
GetExtensionsrˆr(r(r)Úget_standard_extension_names¡sz$PyShell.get_standard_extension_namescCs|adSr=©r )r?Ústreamr(r(r)Úset_warning_stream«szPyShell.set_warning_streamcCstSr=rmrˆr(r(r)Úget_warning_stream¯szPyShell.get_warning_streamcCsH|jr$tjdd|jd| ¡dS|j ¡}|r<| ¡n| ¡dS)NzDon't debug nowz*You can only toggle the debugger when idlerrR)	rïrryrCÚset_debugger_indicatorr_rìÚclose_debuggerÚ
open_debugger)r?rfÚdbr(r(r)r`²sþ

zPyShell.toggle_debuggercCs|j ¡}| d|¡dS)NrR)r_rìZsetvar©r?rtr(r(r)rqÀs
zPyShell.set_debugger_indicatorcCsdSr=r(r“r(r(r)raÄszPyShell.toggle_jit_stack_viewercCsh|j ¡}|r\|j d¡| ¡|jjr8t |jj¡| ¡|j 	d¡|j
|_| ¡| 
¡dS)Nz[DEBUG OFF]
)r_rìrrír×rZclose_remote_debuggerrršr!rZr[rórqrur(r(r)rrÇs
zPyShell.close_debuggercCsX|jjrt |jj|¡}n
t |¡}|j |¡| ¡d|j|_	| 
¡| ¡dS)Nz[DEBUG ON]
)r_r×rZstart_remote_debuggerrZDebuggerrrôrZr[rórq)r?Zdbg_guir(r(r)rsÔs
ÿ
zPyShell.open_debuggercCs |jr
dnd}| dd|¡dS)NÚdisabledrr`z*tack*iewer)rïZupdate_menu_state)r?Ústater(r(r)Údebug_menu_postcommandàszPyShell.debug_menu_postcommandcCs| ¡d|_dS)úHelper for ModifiedInterpreterTN)rrïrˆr(r(r)rDäszPyShell.beginexecutingcCsd|_d|_| ¡dS)ryFN)rïrGrórˆr(r(r)részPyShell.endexecutingcCsD|jr&tjddd|jd}|dkr&dS| ¡d|_d|_t |¡S)zExtend EditorWindow.close()zKill?z7Your program is still running!
 Do you want to kill it?ÚokrCFÚcancelT)	rïrZaskokcancelrCrðrGrrrí)r?rr(r(r)ríïsüz
PyShell.closecCsV| ¡tr|j ¡|jt_|jt_|j	t_
d|_d|_d|j_
d|_t |¡dS)zEExtend EditorWindow._close(), shut down debugger and execution serverN)rrr)r_rþrdr³r˜rer™rfr›ršrGr^rjrr‡rˆr(r(r)r‡þs
zPyShell._closecCsdS)z8Override EditorWindow method: never remove the colorizerTr(r4r(r(r)ÚispythonsourceszPyShell.ispythonsourcecCs|jSr=)Úshell_titlerˆr(r(r)Úshort_titleszPyShell.short_titlezHType "help", "copyright", "credits" or "license()" for more information.cCsŒ|j dd¡| ¡tr:d}|j ¡}|sF| ¡dSnd}tjt	_| 
dt	jt	j|j
|f¡|j ¡| ¡ddl}d|_d|_dS)	Nr–rbrSFz›==== No Subprocess ====

WARNING: Running IDLE without a Subprocess is deprecated
and will be removed in a later version. See Help/IDLE Help
for details.

zPython %s on %s
%s
%srT)rCrñrr)r_rèrírÚdisplayhookr³r!ÚversionÚplatformÚ	COPYRIGHTZfocus_forceróÚtkinterZ_support_default_rootZ
_default_root)r?ZnosubÚclientrƒr(r(r)r’s&
ÿ
z
PyShell.begincCs|js
dSd|_|j ¡dS©NT)ÚreadingÚ_stop_readline_flagrÚquitrˆr(r(r)rð2szPyShell.stop_readlinecCs‚|j}zd|_|j ¡W5||_X|jr4d|_dS|j dd¡}t|ƒdkrRd}| ¡|jrnd|_t	snt
‚|jr~d|_d}|S)NTFrSr–rérro)r†rÚmainloopr‡rCÚgetr€rrGr)rÚ	endoffile)r?r7rr(r(r)Úreadline8s(zPyShell.readlinecCsdSr…r(rˆr(r(r)ÚisattyOszPyShell.isattycCs¢z|j ddd¡rWdSWnYnX|jsT|jsT| ¡|j d¡| ¡dSd|_d|_	|jrŽ|jj
rŽ|j ¡r„|j ¡n
|j 
¡|jrž|j ¡dS)Nú	sel.firstz!=úsel.lastzKeyboardInterrupt
rRFT)rCr£rïr†rr_r!rór‹rGr×rìrõrürrˆr“r(r(r)r^Rs&



zPyShell.cancel_callbackcCsf|jr|jsdS|j ddd¡r0|j ddd¡s4dS|jsL| ¡| ¡nd|_d|_|j 	¡dS)Nr–z==rbréFTrR)
rïr†rCr£rrírGr‹rrˆr“r(r(r)r_hsÿ

zPyShell.eof_callbackcCs0|jr"|j dd¡|j d¡n
| |¡dS)NrbrorR)r†rCrbÚseeÚnewline_and_indent_eventr“r(r(r)r]ws

zPyShell.linefeed_callbackcCs:|jr|jsdSz8|j dd¡}|rF|j ddd¡rF| ||¡WdSWnYnX|j ddd¡rX|j d	d¡}|r°|j dd|d
¡r°| |j |d|d
¡|¡dS|j d	d¡}|rø|j dd
|d¡rø| |j |d|d
¡|¡dS|j dd¡}|r>|j |ddd¡r>| |j |d
d¡|¡n| |j dd¡|¡dS|j ddd¡rx|j dd¡|j dd¡}|r¤| 	¡s¤|j 
dd¡|j ddd¡rÄ| |¡dS|j dd¡|jrö|j dd¡|j 
d¡n
| |¡|j d	dd¡|j ¡|jr.|j ¡n| ¡dS)NrŽrz<=r–rRrbr¡úiomark linestartr›rrzinsert lineendz>=ršrgrézend-1c linestartro)rïr†rCrŠr£ÚrecallZ
tag_prevrangeZ
tag_nextrangerñÚstripr§r‘rbrrZZupdate_idletasksrrˆÚrunit)r?rfÚselÚprevÚnextÚindicesrÄr(r(r)r\€sZ
ÿ


zPyShell.enter_callbackc	Cs6t dd|¡}t dd|¡}| d¡}|j ¡zè|j ddd¡|j dd	¡|j 	d
d¡}| 
¡ d¡r„| |¡|j 	d
d¡}|j 
d|d ¡¡t|ƒd
krt d|d¡ d¡}t d|¡ d¡}|d
d…D]8}| |¡rþ||t|ƒd…}|j 
dd| 
¡¡qÜW5|j d¡|j ¡XdS)Nz^\s*\nrSz\n\s*$rorbr–rjr†rérgú:rrz	^([ \t]*))ÚreÚsubr3rCZundo_block_startrZundo_block_stoprirñrŠÚrstripÚendswithr‘rbr”r€ÚsearchÚgrouprt)r?rÄrfr{ÚprefixZorig_base_indentZnew_base_indentrr(r(r)r“¿s*



zPyShell.recallcCs–|j dd¡}t|ƒ}|dkr8||ddkr8|d}q|dkrX||ddkrX|d}|dkrz||ddkrz|d}qX|d|…}|j |¡dS)Nr–rérrz 	ro)rCrŠr€r_r1)r?rrçr(r(r)r•Ùs

z
PyShell.runitcCs\|jjr|j ¡Sz
tjWn tjdd|jdYdSXddlm	}||j
|jƒdS)NzNo stack tracez@There is no stack trace yet.
(sys.last_traceback is not defined)rr)ÚStackBrowser)r_r×rr³Úlast_tracebackrryrCZidlelib.stackviewerr¢rxrG)r?rfr¢r(r(r)r>çs

ýzPyShell.open_stack_viewercCs|j d¡|j d¡dS)Nr–rê)rCrr“r(r(r)rbõszPyShell.view_restart_markcCs|jjdddS)z&Callback for Run/Restart Shell Cntl-F6TrÒN)r_rõr“r(r(r)rcùszPyShell.restart_shellcCs:| ¡|j |j¡|j dd¡| ¡|j ¡dS)Nrbré)	rršr!r[rCrñÚset_line_and_columnrMZ
reset_undorˆr(r(r)róýs
zPyShell.showpromptcCsP|jjj}t|ddd}d | |¡¡}| d¡s:|d7}|jj 	d|d¡dS)NrNT)r­ÚtabsizeZexpand_tabsror’r™)
r_r²r­rrKrQržZperZbottomrb)r?r6r­ÚwrapperZwrapped_msgr(r(r)Úshow_warnings

zPyShell.show_warningcCsb|j dd¡}|jr |j |¡|j d¡dkr>|j dd¡|j dd¡| ¡|j ¡dS)Nr–rézend-2cro)	rCrŠrjÚstorerbrñr¤ZctipZremove_calltip_window)r?r%r(r(r)rszPyShell.resetoutputr(cCsXz0|j dd¡t |||d¡}|j dd¡Wn‚YnX|jrTd|_tsTt‚|S)Nr–ÚrightrëF)rCròrr!rGr)r)r?rÄr¦Úcountr(r(r)r!sz
PyShell.writecs<z|j ddd¡rWdSWntk
r0YdSXtƒ ¡S)NrŽr¡r–rv)rCr£r¤ÚsuperrPrˆ©Ú	__class__r(r)rP$s
zPyShell.rmenu_check_cutcs|j ddd¡rdStƒ ¡S)Nrbr¡r–rv)rCr£r«rQrˆr¬r(r)rQ,szPyShell.rmenu_check_paste)N)N)N)N)N)N)N)r():r‰rŠr‹rr}r”rrŸrrVrrZallow_line_numbersZidlelib.historyrLrBrlr†rïrGr‹rr‡rorpr`rqrarrrsrxrDrrír‡r|r~r‚r’rðrŒrr^r_r]r\r“r•r>rbrcrór§rr!rPrQÚ
__classcell__r(r(r¬r)r‘Bst
ú
ÿ
C


ÿ
	?




r‘c
Cs2|jdkr.dD]}| |dd| |d¡¡qdS)z6Make paste replace selection on x11.  See issue #5124.Zx11)ZTextZEntryZSpinboxz	<<Paste>>z%catch {%W delete sel.first sel.last}
N)Z_windowingsystemZ
bind_class)rxÚclsr(r(r)Ú
fix_x11_paste2s

ÿýr°a¢
USAGE: idle  [-deins] [-t title] [file]*
       idle  [-dns] [-t title] (-c cmd | -r file) [arg]*
       idle  [-dns] [-t title] - [arg]*

  -h         print this help message and exit
  -n         run IDLE without a subprocess (DEPRECATED,
             see Help/IDLE Help for details)

The following options will override the IDLE 'settings' configuration:

  -e         open an edit window
  -i         open a shell window

The following options imply -i and will open a shell:

  -c cmd     run the command in a shell, or
  -r file    run script from file

  -d         enable the debugger
  -s         run $IDLESTARTUP or $PYTHONSTARTUP before anything else
  -t title   set title of shell window

A default edit window will be bypassed when -c, -r, or - are used.

[arg]* are passed to the command (-c) or script (-r) in sys.argv[1:].

Examples:

idle
        Open an edit window or shell depending on IDLE's configuration.

idle foo.py foobar.py
        Edit the files, also open a shell if configured to start with shell.

idle -est "Baz" foo.py
        Run $IDLESTARTUP or $PYTHONSTARTUP, edit foo.py, and open a shell
        window with the title "Baz".

idle -c "import sys; print(sys.argv)" "foo"
        Open a shell window and run the command, passing "-c" in sys.argv[0]
        and "foo" in sys.argv[1].

idle -d -s -r foo.py "Hello World"
        Open a shell window, run a startup script, enable the debugger, and
        run foo.py, passing "foo.py" in sys.argv[0] and "Hello World" in
        sys.argv[1].

echo "import sys; print(sys.argv)" | idle - "foobar"
        Open a shell window, run the script piped in, passing '' in sys.argv[0]
        and "foobar" in sys.argv[1].
c
sVddl}ddlm}ddlm}ddlm}tdƒdad}d}d}d}d}d}	z| tj	dd…d¡\}
}WnD|j
k
r²}z$td	|tftj
d
t d¡W5d}~XYnX|
D]Ô\}
}|
dkrÐ|}d}|
d
kràd}d}|
dkrìd}|
dkr
tj t¡t ¡|
dkrd}|
dkr4tdtj
d
da|
dkrh|}tj |¡rRntd|ƒt ¡d}|
dkrzd}	d}|
dkr¸|t_d}q¸|r°|ddkr°tj ¡}d}tttjƒƒD]}tj tj|¡tj|<q¾|r|ddkrdg|dd…t_	nª|rdg|t_	n–|r0|g|t_	n‚|rd}g}|D]}| tj |¡¡qB|D],}tj |¡}|tjkr`tj d|¡q`n"t ¡}|tjkr²tj d|¡tj ddddd}|pÌ|}|pØ|}trì|sìt!ƒt"dda#t# $¡dd l%m&}|t#ƒtj 'tj t(¡d!¡‰|ƒd"krPtj 'ˆd#¡}t#j)|d$nV| *¡s¦t+d%krnd&‰d'}nd(‰d)}‡‡fd*d+„|Dƒ}d,d+„|Dƒ}t#j,d0|žŽt-t#ƒt.t#ƒt/t#ƒa0| 1t#t0¡|r|s|s|dd…D] }t0 2|¡dkrè| 3|¡qè|st0 4¡|rNt0 5¡}|s0dS| *¡rTt0j6rT|j7 8¡nt0j9}|rb| :¡|	r¢tj; <d-¡p€tj; <d.¡}|r¢tj |¡r¢|j= >|¡|s®|rö|j= ?d/tj	f¡|rÖ|j= @|¡n|r.|j= A|¡|j= >|¡n8|r.| Bt#¡}|r| C|¡| D¡}|r.| C|¡t0jErBt# F¡q.t# G¡tdƒdS)1Nr)Úsystem)Útesting)ÚmacosxTFrzc:deihnr:st:zError: %s
%srrƒrËz-dz-ez-hz-iz-nz: Warning: running IDLE without a subprocess is deprecated.z-rzNo script file: z-sz-tú-rSrÆrÇzeditor-on-startuprÈ)rÊZIdle)Z	classNamer	ZIconsZWindowszidle.ico)rÉg333333!@z.png)éé é0éz.gif)rµr¶r·cs"g|]}tj ˆd|ˆf¡‘qS)z	idle_%d%s)rIrJrK)rÃÚsize©ÚextZicondirr(r)rÅÜsÿzmain.<locals>.<listcomp>cSsg|]}tt|d‘qS))Zmasterr)Z
PhotoImagerx)rÃÚiconfiler(r(r)rÅÞsÿZIDLESTARTUPZ
PYTHONSTARTUPzbif 1:
            import sys as _sys
            _sys.argv = %r
            del _sys
            
)T)HÚgetoptrr±rr²r³r/r)r³ÚargvÚerrorr	Ú	usage_msgr™Úexitr˜r!rIrJr~r‘r}r›r(r„r€r*r]ÚdirnamerbÚgetcwdrrÎZ
NoDefaultRootrWrxrXÚidlelib.runr
rKÚ__file__Z
wm_iconbitmapZisAquaTkÚ	TkVersionZwm_iconphotorr°rŽrGZsetupApprrrhÚnewrHÚdictrÚlowerr^rsÚenvironrŠr_r#rr&r5ZtkVersionWarningr§ZpreferTabsPreferenceWarningZinversedictr‰Zdestroy)r½r±r²r³Zenable_shellZenable_editr`ÚcmdZscriptZstartupZoptsrOr6ÚoÚarçZpathxr&ÚdirZ
edit_startr
r¼ZsizesZ	iconfilesZiconsrMZtkversionwarningZprefer_tabs_preference_warningr(rºr)rÆss&


ÿ



ÿ



ÿÿ
ÿü


rÆF)NN)Nr³r‰r´rƒÚImportErrorr	r
rFrZctypesZPROCESS_SYSTEM_DPI_AWAREZOleDLLZSetProcessDpiAwarenessr"r#rrÆrWrxrXrÄr
ryr/r
r2rIZos.pathrr›rÜr¿ÚtextwraprrørÕr'r,Zidlelib.colorizerrZidlelib.configrrrrZidlelib.editorrrZidlelib.filelistrZidlelib.outwinrrrrrZidlelib.undorrÔr¸r r*r+r/Ú
checkcacher9r:rŽr”rŸZ	RPCClientr¨r¯r°r‘r°rÀrÆr(r(r(r)Ú<module>sªÿ
þÿ

ÿ
?0s66


Zerion Mini Shell 1.0