%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/idlelib/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/idlelib/IOBinding.pyc


Pac@sddlZddlmZddlZddlZddlZddlZddlZddlTddlZddl	Z	ddl
m
Z
ddlmZy#ddl
Z
e
je
jdWnee
jfk
rnXejZdZejdkr3y!e
jd	ZejeWnek
r/nXnyDe
je
jZeekp]edkridZnejeWnveeefk
ryBe
jd	ZeekpedkrdZnejeWneefk
rnXnXejZej d
Z!ej dZ"de
fd
YZ#dZ$dfdYZ%dZ&e'dkr~ddl(m)Z)e)e&ndS(iN(tBOM_UTF8(t*(tSimpleDialog(tidleConfttasciitwin32is&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s^[ \t\f]*(?:[#\r\n]|$)tEncodingMessagecBs)eZdZdZdZdZRS(s3Inform user that an encoding declaration is needed.c
Cst|_t||_}|jd|j|jd|j|jd|j|j	d|j
d||_t|dd}|j
dtdtt|d	d
}|jdd||j
dtdtd
tt|dd|}|j
dtdtt|}|j
dtd
td|_|_t|ddddd|j}|j
dtd
tddt|ddd|j}	|	j
dtd
tdd|j|dS(Ns<Return>s<Escape>tWM_DELETE_WINDOWsI/O Warningttexts:Non-ASCII found, yet no encoding declared. Add a line liketsidetanchortfonttcourieris# -*- coding: %s -*-tfillsto your file
See Language Reference, 2.1.4 Encoding declarations.
Choose OK to save this file as %s
Edit your general options to silence this warningtOktdefaulttactivetcommandtexpandisEdit my file(tFalsetshould_edittTopleveltroottbindtreturn_eventtdo_oktprotocoltwm_delete_windowtwm_titletwm_iconnamettoptLabeltpacktTOPtWtEntrytinserttXtFrameRtcanceltButtontLEFTtBOTHtdo_editt_set_transient(
tselftmastertencRtl1tl2tl3tbuttonstb1tb2((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyt__init__Js6	

			
cCs|jddS(Ni(tdone(R.((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRqscCs|jddS(Ni(R8(R.((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyR,ts(t__name__t
__module__t__doc__R7RR,(((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRHs	'	cCs|jddd }xD|D]8}tj|}|dk	rBPntj|sdSqWdS|jd}ddl}y|j|Wntk
rtd|nX|S(szReturn the encoding declaration according to PEP 263.

    Raise LookupError if the encoding is declared but unknown.
    s
iiiNsUnknown encoding (	tsplitt	coding_retmatchtNonetblank_retgrouptcodecstlookuptLookupError(tstrtlsttlineR>tnameRB((s-/usr/local/lib/python2.7/idlelib/IOBinding.pytcoding_specws

t	IOBindingcBs=eZdZdZdZdZdZd"ZdZ	d"Z
d"ZdZd"d"dZ
dZejeZejZd	Zd
ZdZdZd
ZdZdZdZdZdZd"Zd"Z d#d$d%gZ!e"j#dkrdndZ$dZ%ddZ&d Z'd!Z(RS(&cCs||_|j|_|jjd|j|_|jjd|j|_|jjd|j|_|jjd|j	|_
d|_|jjd|j
|_dS(Ns<<open-window-from-file>>s<<save-window>>s<<save-window-as-file>>s<<save-copy-of-window-as-file>>s<<print-window>>(teditwinR	Rtopent_IOBinding__id_opentsavet_IOBinding__id_savetsave_ast_IOBinding__id_saveastsave_a_copyt_IOBinding__id_savecopyR?tfileencodingtprint_windowt_IOBinding__id_print(R.RK((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyR7s		cCs|jjd|j|jjd|j|jjd|j|jjd|j|jjd|jd|_d|_d|_	dS(Ns<<open-window-from-file>>s<<save-window>>s<<save-window-as-file>>s<<save-copy-of-window-as-file>>s<<print-window>>(
R	tunbindRMRORQRSRVR?RKtfilename_change_hook(R.((s-/usr/local/lib/python2.7/idlelib/IOBinding.pytcloses		cCs
|jjS(N(RKt	get_saved(R.((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRZscCs|jj|dS(N(RKt	set_saved(R.tflag((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyR[scCs|jjdS(N(RKt
reset_undo(R.((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyR]scCs
||_dS(N(RX(R.thook((s-/usr/local/lib/python2.7/idlelib/IOBinding.pytset_filename_change_hookscCsf|r-tjj|r-d|_||_n5||_d|_|jd|jrb|jndS(Ni(tostpathtisdirR?tfilenametdirnameR[RX(R.Rc((s-/usr/local/lib/python2.7/idlelib/IOBinding.pytset_filenames			
	cCs%|jj}|r|s'|j}n|}|r|jr~t|jddr~|jr~|jr~|j||jq|j|n|j	r|j	j
ndS|jr|j}|dkr|j	j
dSn|s|j}n|}|r|j|n
|j	j
dS(NtinterptbreakR((RKtflisttaskopenfiletgetattrR?RcRZRLtloadfileR	t	focus_sett	maybesave(R.teventteditFileRhRctreply((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRLs6	
	

s(\r\n)|\n|\rcCsWy(t|d}|j}WdQXWn3tk
r]}tjdt|d|jtSX|j|}|j	j
|}|r|jd|_t
|jtr|jjd|_n|j	jd|}n|jjdd|jd|jjd||j|j||jjd	d|jjd	|j|tS(
Ntrbs	I/O ErrortparentiRs\ns1.0tendR%(RLtreadtIOErrorttkMessageBoxt	showerrorRER	Rtdecodeteol_retsearchRAteol_conventiont
isinstancetunicodetencodetsubtdeleteReR?R%R]tmark_settyviewtupdaterecentfileslisttTrue(R.Rctftcharstmsgtfirsteol((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRks,



cCs!|jtrKy|djd}Wntk
r:|SXt|_|Snyt|}Wn<tk
r}tjdddd|d|j	d	}nX|ryt||SWqtk
rqXnyt|dSWntk
rnXyt|t}t|_Wntk
rnX|S(
sMCreate a Unicode string

        If that fails, let Tcl try its best
        isutf-8ttitlesError loading the filetmessages^The encoding '%s' is not known to this Python installation. The file may not display correctlyRrRN(
t
startswithRRxtUnicodeErrorRTRIRDRvRwR	R?R}tencoding(R.RR0RH((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRxs>
		





c	Cs|jrdSd|jpd}tjddd|dtjd|j}|r~d}|jd|jsd	}qn|dkrd	}nd
}|jj|S(Ntyess&Do you want to save %s before closing?sthis untitled documentRs
Save On CloseRRRrR(tno(	RZRcRvtaskyesnocanceltYESR	RNR?Rl(R.RtconfirmRp((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRmAs&		
	
cCsq|js|j|nG|j|jr`|jty|jjWq`tk
r\q`Xn|jj	dS(NRg(
RcRPt	writefileR[RRKtstore_file_breakstAttributeErrorR	Rl(R.Rn((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRNWs	


cCs|j}|rf|j|rf|j||jdy|jjWqctk
r_qcXqfn|jj|j	|dS(NiRg(
tasksavefileRReR[RKRRR	RlR(R.RnRc((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRPds





cCs@|j}|r"|j|n|jj|j|dS(NRg(RRR	RlR(R.RnRc((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRRrs

cCs|j|j|jjdd}|jdkrO|jd|j}nyJt|d1}|j||jt	j
|jWdQXtSWn3t
k
r}tjdt|d|jtSXdS(Ns1.0send-1cs
twbs	I/O ErrorRr(tfixlastlineR~R	tgetR{treplaceRLtwritetflushR`tfsynctfilenoRRuRvRwRER(R.RcRRR((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRzs



c
Cst|tr|Sy|jdSWntk
r7nXyt|}d}Wntk
ro}|}d}nX|ry|j|SWqtk
rd|}qXn|rtjdd|d|j	n|j
tks|rt|jdS|j
rVy|j|j
SWqVtk
rRtjdd|j
d|j	t|jdSXntj
dd	d
}|dkrt|jdSt}y.|jt}t}|dkrt}nWn*tk
rt|jd}d}nX|s|St|jj|}|j|jdkrd
|}|j	jdd}	|	jdre|j	jd|n|j	jd||j|j	jddS|S(NRsInvalid encoding '%s's	I/O Errors%s. Saving as UTF-8Rrsutf-8s1Cannot save this as '%s' anymore. Saving as UTF-8tmaintEditorWindowRtlocaleis# -*- coding: %s -*-
s1.0s2.0s#!send-1c(R|RER~RRIR?RDRvRwR	RTRRt	GetOptionRRRRRKRtgotnumRRR%(
R.RR0tfailedRtconfig_encodingtask_usertdialogtenclinet	firstline((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyR~sv





	


	




cCs8|jjd}|dkr4|jjddndS(Nsend-2cs
send-1c(R	RR%(R.tc((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRsc	Cstjdddddtjd|j}|sA|jjdSd}|j}|re|j}n|sx|dkrtj	dd	\}}|}t
j||j|st
j
|dSnt
j}t}|d
krtjddd
}	|	d}	n*|dkr'tjddd}	nt}|r|	tj|}	t
j|	d}
|
jj}|
j}|rd||}n|rdt|	|}tjd|d|jqn#d|}
tjd|
d|j|rt
j
|ndS(NRtPrintRsPrint to Default PrinterRRrRgtprefixt	IDLE_tmp_tposixRtGeneralsprint-command-posixs 2>&1tntsprint-command-wintrs#Printing failed (exit status 0x%x)
sPrinting command: %s
sPrint statuss-Printing is not enabled for this platform: %s(RvtaskokcanceltOKR	RlR?RZRcttempfiletmkstempR`RYRtunlinkRHRRRRtpipestquotetpopenRttstriptreprRwtshowinfo(R.RnRttempfilenametsavedRcttfdtplatformt
printPlatformRtpipetoutputtstatusR((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRUsX		


		

sPython filess
*.py *.pywtTEXTs
Text filess*.txts	All filesRtdarwins.pyRcCs|jd\}}|jsBtjd|jd|j|_n|jjd|d|}t|tr~|j	t
}n|S(NRLRrt	filetypest
initialdirtinitialfile(tdefaultfilenamet
opendialogttkFileDialogtOpenR	RtshowR|R}R~tfilesystemencoding(R.tdirtbaseRc((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRis	RLcCsm|jrtjj|jS|jr2|jdfSytj}Wntjk
r^d}nX|dfSdS(NR(RcR`RaR<Rdtgetcwdterror(R.tmodetpwd((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyR s		

cCs|jd\}}|jsKtjd|jd|jd|j|_n|jjd|d|}t|t	r|j
t}n|S(NRNRrRtdefaultextensionRR(Rt
savedialogRtSaveAsR	RRRR|R}R~R(R.RRRc((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyR,s				cCs|jj|dS(s-Update recent file list on all editor windowsN(RKtupdate_recent_files_list(R.Rc((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyR8sN(sPython filess
*.py *.pywR(s
Text filess*.txtR(s	All filesR()R9R:R7RYRZR[R]R?RXR_RcRdReRLteoltretcompileRyR`tlinesepR{RkRxRmRNRPRRRR~RRURRRtsysRRRiRRR(((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRJsD							,			-		
				J		2		
	cCsddlm}m}||}|jdttttjd|j	\}}}}|j	d||dfdd	dY}||}	|	j
|	j||	}
t|
dS(
Ni(RtTextsTest IOBindings[x+]s+%d+%dit	MyEditWincBsbeZdZdZdZdZdZdZdZdZ	dZ
d	ZRS(
cSs||_d|_|jjd|j|jjd|j|jjd|j|jjd|j|jjd|jdS(Ns<Control-o>s<Control-p>s<Control-s>s<Alt-s>s<Control-c>(	R	R?RhRRLtprinterRNtsaveastsavecopy(R.R	((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyR7Es		cSsdS(Ni((R.((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRZMRcSsdS(N((R.R\((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyR[NRcSsdS(N((R.((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyR]ORcSsdS(N((R.Rc((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRPRcSs|jjddS(Ns<<open-window-from-file>>(R	tevent_generate(R.Rn((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRLQscSs|jjddS(Ns<<print-window>>(R	R(R.Rn((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRSscSs|jjddS(Ns<<save-window>>(R	R(R.Rn((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRNUscSs|jjddS(Ns<<save-window-as-file>>(R	R(R.Rn((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRWscSs|jjddS(Ns<<save-copy-of-window-as-file>>(R	R(R.Rn((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRYs(R9R:R7RZR[R]RRLRRNRR(((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyRDs									((
tTkinterRRRtlisttmaptintRR<tgeometryR!RlRJ(RrRRRtwidththeighttxtyRR	RK((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyt_io_binding=s
3

t__main__(trun(*RBRR`RRRRRRRvRtidlelib.configHandlerRRt	setlocaletLC_CTYPEtImportErrortErrortgetfilesystemencodingRRRtgetdefaultlocaleRCRDtnl_langinfotCODESETR?t	NameErrorRt
ValueErrortlowerRR=R@RRIRJRR9tidlelib.idle_test.htestR(((s-/usr/local/lib/python2.7/idlelib/IOBinding.pyt<module>s`

		/		%

Zerion Mini Shell 1.0