python (3.12.0)

(root)/
lib/
python3.12/
idlelib/
__pycache__/
iomenu.cpython-312.opt-2.pyc

̑ec>.ddlZddlZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZddl
mZdjdeDZd	Zej"d
k(rdndZGd
dZdZedk(r ddlmZedddddlmZeeyy)N)
filedialog)
messagebox)	askstring)idleConf)
py_extensions c#&K|]	}d|zyw)*N).0exts  B/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/idlelib/iomenu.py	<genexpr>rs:SS:sutf-8win32
surrogatepasssurrogateescapeceZdZdZdZdZdZdZdZdZ	dZ
dZdZdd	Z
ejZd
ZdZdZd
ZdZdZdZdZdZdZdZdedfddfZej>dk(rdndZ dZ!ddZ"dZ#dZ$y) 	IOBindingc||_|j|_|jjd|j|_|jjd|j
|_|jjd|j|_|jjd|j|_
d|_|jjd|j|_
y)N<<open-window-from-file>><<save-window>><<save-window-as-file>><<save-copy-of-window-as-file>>r<<print-window>>)editwintextbindopen_IOBinding__id_opensave_IOBinding__id_savesave_as_IOBinding__id_saveassave_a_copy_IOBinding__id_savecopyfileencodingprint_window_IOBinding__id_print)selfrs  r__init__zIOBinding.__init__sLL	(CTYYO(9499E99>>*C*.,,8!YY^^,M,0,<,<>#))..);T=N=NOc|jjd|j|jjd|j|jjd|j|jjd|j
|jjd|jd|_d|_d|_y)Nrrrrr)	runbindr r"r$r&r)rfilename_change_hookr*s rclosezIOBinding.close%s		4dnnE		*DNN;		243C3CD		:D<N<NO		+T__=	$(!r,c6|jjSN)r	get_savedr0s rr4zIOBinding.get_saved1s||%%''r,c:|jj|yr3)r	set_savedr*flags  rr6zIOBinding.set_saved4st$r,c8|jjyr3)r
reset_undor0s rr:zIOBinding.reset_undo7s!r,Nc||_yr3)r/)r*hooks  rset_filename_change_hookz"IOBinding.set_filename_change_hook<s
$(!r,c|r.tjj|rd|_||_y||_d|_|jd|jr|j
yy)N)ospathisdirfilenamedirnamer6r/r*rCs  rset_filenamezIOBinding.set_filenameBsV

h/ DM#DL$DMDLNN1(())+)r,c|jj}|r|s|j}n|}|rn|jrPt|jdds9|js-|jr|j
||jy|j
|y|jr|jjy|jr0|j}|dk(r|jjy|s|j}n|}|r|j|y|jjy)Ninterpbreakcancel)rflistaskopenfilegetattrrCr4rloadfiler	focus_set	maybesave)r*eventeditFilerKrCreplys      rrzIOBinding.openMs""++-!LL#DLL(DA MM(JJx7	JJx(99II'')>>NN$E 		##%'')HHMM(#
II!r,c		tj|5}|j}|j}|j}d}dddtts6|$tj dd
|j	d}t"j$}|jj'dd|j)d|_||_|jj/d|j1|j)|r|j3d|jj5dd|jj7d|j9|y#1swY$xYw#t
tf$r|jjjtddd|jj}t||5}|j}|j}|j}d}dddn#1swYnxYwYwxYw#t$r5}tjdt||j	Yd}~yd}~wt
$r(tjd
d|z|j	YywxYw)NFzSpecify file encodingzwThe file's encoding is invalid for Python 3.x.
IDLE will convert it to UTF-8.
What is the current encoding of the file?r)initialvalueparent)encodingT	I/O ErrorrVzDecoding ErrorzFile %s
Failed to DecodezMixed Newlinesz:Mixed newlines detected.
The file will be changed on save.1.0endinsert)tokenizerreadrWnewlinesUnicodeDecodeErrorSyntaxErrorrrupdaterOSErrorr	showerrorstr
isinstanceshowwarningr@linesepdeleterFr'eol_conventionr\r:r6mark_setyviewupdaterecentfileslist)	r*rCfcharsr'rj	convertedencerrs	         rrNzIOBinding.loadfile{s(	
%]]8,&FFHE#$::L%&ZZN %I	&:.#.)&&'7*M04		;!	ZZN		&$(,		&(#
NN5!		8U+		!""8,m&&
'4
%!!((*+@")<<,,
.(S1%QFFHE#$::L%&ZZN $I	%%%
%	  c#htyyI!	  !1#>#I*.))
5		seE2+E%E2%E/*E22A#H+H		H	H	HHHH	J	%+I1J	J	cB|jryd|jxsdz}tjd|tj|j
}|r&d}|j
d|js
d}n|d}nd}|j
j|S)Nyesz&Do you want to save %s before closing?zthis untitled documentz
Save On ClosetitlemessagedefaultrVrJno)r4rCraskyesnocancelYESrr!rO)r*rwconfirmrSs    rrPzIOBinding.maybesaves>>:MM557++'!$..	$
EIIdO>># 
_EE		r,c |js|j|nG|j|jr,|jd	|jj|jjy#t$rY&wxYw)NTrI)	rCr#	writefiler6rstore_file_breaksAttributeErrorrrOr*rQs  rr!zIOBinding.saveso}}LL~~dmm,t$LL224	
		&sB	B
B
c8|j}|rN|j|r=|j||jd	|jj|jj|j|y#t$rY7wxYw)Nr?rI)
asksavefiler~rFr6rrrrrOrmr*rQrCs   rr#zIOBinding.save_ass##%~~h'!!(+q!LL224	
		""8,	&sB

	BBc|j}|r|j||jj|j	|y)NrI)rr~rrOrmrs   rr%zIOBinding.save_a_copys@##%NN8$		""8,r,c|j}|j|}	t|d5}|j||j	tj|jdddy#1swYyxYw#t$r5}tjdt||jYd}~yd}~wwxYw)NwbTrXrYF)
fixnewlinesencoderwriteflushr@fsyncfilenorcrrdrer)r*rCrrornmsgs      rr~zIOBinding.writefiles!D!		h%
%	$
%	
%	  c#h*.))
5	s5B	AA=4B	=BB	B			C+CCc	t|jdr6|jjd|jj	d}nV|jjddk7r|jj
dd|jjdd}|jdk7r|jd|j}|S)NrHrZzend-1czend-2c
)	hasattrrget_prompt_textrindexgetr\rjreplacer*rs  rrzIOBinding.fixnewliness	
4<<*<<//tyyx7PQDyy}}X&$.		  4099==1D$&<<d&9&9:Dr,c&t|tr|S|jdk(r|jdS	|jdS#t$rYnwxYw	|jdd}tjtj|j\}}|j|S#t$r}t|}Yd}~nd}~wt$rdz}YnwxYwtjdd|z|j|jdS)Nz	utf-8-sigasciirzInvalid encoding '%s'rXz%s.
Saving as UTF-8rY)rfbytesr'rUnicodeEncodeErrorr]detect_encodingioBytesIOreadlinerarerrdr)r*roencodedrq_rrfaileds       rrzIOBinding.encode
seU#L+<<,,	<<((!			3ll7I6G--bjj.A.J.JKFC<<$$	XF!	3,s2F	3"V+99	||K((s0A	AAAB--	C6CCCctjddtj|j}|s|jj	yd}|j}|r|j}|rWtjd\}}|}tj||j|stj|ytj}d}|dk(rtjd	d
d}	|	dz}	n|d
k(rtjd	d
d}	nd}|r	t!j"|z}	tj$|	d}
|
j'j)}|
j}|rd|z|z}|r[dt+|	z|z}tj,d||jn'd|z}
tj.d|
|j|rtj|y)NPrintzPrint to Default PrinterrurI	IDLE_tmp_)prefixTposixmainGeneralzprint-command-posixz 2>&1ntzprint-command-winFrz#Printing failed (exit status 0x%x)
zPrinting command: %s
zPrint statusrYz-Printing is not enabled for this platform: %s)raskokcancelOKrrOr4rCtempfilemkstempr@r1r~unlinknamer	GetOptionshlexquotepopenr^stripreprrdshowinfo)r*rQr|tempfilenamesavedrCtfdplatform
printPlatformcommandpipeoutputstatusrws              rr(zIOBinding.print_window,s((4$--	$
II! }}H("*"2"2+"FS,#HHHSM>>,/		,'77
w((	)>@G'G

((	:MNG!MH 55G88GS)DYY[&&(FZZ\F? "()1DMAFJ$$^VDIINEPG		JIIl#r,zPython filesTEXT)z
Text filesz*.txtr)z	All filesr
darwinz.pyc|jd\}}|js0tj|j|j
|_|jj
||}|S)Nr)rV	filetypes
initialdirinitialfile)defaultfilename
opendialogrOpenrrshowr*dirbaserCs    rrLzIOBinding.askopenfileisY((0	T(ooTYY:>..JDO??''3D'Ir,c|jr)tjj|jS|jr|jdfS	tj
}|dfS#t$rd}Y|dfSwxYw)Nr)rCr@rAsplitrDgetcwdrc)r*modepwds   rrzIOBinding.defaultfilenameqsp==77==//
\\<<##
iik7N
7N
sA))A:9A:c|jd\}}|js;tj|j|j
|j|_|jj||}|S)Nr!)rVrdefaultextensionr)r
savedialogrSaveAsrrrrrs    rrzIOBinding.asksavefile}sf((0	T(//99"nn%)%:%:<DO??''3D'Ir,cj	|jjr|jj|yyr3)rrKupdate_recent_files_listrEs  rrmzIOBinding.updaterecentfileslists)7<<LL11(;r,)NN)r)%__name__
__module____qualname__r+r1r4r6r:r/r=rCrDrFrr@rhrjrNrPr!r#r%r~rrr(rrrrsysrrrLrrrmrr,rrrs

P
)(%" )HG	,*XZZN9v, )>0dJJ
/'
I!$ 8ub
<r,rchddlm}m}||}|jdt	t
|j
jddd\}}|j
d||dzfzGdd	}||}|j|j||}t|y)
Nr)ToplevelTextzTest IOBinding+r?z+%d+%dcBeZdZdZdZdZdZdZdZdZ	dZ
d	Zy
)_io_binding.<locals>.MyEditWinc||_d|_|jjd|j|jjd|j|jjd|j
|jjd|j|jjd|jy)Nz<Control-o>z<Control-p>z<Control-s>z<Alt-s>z<Control-c>)rrKrrprintr!saveassavecopyrs  rr+z'_io_binding.<locals>.MyEditWin.__init__s~DIDJIINN=$))4IINN=$**5IINN=$))4IINN9dkk2IINN=$--8r,cy)Nrrr0s rr4z(_io_binding.<locals>.MyEditWin.get_savedsAr,cyr3rr7s  rr6z(_io_binding.<locals>.MyEditWin.set_savedr,cyr3rr0s rr:z)_io_binding.<locals>.MyEditWin.reset_undorr,c:|jjdy)Nrrevent_generaters  rrz#_io_binding.<locals>.MyEditWin.opensII$$%@Ar,c:|jjdy)Nrrrs  rrz$_io_binding.<locals>.MyEditWin.printsII$$%78r,c:|jjdy)Nrrrs  rr!z#_io_binding.<locals>.MyEditWin.savesII$$%67r,c:|jjdy)Nrrrs  rrz%_io_binding.<locals>.MyEditWin.saveassII$$%>?r,c:|jjdy)Nrrrs  rrz'_io_binding.<locals>.MyEditWin.savecopysII$$%FGr,N)rrrr+r4r6r:rrr!rrrr,r	MyEditWinrs.	9	&'"	B	9	8	@	Hr,r)tkinterrrrvmapintgeometryrpackrOr)	rVrrrootxyrrrs	         r_io_bindingrs&FDJJ sFOO%++C045DAqMM(aS\)*HH.:DIIKNNoG
gr,__main__)rzidlelib.idle_test.test_iomenuF)	verbosityexit)run)rr@rrrr]rrrtkinter.simpledialogridlelib.configridlelib.utilrjoinrWrerrorsrrrunittestridlelib.idle_test.htestrrr,r<module>rs		
*#&:M::
LLG39Jv<v<p"Hz	(AEB+r,