• File: pyshell.cpython-37.opt-2.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python37/lib64/python3.7/idlelib/__pycache__/pyshell.cpython-37.opt-2.pyc
  • Date Modified: 10/26/2026 8:08 PM
  • File size: 38.6 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

YI~d
@sddlZedkr ejdejd<yddlTWn*ek
rVedejdedYnXejdkry ddl	Z	dZ
e	d	e
Wnee
efk
rYnXddlmZed
kreatddlmZetejdd
etdedddlmZddlZddlZddlZddlmZddlZddl Z ddl!Z!ddl"m#Z#ddl$Z$ddl%Z%ddl&Z&ddl'Z'ddl(m)Z)ddl*m+Z+ddl,m-Z-ddl,m.Z.ddl/m0Z0m1Z1ddl2m3Z3ddl4m5Z5ddl,m6Z6ddlm7Z7m8Z8m9Z9ddl:m;Z;dZ<dZ=eja>d:ddZ?da@dd ZAeAd!dejBfd"d#ZCeCe_BGd$d%d%e0ZDGd&d'd'e3ZEGd(d)d)e)ZFGd*d+d+e;ZGGd,d-d-e6jHZId.d/ZJGd0d1d1eZKGd2d3d3e5ZLd4d5ZMd6ZNd7d8ZOedkreOeAd9dS);N__main__zidlelib.pyshell)*zJ** IDLE can't import Tkinter.
Your Python may not be configured for Tk. **)filewin32Zshcoreg!@)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}y&|t|||||d|dWnttfk
rJYnXdS)N)linez>>> )warning_streamwriterAttributeErrorOSError)messagecategoryfilenamelinenorrr"4/opt/alt/python37/lib64/python3.7/idlelib/pyshell.pyidle_showwarningEsr$cCs0|rtdkr,tjatt_ntdk	r,tt_dadS)N)_warnings_showwarningwarningsshowwarningr$)Zcapturer"r"r#capture_warningsXsr(TcCs\tj}i}x:t|D].}|dd|dddkr||||<qW||||dS)Nrz<>)	linecachecachelistpopupdate)r Zorig_checkcacher+savekeyr"r"r#extended_linecache_checkcachegsr1c@szeZdZddZddddddgZdd
dZdd
Zd ddZd!ddZddZ	ddZ
ddZddZddZ
ddZdS)"PyShellEditorWindowcGsg|_tj|f||jd|j|jd|j|jd|jjt	j
tj
d|_|jj|fdd}|j||jjr||dS)Nz<<set-breakpoint-here>>z<<clear-breakpoint-here>>z<<open-python-shell>>zbreakpoints.lstcSs||dS)N)restore_file_breaks)Zold_hookselfr"r"r#filename_changed_hooksz;PyShellEditorWindow.__init__.<locals>.filename_changed_hook)breakpointsr__init__textbindset_breakpoint_hereclear_breakpoint_hereflist
open_shellospathjoinr
ZuserdirbreakpointPathioZfilename_change_hookZset_filename_change_hookr r3color_breakpoint_text)r4argsr5r"r"r#r7szPyShellEditorWindow.__init__)ZCutz<<cut>>rmenu_check_cut)ZCopyz<<copy>>Zrmenu_check_copy)ZPastez	<<paste>>rmenu_check_paste)NNN)zSet Breakpointz<<set-breakpoint-here>>N)zClear Breakpointz<<clear-breakpoint-here>>NTcCsD|jdkrdS|r(t}t|d}n
ddd}|jd|dS)Nbreak)
foreground
backgroundBREAK)rBr
CurrentThemeGetHighlightr8Z
tag_config)r4ZcolorthemeZcfgr"r"r#rCs

z)PyShellEditorWindow.color_breakpoint_textcCs|j}|jj}|dd|d|dy|j|Wn tk
rX|j|YnXy|jj	j
j}|||WnYnXdS)NrKz%d.0r)
r8rBr tag_addr6index
ValueErrorappendr<pyshellinterprr:)r4r!r8r debugr"r"r#set_breakpointsz"PyShellEditorWindow.set_breakpointNcCs>|j}|jj}|s|dStt|d}||dS)Ninsert)r8rBr bellintfloatrPrV)r4eventr8r r!r"r"r#r:sz'PyShellEditorWindow.set_breakpoint_herecCs|j}|jj}|s|dStt|d}y|j|WnYnX|	dddy|j
jjj
}|||WnYnXdS)NrWrKzinsert linestartzinsert lineend +1char)r8rBr rXrYrZrPr6remove
tag_remover<rSrTrr;)r4r[r8r r!rUr"r"r#r;s"z)PyShellEditorWindow.clear_breakpoint_herecCsd|jr`|j}|jj}|s$|dSg|_|ddty|jjj	j
}||WnYnXdS)NrKz1.0)r6r8rBr rXr]ZENDr<rSrTrclear_file_breaks)r4r8r rUr"r"r#r^sz%PyShellEditorWindow.clear_file_breaksc
Cs|j}|jj}y$t|jd}|}WdQRXWntk
rJg}YnXynt|jdX}x$|D]}||dsb||qbW|	|j}|r||dt
|dWdQRXWnTtk
r}z4t|jddsd|j_
tjdd	t
||jd
Wdd}~XYnXdS)Nrw=
breakpoint_error_displayedFTz
IDLE Errorz$Unable to update breakpoint list:
%s)titlerr)r6rBr openrA	readlinesr
startswithrupdate_breakpointsstrgetattrrootrctkMessageBox	showerrorr8)r4Zbreaksr fplinesZnew_filererrr"r"r#store_file_breakss.

(z%PyShellEditorWindow.store_file_breaksc	Cs|j|jdkrdS|jj}|dkr,dStj|jrt|jd}|	}WdQRXxJ|D]B}|
|dr`t|t|dd}x|D]}|
|qWq`WdS)Nr_rar)r8r.rBr r>r?isfilerArerfrgevallenrV)r4r rnrorZbreakpoint_linenumbersZbreakpoint_linenumberr"r"r#r3
s



z'PyShellEditorWindow.restore_file_breakscCs$|j}|d}||}||_dS)NrK)r8Z
tag_rangesranges_to_linenumbersr6)r4r8rangesZlinenumber_listr"r"r#rhs

z&PyShellEditorWindow.update_breakpointscCsjg}x`tdt|dD]L}tt||j}tt||dj}x||kr`|||d7}qDWqW|S)Nrr)rangertrYrZstringrR)r4rvrorPr!endr"r"r#ru%s

z)PyShellEditorWindow.ranges_to_linenumberscCs|t|dS)N)r^r_close)r4r"r"r#r{6szPyShellEditorWindow._close)T)N)N)__name__
__module____qualname__r7rmenu_specsrCrVr:r;r^rqr3rhrur{r"r"r"r#r2~s"

	
*r2c@seZdZeZdZdddZdS)PyShellFileListNcCs8|jr|jjnt||_|jr2|js2dS|jS)N)rStopwakeupPyShellbegin)r4r[r"r"r#r=Es

zPyShellFileList.open_shell)N)r|r}r~r2rrSr=r"r"r"r#r<src@s,eZdZddZddZddZddZd	S)
ModifiedColorDelegatorcCst||dS)N)rr7LoadTagDefs)r4r"r"r#r7Ss
zModifiedColorDelegator.__init__cCs*|ddd|dddt|dS)NZTODOz1.0iomarkZSYNC)r]rOrrecolorize_main)r4r"r"r#rWsz&ModifiedColorDelegator.recolorize_mainc	CsJt|t}|jdddt|dt|dt|dddS)N)rJrIstdoutstderrconsole)stdinrrr)rrr
rLtagdefsr.rM)r4rNr"r"r#r\s


z"ModifiedColorDelegator.LoadTagDefscCs"x|jD]}||ddqWdS)Nrrz)rr])r4tagr"r"r#removecolorsfsz#ModifiedColorDelegator.removecolorsN)r|r}r~r7rrrr"r"r"r#rPs
rc@s eZdZdddZdddZdS)ModifiedUndoDelegatorNcCsLy"|j|ddr |jdSWntk
r6YnXt||||dS)N<r)delegatecomparerXTclErrorrrW)r4rPcharstagsr"r"r#rWns
zModifiedUndoDelegator.insertcCsJy"|j|ddr |jdSWntk
r6YnXt|||dS)Nrr)rrrXrrdelete)r4Zindex1Zindex2r"r"r#rws
zModifiedUndoDelegator.delete)N)N)r|r}r~rWrr"r"r"r#rks
	rc@seZdZddZdS)MyRPCClientcCstdS)N)EOFError)r4r"r"r#
handle_EOFszMyRPCClient.handle_EOFN)r|r}r~rr"r"r"r#rsrcCs^d|pdd}|t|krNt|t|d\}}||d||dS|ddSdS)Nz= RESTART: ZShellz =rwra)rtdivmod)widthr rZdivmodr"r"r#restart_lines
rc@seZdZddZdZdZdZddZddZdd	Z	d?dd
Z
ddZddZddZ
ddZd@ddZdZddZdZddZddZddZd d!Zd"Zd#d$ZdAd%d&Zd'd(Zd)d*Zd+d,ZdBd-d.Zd/d0Zd1d2Zd3d4Z d5d6Z!d7d8Z"d9d:Z#d;d<Z$d=d>Z%dS)CModifiedInterpretercCsB||_tjdj}tj||dd|_d|_t|_	|j
jj|_
dS)Nr)localsF)	tkconsolesysmodules__dict__r	r7
restartingsubprocess_arglistPORTportcompilecompilerflagsoriginal_compiler_flags)r4rrr"r"r#r7szModifiedInterpreter.__init__NcCs&|jdkr||_t|j|_dS)N)rbuild_subprocess_arglist
subprocessPopen
rpcsubproc)r4r"r"r#spawn_subprocesss

z$ModifiedInterpreter.spawn_subprocesscCsJddtjD}tjdddddd}d	|f}tjg|d
|t|jgS)NcSsg|]}d|qS)z-Wr").0sr"r"r#
<listcomp>sz@ModifiedInterpreter.build_subprocess_arglist.<locals>.<listcomp>mainGeneralzdelete-exitfuncFbool)defaulttypez&__import__('idlelib.run').run.main(%r)z-c)rwarnoptionsr
	GetOption
executablerir)r4r`Z	del_exitfZcommandr"r"r#rs



z,ModifiedInterpreter.build_subprocess_arglistc	CsZt|jf}xLtdD]4}t|yt||_PWqtk
rFYqXqW|dS|jj	
d|_tdkr|jj	t
jt
jd||jj	dy|jWnt
jk
r|dSX|jd|j|jd|jj|jd|jj|jd|jj|jd	|jj|jd
t|jd||jdd
||jS)Nrr
rrrrr<r*rTT)with_cwd)HOSTrrxtimeZsleeprrpccltrdisplay_port_binding_errorlistening_sockZgetsocknamerZ
setsockoptsocketZ
SOL_SOCKETZSO_REUSEADDRrZ
settimeoutaccepttimeoutdisplay_no_subprocess_errorregisterrrrrr<r*
transfer_pathpoll_subprocess)r4Zaddrir"r"r#start_subprocesss>




z$ModifiedInterpreter.start_subprocessFrHcCs0|jr|jSd|_|}|r<yt|jWnYnX|j||j}|j}d|_|	y|j
Wntjk
r|
dSX|j|d||jdd|d|t|j||jdd|jdd|s||rt|j||j|jj_d|_|jS)	NTF)rrzend-1crbrestartleft)rrgetdebuggerrZclose_subprocess_debuggercloseterminate_subprocessr	executingrrrrrr
stop_readliner8rrrrmark_setmark_gravity
showpromptZrestart_subprocess_debuggerload_breakpointsrrrr)r4rr rUrZ
was_executingr"r"r#restart_subprocesssF

z&ModifiedInterpreter.restart_subprocesscCs|jdddidS)NexecZinterrupt_the_serverr")rZ
remotecall)r4r"r"r#Z__request_interruptsz'ModifiedInterpreter.__request_interruptcCstj|jddS)N)target)	threadingZThread'_ModifiedInterpreter__request_interruptstart)r4r"r"r#interrupt_subprocesssz(ModifiedInterpreter.interrupt_subprocesscCs~|jdk	r|jj|jy|jjWntk
r>YnXy|jWntk
rbYnX|d|j_	d|_dS)NF)
_afteridrr8Zafter_cancelrrrrrr)r4r"r"r#kill_subprocesss
z#ModifiedInterpreter.kill_subprocesscCsLy|jWntk
r"dSXy|jWntk
rFdSXdS)N)rkillrwait)r4r"r"r#r!sz(ModifiedInterpreter.terminate_subprocesscCs2|rdg}|tjntj}|d|fdS)NrHzRif 1:
        import sys as _sys
        _sys.path = %r
        del _sys
        
)extendrr?
runcommand)r4rr?r"r"r#r.sz!ModifiedInterpreter.transfer_pathc
Cs6|j}|dkrdSy|j|jdd}Wn2tttfk
rX|jjrHdSd}|YnX|r|j	d|_|\}}|jj
}|dkr|dk	rtt||dnH|dkr|j
dr|n*|dkrd}t||tjdt|||dy|jWntk
rYnX|jjs2|jj|jj|j|_dS)	Ng?)rZOK)rZ	EXCEPTIONz<<toggle-jit-stack-viewer>>ERRORz/pyshell.ModifiedInterpreter: Subprocess ERROR:
)rZpollresponse
active_seqrrKeyboardInterruptrclosingrresetoutputrprintreprgetvarremote_stack_viewerr
__stderr__endexecutingrr8afterpollintervalrr)r4ZcltresponseZhowZwhatrerrmsgr"r"r#r=s@


z#ModifiedInterpreter.poll_subprocesscCs
||_dS)N)r)r4rr"r"r#setdebuggereszModifiedInterpreter.setdebuggercCs|jS)N)r)r4r"r"r#rhszModifiedInterpreter.getdebuggercCs|jjd|jdS)Ni,)rr8rr)r4r"r"r#open_remote_stack_viewerks
z,ModifiedInterpreter.open_remote_stack_viewercCsddlm}|jdddi}|dkr6|jjdS||j|}ddlm	}m
}t|jj}t
}t|dd}|||dd	}	|	jjd
dd||	jd|}
|
dS)
Nr)
debugobj_rrZstackviewer)r<)ScrolledCanvasTreeNodeZnormalrJ)bgZhighlightthicknessrZboth)expandfill)idlelibrrremotequeuerrkrXZStubObjectTreeItemZidlelib.treerrZToplevelr
rLrMframepackZcanvasr)r4rZoiditemrrrrNrJZscZnoder"r"r#rxsz'ModifiedInterpreter.remote_stack_viewerrcCs||}|||dS)N)stuffsourceexecfile)r4sourcer r"r"r#
execsources
zModifiedInterpreter.execsourcec	Cs|dkrFt|.}|}tr<dtj|d|d}WdQRXyt||d}WnHtt	fk
r|j
td|j
j
dt|||j
YnX||dS)Nz__file__ = r'''z'''
z
del __file__rzB*** Error in script or command!
Traceback (most recent call last):)r)tokenizerereaduse_subprocessr>r?abspathr
OverflowErrorSyntaxErrorrrrrr	showsyntaxerrorrruncode)r4r rrncoder"r"r#rs&
zModifiedInterpreter.execfilecCs||}t|||S)N)rr		runsource)r4rr r"r"r#rs
zModifiedInterpreter.runsourcecCs>d|j}|jd|_|d}t|dd||ftj|<|S)Nz<pyshell#%d>rrbr)gidsplitrtr*r+)r4rr ror"r"r#rs


zModifiedInterpreter.stuffsourcecCs|d|fdS)Na(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
            
)r)r4r r"r"r#prepend_syspathsz#ModifiedInterpreter.prepend_syspathcCs|j}|j}|dddt\}}}t|ddp:|p:d}t|ddpJd}t|d	dpZd
}	|	d
krl|d7}|dkrd|	d}
nd|d|	df}
|||
||d
||	dS)Nrz1.0rzmsgrHz<no detail available>r!roffsetrziomark + %d charsz&iomark linestart + %d lines + %d charszSyntaxError: %s
)
rr8r]rexc_inforjZcolorize_syntax_errorrrr)r4r rr8rvaluetbrr!rposr"r"r#r
s"z#ModifiedInterpreter.showsyntaxerrorcCs6|j|t||jdr2|jdS)Nz<<toggle-jit-stack-viewer>>)rrchecklinecacher	
showtracebackropen_stack_viewer)r4r"r"r#rs


z!ModifiedInterpreter.showtracebackcCsBtj}x6t|D]&}|dd|dddkr||=qWdS)Nrr)z<>)r*r+r,keys)r4cr0r"r"r#rsz"ModifiedInterpreter.checklinecachecCs@|jjr|dS|jr0|jdd|fint||jdS)Nrrrr)rrdisplay_executing_dialogrrrr)r4rr"r"r#rszModifiedInterpreter.runcommandcCsN|jjr|j||j}zyT|j|sT|jdk	rT|jdd|fi|_	n |rh|
||jnt||jWnt
k
r|jjstjddd|jjdrq|nYn`trtd|jjd||jn,|jjr
d	|j_td
|jjdn|YnXWdtsHy|jWntk
rFYnXXdS)NrrzExit?zDo you want to exit altogether?Zyes)rrz IDLE internal error in runcode())rFr)rrrTrrrbeginexecutingrZ
asyncqueuerrunrr
SystemExitrrlZaskyesnor8rr	rrrcanceledr)r4rrr"r"r#rsJ




zModifiedInterpreter.runcodecCs|jj|S)N)rrr)r4rr"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)rlrmrr8)r4r"r"r#r'sz.ModifiedInterpreter.display_port_binding_errorcCstjdd|jjddS)NzSubprocess Connection ErrorzIDLE'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-failure)r)rlrmrr8)r4r"r"r#r2sz/ModifiedInterpreter.display_no_subprocess_errorcCstjdd|jjddS)NzAlready executingzYThe Python Shell window is already executing a command; please wait until it is finished.)r)rlrmrr8)r4r"r"r#r:sz,ModifiedInterpreter.display_executing_dialog)FrH)F)N)N)&r|r}r~r7rrrrrrrrrrrrrrrrrrrrrrrrrr
rrrrrrrrr"r"r"r#rsF	+
,

&

	
.rcseZdZdedZeZeZddddddgZ	e
jd	gZd
Zddl
mZdTddZddZd
Zd
Zd
Zd
Zd
Zd
ZddZddZdUddZddZdVddZddZddZd d!Zd"d#Zd$d%Z d&d'Z!d(d)Z"d*d+Z#d,Z$d-d.Z%d/d0Z&d1d2Z'd3d4Z(dWd5d6Z)d7d8Z*d9d:Z+d;d<Z,d=d>Z-d?d@Z.dXdAdBZ/dYdCdDZ0dZdEdFZ1dGdHZ2dIdJZ3dKdLZ4d[dNdOZ5fdPdQZ6fdRdSZ7Z8S)\rzPython z Shell)rZ_File)ZeditZ_Edit)rUZ_Debug)optionsZ_Options)ZwindowZ_Window)helpZ_Help)ZSqueezez<<squeeze-current-text>>Fr)HistoryNcCs$tr&|j}|dddkr&|ddt||_|dkrVt}t||t|}t	
||ddd|_d|_t
tdrtjnd|_|jd	d
|_|j|_|j}|jdd|d
|j|d|j|d|j|d|j|d|j|d|j|d|jtr8|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_&yddl/}|j0|_1Wntj2t_$YnX|3|j|_4d|_5dS)Nrwrshell)r'ZShe_llTps1z>>> rbr)char)wrapz<<newline-and-indent>>z<<plain-newline-and-indent>>z<<interrupt-execution>>z<<end-of-file>>z<<open-stack-viewer>>z<<toggle-debugger>>z<<toggle-jit-stack-viewer>>z<<view-restart>>z<<restart-shell>>z<<squeeze-current-text>>)iomenurrrbackslashreplacer2)6r	
menu_specsrWrrTTkrwithdrawrrr7ZusetabsZindentwidthhasattrrr)sys_ps1rZprompt_last_linepromptr8Z	configurer9enter_callbacklinefeed_callbackcancel_callbackeof_callbackrtoggle_debuggertoggle_jit_stack_viewerview_restart_mark
restart_shellZSqueezerZsqueeze_current_text_eventrsave_stdoutrsave_stderrr
save_stdinrr,rencodingerrorsrrpydocZ
plainpagerZpagerrr&historyr)r4r<msrkr8Zsqueezerr,rBr"r"r#r7^sn

zPyShell.__init__cCstjddS)NT)Z
shell_only)r
Z
GetExtensions)r4r"r"r#get_standard_extension_namessz$PyShell.get_standard_extension_namescCs|adS)N)r)r4streamr"r"r#set_warning_streamszPyShell.set_warning_streamcCstS)N)r)r4r"r"r#get_warning_streamszPyShell.get_warning_streamcCsH|jr$tjdd|jd|dS|j}|r<|n|dS)NzDon't debug nowz*You can only toggle the debugger when idle)rrG)	rrlrmr8set_debugger_indicatorrTrclose_debugger
open_debugger)r4r[dbr"r"r#r9s


zPyShell.toggle_debuggercCs|j}|d|dS)Nz<<toggle-debugger>>)rTrZsetvar)r4rLr"r"r#rIs
zPyShell.set_debugger_indicatorcCsdS)Nr")r4r[r"r"r#r:szPyShell.toggle_jit_stack_viewercCsh|j}|r\|jd||jjr8t|jj||j	d|j
|_||
dS)Nz[DEBUG OFF]
)rTrrrrrZclose_remote_debuggerrrrr3r4rrI)r4rLr"r"r#rJs
zPyShell.close_debuggercCsX|jjrt|jj|}n
t|}|j||d|j|_	|
|dS)Nz[DEBUG ON]
)rTrrZstart_remote_debuggerrZDebuggerrrr3r4rrI)r4Zdbg_guir"r"r#rKs

zPyShell.open_debuggercCs|d|_dS)NT)rr)r4r"r"r#r szPyShell.beginexecutingcCsd|_d|_|dS)NF)rr#r)r4r"r"r#rszPyShell.endexecutingcCsD|jr&tjddd|jd}|dkr&dS|d|_d|_t|S)NzKill?z7Your program is still running!
 Do you want to kill it?ok)rrFZcancelT)	rrlZaskokcancelr8rr#rrr)r4rr"r"r#rs
z
PyShell.closecCsV|tr|j|jt_|jt_|j	t_
d|_d|_d|j_
d|_t|dS)N)rJr	rTrr=rrr>rr?rrr<rSrCrr{)r4r"r"r#r{s
zPyShell._closecCsdS)NTr")r4r r"r"r#ispythonsource
szPyShell.ispythonsourcecCs|jS)N)shell_title)r4r"r"r#short_titleszPyShell.short_titlezHType "help", "copyright", "credits" or "license()" for more information.cCs|jdd|tr:d}|j}|sF|dSnd}tjt	_|
dt	jt	j|j
|f|j|ddl}d|_dS)	NrrWrHFz==== 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)r8rrr	rTrrrdisplayhookrrversionplatform	COPYRIGHTZfocus_forcertkinterZ
_default_root)r4ZnosubZclientrUr"r"r#rs"

z
PyShell.begincCs|js
dSd|_|jdS)NT)reading_stop_readline_flagrquit)r4r"r"r#r,szPyShell.stop_readlinecCs|j}zd|_|jWd||_X|jr4d|_dS|jdd}t|dkrRd}||jrnd|_t	snt
|jr~d|_d}|S)NTFrHrzend-1crrb)rVrmainlooprWr8getrtrr#r	r	endoffile)r4r/rr"r"r#readline2s(zPyShell.readlinecCsdS)NTr")r4r"r"r#isattyIszPyShell.isattycCsy|jdddrdSWnYnX|jsR|jsR||jd|dSd|_d|_	|jr|jj
r|jr|jn
|j
|jr|jdS)Nz	sel.firstz!=zsel.lastzKeyboardInterrupt
rGFT)r8rrrVrrTrrr[r#rrrrrrX)r4r[r"r"r#r7Ls&


zPyShell.cancel_callbackcCsf|jr|jsdS|jdddr0|jddds4dS|jsL||nd|_d|_|j	dS)Nrz==rWzend-1cFTrG)
rrVr8rrrr#r[rrX)r4r[r"r"r#r8bs

zPyShell.eof_callbackcCs0|jr"|jdd|jdn
||dS)NrWrbrG)rVr8rWseenewline_and_indent_event)r4r[r"r"r#r6qs

zPyShell.linefeed_callbackcCs8|jr|jsdSy6|jdd}|rD|jdddrD|||dSWnYnX|jdddrV|jd	d}|r|jdd|d
r||j|d|d
|dS|jd	d}|r|jdd
|dr||j|d|d
|dS|jdd}|r<|j|dddr<||j|d
d|n||jdd|dS|jdddrv|jdd|jdd}|r|	s|j
dd|jdddr||dS|jdd|jr|jdd|j
dn
|||jd	dd|j|jr,|jn|dS)Nz	sel.firstzsel.lastz<=rrGrWrziomark linestartrrrzinsert lineendz>=rzinsert linestartzend-1czend-1c linestartrb)rrVr8rZrrecallZ
tag_prevrangeZ
tag_nextrangerstriprr_rWr^rOZupdate_idletasksrrXrunit)r4r[selprevnextindicesrr"r"r#r5zsX


zPyShell.enter_callbackc	Cs<tdd|}tdd|}|d}|jz|jddd|jdd	|jd
d}|	dr|
||jd
d}|jd|dt
|d
krtd|dd}td|d}xJ|d
dD]:}||r||t
|d}|jdd|qWWd|jd|jXdS)Nz^\s*\nrHz\n\s*$rbrcz1.0rzrWzend-1czinsert linestart:rrz	^([ \t]*))resubrr8Zundo_block_startr]rrZrstripendswithr_rWrartsearchgrouprgr^Zundo_block_stop)r4rr[roprefixZorig_base_indentZnew_base_indentrr"r"r#r`s*


zPyShell.recallcCs|jdd}t|}x$|dkr:||ddkr:|d}qW|dkr\||ddkr\|d}x$|dkr||ddkr|d}q^W|d|}|j|dS)Nrzend-1crrz 	rb)r8rZrtrTr)r4rrr"r"r#rbsz
PyShell.runitcCsX|jjr|jSy
tjWntjdd|jddSddlm	}||j
|jdS)NzNo stack tracez@There is no stack trace yet.
(sys.last_traceback is not defined))rr)StackBrowser)rTrrrlast_tracebackrlrmr8Zidlelib.stackviewerrorkr<)r4r[ror"r"r#rs


zPyShell.open_stack_viewercCs|jd|jddS)Nrr)r8r^)r4r[r"r"r#r;szPyShell.view_restart_markcCs|jjdddS)NT)r)rTr)r4r[r"r"r#r<szPyShell.restart_shellcCs:||j|j|jdd||jdS)NrWzend-1c)	rrrr4r8rset_line_and_columnrBZ
reset_undo)r4r"r"r#rs
zPyShell.showpromptcCsP|jjj}t|ddd}d||}|ds:|d7}|jj	d|ddS)Nr(T)rtabsizeZexpand_tabsrbziomark linestartr)
rTrrrr@r+rkZperZbottomrW)r4rrwrapperZwrapped_msgr"r"r#show_warnings

zPyShell.show_warningcCsb|jdd}|jr |j||jddkr>|jdd|jdd||jdS)Nrzend-1czend-2crb)	r8rZrCstorerWrrqZctipZremove_calltip_window)r4rr"r"r#rszPyShell.resetoutputr"cCsXy0|jddt|||d}|jddWnYnX|jrTd|_tsTt|S)NrrightrF)r8rrrr#r	r)r4rrcountr"r"r#rsz
PyShell.writecs8y|jdddrdSWntk
r,dSXtS)Nz	sel.firstrrdisabled)r8rrsuperrE)r4)	__class__r"r#rEszPyShell.rmenu_check_cutcs|jdddrdStS)NrWrrrx)r8rryrF)r4)rzr"r#rF&szPyShell.rmenu_check_paste)N)N)N)N)N)N)N)r")9r|r}r~r
rOrrrrr/rrZallow_line_numbersZidlelib.historyr&r7rErVrr#r[rrWrGrHr9rIr:rJrKr rrr{rNrPrTrrr\r]r7r8r6r5r`rbrr;r<rrtrrrErF
__classcell__r"r")rzr#rBsl
C



	?




rc
Cs6|jdkr2x&dD]}||dd||dqWdS)NZx11)ZTextZEntryZSpinboxz	<<Paste>>z%catch {%W delete sel.first sel.last}
)Z_windowingsystemZ
bind_class)rkclsr"r"r#
fix_x11_paste,s

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
snddl}ddlm}ddlm}ddlm}tddad}d}d}d}d}d}	y|tj	ddd\}
}WnD|j
k
r}z$td	|tftj
d
tdWdd}~XYnXx|
D]\}
}|
dkr|}d}|
d
krd}d}|
dkrd}|
dkrtjtt|
dkrd}|
dkr6tdtj
d
da|
dkrj|}tj|rTntd|td}|
dkr|d}	d}|
dkr|t_d}qW|r|ddkrtj}d}x0tttjD]}tjtj|tj|<qW|r|ddkrdg|ddt_	n|r$dg|t_	n|r8|g|t_	n|rd}g}x |D]}|tj|qLWxX|D],}tj|}|tjkrntjd|qnWn"t}|tjkrtjd|tj ddddd}|p|}|p|}tr|st!t"dda#t#$dd l%m&}|t#tj'tjt(d!|d"kr`tj'd#}t#j)|d$nV|*st+d%kr~d&d'}nd(d)}fd*d+|D}d,d+|D}t#j,d0|t-t#t.t#t/t#a0|1t#t0|r,|s,|s,x0|ddD] }t02|dkr|3|qW|s,t04|rbt05}|sDdS|*rht0j6rh|j78nt0j9}|rv|:|	rtj;<d-ptj;<d.}|rtj|r|j=>||s|r
|j=?d/tj	f|r|j=@|n|rB|j=A||j=>|n8|rB|Bt#}|r*|C||D}|rB|C|xt0jErXt#FqDWt#GtddS)1Nr)system)testing)macosxTFrzc:deihnr:st:zError: %s
%s)rrwz-cz-dz-ez-hz-iz-nz: Warning: running IDLE without a subprocess is deprecated.z-rzNo script file: z-sz-t-rHrrzeditor-on-startupr)rZIdle)Z	className)rZIconsZWindowszidle.ico)rg333333!@z.png) 0z.gif)rrrcs"g|]}tjd|fqS)z	idle_%d%s)r>r?r@)rsize)exticondirr"r#rszmain.<locals>.<listcomp>cSsg|]}tt|dqS))Zmasterr)Z
PhotoImagerk)riconfiler"r"r#rsZIDLESTARTUPZ
PYTHONSTARTUPzbif 1:
            import sys as _sys
            _sys.argv = %r
            del _sys
            
)T)HgetoptrSr~rrrr(r	rargverrorr	usage_msgrexitrrr>r?rrrrOrrrxrtr
rRdirnamerWgetcwdr
rZ
NoDefaultRootr0rkr1idlelib.runrr@__file__Z
wm_iconbitmapZisAquaTk	TkVersionZwm_iconphotorr}rr<ZsetupApprer\newr=dictrlowerrSrKenvironrZrTrrrrZtkVersionWarningrtZpreferTabsPreferenceWarningZinversedictrYZdestroy)rr~rrZenable_shellZenable_editrUcmdZscriptZstartupZoptsrDroarZpathxr dirZ
edit_startrrZsizesZ	iconfilesZiconsr'ZtkversionwarningZprefer_tabs_preference_warningr")rrr#rms


















rF)NN)Prr|rrUImportErrorrrr"rSZctypesZPROCESS_SYSTEM_DPI_AWAREZOleDLLZSetProcessDpiAwarenessrrZtkinter.messageboxZ
messageboxrlrr0rkr1rrrmrr	r*r>Zos.pathr
rhrrtextwraprrrrr&Zidlelib.colorizerrZidlelib.configr
rrrZidlelib.editorrrZidlelib.filelistrZidlelib.outwinrrrrrZidlelib.undorrrrr$r%r(
checkcacher1r2rrrZ	RPCClientrrrrr}rrr"r"r"r#<module>s



?0m?6