File "IOBinding.cpython-34.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python34/lib64/python3.4/idlelib/__pycache__/IOBinding.cpython-34.pyc
File size: 14.1 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit


e f=M@stddlZddlmZddlZddlZddlZddlZddlZddljZ	ddl
jZddl
mZy#ddlZejejdWneejfk
rYnXejZdZejdkr!y!ejdZejeWnek
rYnXnyDejejZedkpKedkrWdZnejeWnxeeefk
ryBejdZedkpedkrdZnejeWneefk
rYnXYnXej ZeZ!ej"dej#Z$ej"d	ej#Z%d
dZ&Gdd
d
Z'ddZ(e)dkrpddl*m+Z+e+e(ndS)N)BOM_UTF8)	askstringasciiwin32z%^[ \t\f]*#.*coding[:=][ \t]*([-\w.]+)z^[ \t\f]*(?:[#\r\n]|$)cCst|tr!|jd}n|}d|krR|jdddd}n4d|kr}|jdddd}n	|g}xD|D]8}tj|}|dk	rPntj|sdSqWdS|jd}ytj	|Wn"t
k
rt
d|YnX|S)aVReturn the encoding declaration according to PEP 263.

    When checking encoded data, only the first two lines should be passed
    in to avoid a UnicodeDecodeError if the rest of the data is not unicode.
    The first two lines would contain the encoding specification.

    Raise a LookupError if the encoding is declared but unknown.
    z
iso-8859-1
N
rzUnknown encoding: )
isinstancebytesdecodesplit	coding_rematchblank_regroupcodecslookupLookupError)datalinesZlstlinernamer6/opt/alt/python34/lib64/python3.4/idlelib/IOBinding.pycoding_specCs*		

rc@seZdZddZddZddZddZd	d
ZdZdd
Z	dZ
dZddZddddZ
dZejeZejZddZddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&ZdZdZ d:d;d<gZ!e"j#d.krJd/nd0Z$d1d2Z%d3d4d5Z&d6d7Z'd8d9Z(dS)=	IOBindingcCs||_|j|_|jjd|j|_|jjd|j|_|jjd|j|_|jjd|j	|_
d|_|jjd|j|_
dS)Nz<<open-window-from-file>>z<<save-window>>z<<save-window-as-file>>z<<save-copy-of-window-as-file>>z<<print-window>>)editwintextbindopen_IOBinding__id_opensave_IOBinding__id_savesave_as_IOBinding__id_saveassave_a_copy_IOBinding__id_savecopyfileencodingprint_window_IOBinding__id_print)selfrrrr__init__ns		zIOBinding.__init__cCs|jjd|j|jjd|j|jjd|j|jjd|j|jjd|jd|_d|_d|_dS)Nz<<open-window-from-file>>z<<save-window>>z<<save-window-as-file>>z<<save-copy-of-window-as-file>>z<<print-window>>)	rZunbindr"r$r&r(r+rfilename_change_hook)r,rrrclosezs		zIOBinding.closecCs
|jjS)N)r	get_saved)r,rrrr0szIOBinding.get_savedcCs|jj|dS)N)r	set_saved)r,flagrrrr1szIOBinding.set_savedcCs|jjdS)N)r
reset_undo)r,rrrr3szIOBinding.reset_undoNcCs
||_dS)N)r.)r,hookrrrset_filename_change_hooksz"IOBinding.set_filename_change_hookcCsf|r-tjj|r-d|_||_n5||_d|_|jd|jrb|jndS)Nr)ospathisdirfilenamedirnamer1r.)r,r9rrrset_filenames			
	zIOBinding.set_filenamecCs%|jj}|r|s'|j}n|}|r|jr~t|jddr~|jr~|jr~|j||jq|j|n|jr|jj	ndS|jr|j
}|dkr|jj	dSn|s|j}n|}|r|j|n
|jj	dS)NZinterpbreakcancel)rflistaskopenfilegetattrr9r0r!loadfiler	focus_set	maybesave)r,eventZeditFiler>r9replyrrrr!s6	
	

zIOBinding.openz(\r\n)|\n|\rc	CsyKt|d6}|j|j}|jd|j}WdQXWnHtk
r}z(tjdt|d|jdSWYdd}~XnX|j	||\}}|dkrtjdd|d|jdS|j
j|}|r|jd|_
|j
jd|}n|jjd	d
|jd|jjd	||j|j||r}|jdn|jjdd	|jjd|j|dS)
Nrbrz	I/O ErrorparentFzDecoding ErrorzFile %s
Failed to Decodez\nz1.0endinsertT)r!readlineseekreadOSErrortkMessageBox	showerrorstrr_decodeeol_researchreol_conventionsubZdeleter;rIr3r1Zmark_setZyviewupdaterecentfileslist)	r,r9f	two_linesrmsgcharsZ	convertedZfirsteolrrrrAs:
	





zIOBinding.loadfilec;Csd}|jtray|ddjd}Wntk
rJdSYqaXd|_|dfSnyt|}Wnctk
r}z.tjdddd	|d
|j	d}WYdd}~Xntk
rdSYnX|ry&t
||}||_|dfSWqtk
rYqXny&t
|d}d|_|dfSWntk
rUYnXy&t
|d}d|_|dfSWntk
rYnXy`|jj	jt
dd
dtd
|jj	}|rt
||}d|_n|dfSWnttfk
rYnXdS)zCreate a Unicode string.Nzutf-8FBOMtitlezError loading the filemessagez^The encoding '%s' is not known to this Python installation. The file may not display correctlyrGrzSpecify 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?ZinitialvalueT)NF)NF)NF)
startswithrr
UnicodeDecodeErrorr)rrrNrOrrPrupdaterlocale_encoding)r,rXrrZencrrrrrQsh
		
	

		
	
	
zIOBinding._decodec	Cs|jrdSd|jpd}tjddd|dtjd|j}|r~d}|jd|jsd	}qn|dkrd	}nd
}|jj|S)Nyesz&Do you want to save %s before closing?zthis untitled documentr]z
Save On Closer^defaultrGr=no)r0r9rNZaskyesnocancelZYESrr#rB)r,r^confirmrErrrrC:s&		
	
zIOBinding.maybesavecCsr|js|j|nH|j|jra|jdy|jjWqatk
r]YqaXn|jjdS)NTr<)	r9r%	writefiler1rstore_file_breaksAttributeErrorrrB)r,rDrrrr#Ps	


zIOBinding.savecCs|j}|rg|j|rg|j||jdy|jjWqdtk
r`YqdXqgn|jj|j	|dS)Nrr<)
asksavefilerhr;r1rrirjrrBrV)r,rDr9rrrr%]s




zIOBinding.save_ascCs@|j}|r"|j|n|jj|j|dS)Nr<)rkrhrrBrV)r,rDr9rrrr'ks

zIOBinding.save_a_copycCs|j|jjdd}|jdkrF|jd|j}n|j|}y-t|d}|j|WdQXdSWnHtk
r}z(t	j
dt|d|jdSWYdd}~XnXdS)	Nz1.0zend-1crwbTz	I/O ErrorrGF)fixlastlinergetrTreplaceencoder!writerMrNrOrP)r,r9rrZrWrYrrrrhss

zIOBinding.writefilec#Cst|tr|S|jdkr3t|jdSy|jdSWntk
rXYnXyt|}d}Wn1tk
r}z|}d}WYdd}~XnX|sd}n|ry|j|SWqtk
rd|}YqXntj	dd|d|j
t|jdS)Nr\zutf-8rzInvalid encoding '%s'z	I/O Errorz%s.
Saving as UTF-8rG)rrr)rrpUnicodeErrorrrrNrOr)r,rZrcZfailedrYrrrrps4

	


zIOBinding.encodecCs8|jjd}|dkr4|jjddndS)Nzend-2crzend-1c)rrnrI)r,crrrrmszIOBinding.fixlastlinec	Cstjdddddtjd|j}|sA|jjdSd}|j}|re|j}n|sx|dkrtjdd	\}}|}t	j
||j|st	j|dSnt	j
}d
}|dkrtjdd
d}	|	d}	n*|dkr'tjdd
d}	nd}|r|	tj|}	t	j|	d}
|
jj}|
j
}|rd||}n|rdt|	|}tjd|d|jqn#d|}
tjd|
d|j|rt	j|ndS)Nr]ZPrintr^zPrint to Default PrinterrerGr<prefixZ	IDLE_tmp_TposixmainZGeneralzprint-command-posixz 2>&1ntzprint-command-winFrz#Printing failed (exit status 0x%x)
zPrinting command: %s
zPrint statusz-Printing is not enabled for this platform: %s)rNZaskokcancelZOKrrBr0r9tempfileZmkstempr6r/rhunlinkridleConfZ	GetOptionshlexZquotepopenrLstripreprrOZshowinfo)r,rDrgZtempfilenameZsavedr9ZtfdplatformZ
printPlatformZcommandpipeoutputZstatusr^rrrr*sX		


		

zIOBinding.print_windowPython files
*.py *.pywTEXT
Text files*.txt	All files*darwinz.pyrcCsa|jd\}}|jsBtjd|jd|j|_n|jjd|d|}|S)Nr!rG	filetypes
initialdirinitialfile)defaultfilename
opendialogtkFileDialogZOpenrrshow)r,dirbaser9rrrr?s	zIOBinding.askopenfiler!cCsk|jrtjj|jS|jr2|jdfSytj}Wntk
r\d}YnX|dfSdS)Nr)r9r6r7rr:getcwdrM)r,modepwdrrrrs		

zIOBinding.defaultfilenamecCsj|jd\}}|jsKtjd|jd|jd|j|_n|jjd|d|}|S)Nr#rGrdefaultextensionrr)r
savedialogrZSaveAsrrrr)r,rrr9rrrrks				zIOBinding.asksavefilecCs#|jjr|jj|ndS)z-Update recent file list on all editor windowsN)rr>Zupdate_recent_files_list)r,r9rrrrV	szIOBinding.updaterecentfileslist)rrr)rrr)rr))__name__
__module____qualname__r-r/r0r1r3r.r5r9r:r;r!ZeolrecompilerRr6lineseprTrArQrCr#r%r'rhrprmr*rrrsysrrr?rrkrVrrrrrlsD,	$D
'2	
rcCsddlm}m}ddlm}||}|jdtttt	j
d|j\}}}}|jd||dfGdd	d	}	||}
|
j|
j
|	|
}t|dS)
Nr)ToplevelText)r{zTest IOBindingz[x+]z+%d+%dc@sXeZdZddZddZddZddZd	d
ZddZd
S)z_io_binding.<locals>.MyEditWincSsB||_d|_|jjd|j|jjd|jdS)Nz<Control-o>z<Control-s>)rr>r r!r#)r,rrrrr-s		z'_io_binding.<locals>.MyEditWin.__init__cSsdS)Nrr)r,rrrr0sz(_io_binding.<locals>.MyEditWin.get_savedcSsdS)Nr)r,r2rrrr1sz(_io_binding.<locals>.MyEditWin.set_savedcSsdS)Nr)r,rrrr3sz)_io_binding.<locals>.MyEditWin.reset_undocSs|jjddS)Nz<<open-window-from-file>>)revent_generate)r,rDrrrr!sz#_io_binding.<locals>.MyEditWin.opencSs|jjddS)Nz<<save-window>>)rr)r,rDrrrr#!sz#_io_binding.<locals>.MyEditWin.saveN)	rrrr-r0r1r3r!r#rrrr	MyEditWinsr)ZtkinterrrZidlelib.configHandlerr{r]listmapintrrZgeometryZpackrBr)rGrrr{rootwidthZheightxyrrrrrr_io_bindings
3

r__main__)run),rrr6rr|rryZtkinter.filedialogZ
filedialogrZtkinter.messageboxZ
messageboxrNZtkinter.simpledialogrZlocale	setlocaleLC_CTYPEImportErrorErrorgetfilesystemencodingZfilesystemencodingrbrZgetdefaultlocalerrnl_langinfoCODESET	NameErrorrj
ValueErrorlowerencodingrASCIIrrrrrrZidlelib.idle_test.htestrrrrr<module>s\
		
)