A/*],.ddlZddlZddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ddl mZdjdeDZd Zej"d k(rd nd ZGd dZdZedk(r ddlmZedddddlmZeeyy)N) filedialog) messagebox) askstring)idleConf) py_extensions c#&K|] }d|z yw)*N).0exts 5/opt/alt/python312/lib64/python3.12/idlelib/iomenu.py rs:MSSMsutf-8win32 surrogatepasssurrogateescapeceZdZdZdZdZdZdZdZdZ dZ dZ dZ dd Z ejZd Zd Zd Zd ZdZdZdZdZdZdZdZdedfddfZej>dk(rdndZ dZ!ddZ"dZ#dZ$y) IOBindingc||_|j|_|jjd|j|_|jjd|j |_|jjd|j|_|jjd|j|_ d|_ |jjd|j|_ y)N<><><><>r<>)editwintextbindopen_IOBinding__id_opensave_IOBinding__id_savesave_as_IOBinding__id_saveas save_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> 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)tokenizerreadrWnewlinesUnicodeDecodeError SyntaxErrorrrupdaterOSErrorr showerrorstr isinstance showwarningr@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 % !!((*+@")<<,, .(S1QFFHE#$::L%&ZZN $I 211 %   c#htyy I!   !1#>#I*.)) 5  seE2+E%E2%E/*E22A#H+H  H H HHHH J %+I1J J cB|jryd|jxsdd}tjd|tj|j }|r&|j d|jrdnd}n|dnd }|j j|S) zReturn 'yes', 'no', 'cancel' as appropriate. Tkinter messagebox.askyesnocancel converts these tk responses to True, False, None. Convert back, as now expected elsewhere. yeszDo you want to save zthis untitled documentz before closing?z Save On ClosetitlemessagedefaultrVNrJno)r4rCraskyesnocancelYESrr!rO)r*rwconfirmrSs rrPzIOBinding.maybesaves >> )mm?'?@%&++'!$.. $  IIdO!^^-E8E#*?xu  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 t j |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+CCct|jdr6|jjd|jj d}nV|jj ddk7r|jj dd|jj dd}|jdk7r|jd|j}|S)zYReturn text with os eols. Add prompts if shell else final if missing. rHrZzend-1czend-2c ) hasattrrget_prompt_textrindexgetr\rjreplacer*rs rrzIOBinding.fixnewliness 4<< *<<//tyyx7PQDyy}}X&$.   4099==1D   $ &<<d&9&9:D r,c&t|tr|S|jdk(r|jdS |jdS#t$rYnwxYw |jdd}t j 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.encodes eU #L    +<< , , <<( (!    3ll7I6G--bjj.A.J.JKFC<<$ $ XF! 3,s2F 3  "V +99  ||K((s0A AAAB-- C6 CCCctjddtj|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)r askokcancelOKrrOr4rCtempfilemkstempr@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!M  H 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 initialdir initialfile)defaultfilename opendialogrOpenrrshowr*dirbaserCs rrLzIOBinding.askopenfilejsY((0 T(ooTYY:>..JDO??''3D'Ir,c|jr)tjj|jS|jr|jdfS tj }|dfS#t $rd}Y|dfSwxYw)Nr)rCr@rAsplitrDgetcwdrc)r*modepwds rrzIOBinding.defaultfilenamersp ==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%)%:%:0dJJ /' I !$  8ub .MyEditWinc||_d|_|jjd|j|jjd|j|jjd|j |jjd|j |jjd|jy)Nz z z zz )rrKrrprintr!saveassavecopyrs rr+z'_io_binding..MyEditWin.__init__s~DIDJ IINN=$)) 4 IINN=$** 5 IINN=$)) 4 IINN9dkk 2 IINN=$-- 8r,cy)Nrr r0s rr4z(_io_binding..MyEditWin.get_savedsAr,cyr3r r7s rr6z(_io_binding..MyEditWin.set_saveds4r,cyr3r r0s rr:z)_io_binding..MyEditWin.reset_undosdr,c:|jjdy)Nrrevent_generaters rrz#_io_binding..MyEditWin.opens II $ $%@ Ar,c:|jjdy)Nrrrs rrz$_io_binding..MyEditWin.prints II $ $%7 8r,c:|jjdy)Nrrrs rr!z#_io_binding..MyEditWin.saves II $ $%6 7r,c:|jjdy)Nrrrs rrz%_io_binding..MyEditWin.saveass II $ $%> ?r,c:|jjdy)Nrrrs rrz'_io_binding..MyEditWin.savecopys II $ $%F Gr,N) rrrr+r4r6r:rrr!rrr r,r MyEditWinrs. 9 &'" B 9 8 @ Hr,r) tkinterrrrvmapintgeometryrpackrOr) rVrrtopxyrrrs r _io_bindingrs& 6 CII sFOO%++C04 5DAqLLQCL()HH. 9DIIKNNoG gr,__main__)rzidlelib.idle_test.test_iomenuF) verbosityexit)run)rr@rrrr]rrrtkinter.simpledialogridlelib.configr idlelib.utilrjoinrWrerrorsrrrunittestridlelib.idle_test.htestrr r,rr s *#&:M:: LLG39Jw<w