ok

Mini Shell

Direktori : /lib64/python2.7/Demo/tkinter/guido/
Upload File :
Current File : //lib64/python2.7/Demo/tkinter/guido/ss1.pyo

�
V
�Qc@s�dZddlZddlZddlZddlZddlZddlmZdddf\ZZ	Z
d�Zd�Zd	�Z
iee6ee	6e
e
6Zid
e6de	6de
6Zied
6e	d6e
d6Zid
e6de	6de
6Zd�Zdfd��YZdfd��YZdfd��YZdefd��YZdefd��YZdefd��YZd�Zd�Zd�Zd�ZddlZd fd!��YZd"�Z d#�Z!e"d$kr�e!�ndS(%sSS1 -- a spreadsheet.i����N(texpattLEFTtCENTERtRIGHTcCs
|j|�S(N(tljust(txtn((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRscCs
|j|�S(N(tcenter(RR((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRscCs
|j|�S(N(trjust(RR((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRstleftRtrighttwtecCs4d}x'|D]}|dk	r
||7}q
q
W|S(Ni(tNone(tseqttotalR((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pytsums

tSheetcBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cCsOi|_tj�|_|jjd�}|j|_|j|_t|_dS(Nt__main__(tcellstrexectRExect
add_modulet	cellvaluetcelltmulticellvalueR(tselftm((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt__init__"s	cCs9|j||�}t|d�r1|j|j�S|SdS(Ntrecalc(tgetcellthasattrRR(RRtyR((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR*scCs�||kr||}}n||kr8||}}ng}xRt||d�D]=}x4t||d�D]}|j|j||��qlWqRW|S(Ni(trangetappendR(Rtx1ty1tx2ty2RR R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR1s!cCs|jj||f�S(N(Rtget(RRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR<scCs||j||f<dS(N(R(RRR R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pytsetcell?scCs,y|j||f=Wntk
r'nXdS(N(RtKeyError(RRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt	clearcellDs
cCs1x*|j||||�D]}|j|=qWdS(N(tselectcellsR(RR#R$R%R&txy((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt
clearcellsJscCs|jd|tj|�dS(Ni(R-tsystmaxint(RR$R&((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt	clearrowsNscCs|j|d|tj�dS(Ni(R-R.R/(RR#R%((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pytclearcolumnsQscCs�||kr||}}n||kr8||}}ng|jD]P\}}||koe|knrB||ko�|knrB||f^qBS(N(R(RR#R$R%R&RR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR+Tsc	Cs#|dkr|dkrdS||kr8||}}n||krT||}}ni}x�|jD]�\}}	|j||	f}
t|
d�r�|
j||||||�}
n||ko�|knr||	ko�|knr||7}|	|7}	n|
|||	f<qdW||_dS(Nitrenumber(RRR2(RR#R$R%R&tdxtdytnewRR R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt	movecells\s !8

cCs&|jd|tjtjd|�dS(Ni(R6R.R/(RR R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt
insertrowsoscCs^||kr||}}n|j||�|jd|dtjtjd||d�dS(Nii(R0R6R.R/(RR$R&((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt
deleterowssscCs&|j|dtjtj|d�dS(Ni(R6R.R/(RRR((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt
insertcolumnsyscCs^||kr||}}n|j||�|j|ddtjtj||dd�dS(Nii(R-R6R.R/(RR#R%((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt
deletecolumns}scCsLd}}x5|jD]*\}}t||�}t||�}qW||fS(Ni(Rtmax(RtmaxxtmaxyRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pytgetsize�s

cCs:x3|jj�D]"}t|d�r|j�qqWdS(Ntreset(Rt
itervaluesRR?(RR((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR?�scCsJ|j�x9|jj�D](}t|d�r|j|j�qqWdS(NR(R?RR@RRR(RR((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�s
cCs�|j�\}}|d|d}}dg|}i}xZtd|�D]I}t|�tf||df<\}}	t||t|��||<qJWxZtd|�D]I}
t|
�tf|d|
f<\}}	t|dt|��|d<q�Wx�|jj�D]�\\}}
}|dks|
dkr4qnt	|d�rV|j
|j�nt	|d�rz|j�\}}	n*t|�}t
|t�r�t}	nt}	||	f|||
f<t||t|��||<qWd}x9t|�D]+}|r|d7}n|d||7}q�Wx�t|�D]�}
d}
xot|�D]a}|j||
f�pgdtf\}}	t|	|||�}|
r�|
d7}
n|
|7}
qCW|
GH|
dkr*|GHq*q*WdS(	NiiRtformattt+t-t|(R>R!tcolnum2nameRR;tlentstrRt	iteritemsRRRRAt
isinstanceRR'talign2action(RR<R=twidththeighttcolwidthtfullRttextt	alignmentR Rtseptline((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pytdisplay�sP
&!&!"	!
'
cCs�dg}xn|jj�D]]\\}}}t|d�rI|j�}ndtj|�}|jd|||f�qW|jd�dj|�S(Ns
<spreadsheet>txmls<value>%s</value>s%<cell row="%s" col="%s">
  %s
</cell>s</spreadsheet>s
(RRIRRUtcgitescapeR"tjoin(RtoutRR Rtcellxml((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRU�s	"	
cCs\|j�}t|d�}|j|�|rN|jd�rN|jd�n|j�dS(NRs
(RUtopentwritetendswithtclose(RtfilenameRPtf((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pytsave�s
cCs0t|d�}t|�j|�|j�dS(Ntr(R[tSheetParsert	parsefileR^(RR_R`((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pytload�s(t__name__t
__module__RRRRR(R*R-R0R1R+R6R7R8R9R:R>R?RRTRURaRe(((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR s,																			2		RccBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�ZeZ	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�ZRS(cCs
||_dS(N(tsheet(RRh((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�scCsAtj�}|j|_|j|_|j|_|j|�dS(N(	RtParserCreatetstartelementtStartElementHandlert
endelementtEndElementHandlertdatatCharacterDataHandlert	ParseFile(RR`tparser((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRd�s
cCsct|d|d�}|rVx*|j�D]\}}t|�||<q)W||�ng|_dS(Ntstart_(tgetattrR
RIRHttexts(Rttagtattrstmethodtkeytvalue((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRj�s
cCs t|�}|jj|�dS(N(RHRtR"(RRP((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRn�scCs9t|d|d�}|r5|dj|j��ndS(Ntend_RB(RsR
RXRt(RRuRw((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRl�scCs4t|jd��|_t|jd��|_dS(Ntrowtcol(tintR'R R(RRv((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt
start_cell�scCs1|jd�|_tj|jd��|_dS(NRAtalign(R'tfmtt	xml2alignRQ(RRv((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pytstart_valuescCs*yt|�|_Wnd|_nXdS(N(R}RyR
(RRP((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pytend_intscCs*yt|�|_Wnd|_nXdS(N(tlongRyR
(RRP((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pytend_long
scCs*yt|�|_Wnd|_nXdS(N(tfloatRyR
(RRP((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt
end_doublescCs*yt|�|_Wnd|_nXdS(N(tcomplexRyR
(RRP((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pytend_complexscCs$y
||_Wnd|_nXdS(N(RyR
(RRP((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt
end_strings
cCs�t|jt�r!|j|_nit|jt�r`t|j|jpHd|jpTt�|_n*t	|j|jpud|jp�t
�|_dS(Ns%s(RJRytBaseCellRRHt
StringCellR�RQRtNumericCellR(RRP((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt	end_value%s		cCs+t||jpd|jpt�|_dS(Ns%s(tFormulaCellR�RQRR(RRP((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pytend_formula1scCs#|jj|j|j|j�dS(N(RhR(RR R(RRP((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pytend_cell6s(RfRgRRdRjRnRlR~R�t
start_formulaR�R�R�R�R�R�R�R�(((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRc�s 														R�cBseZdZRS(N(RfRgR
R(((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�9s	R�cBsVeZded�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	s%scCs||_||_||_dS(N(RyR�RQ(RRyR�RQ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRGs		cCs|jS(N(Ry(RR((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRNscCs:y|j|j}Wnt|j�}nX||jfS(N(R�RyRHRQ(RRP((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRAQs
cCs=t|dt|j�j�}dt|j|j|�fS(Nt_xml_s(<value align="%s" format="%s">%s</value>(RsttypeRyRft	align2xmlRQR�(RRw((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRUXs

cCs8d|jkodknr*d|jS|j�SdS(Niis
<int>%s</int>I�i�I�(Ryt	_xml_long(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt_xml_int_scCsd|jS(Ns<long>%s</long>(Ry(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�escCsdt|j�S(Ns<double>%s</double>(treprRy(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt
_xml_floathscCsdt|j�S(Ns<complex>%s</double>(R�Ry(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt_xml_complexks(RfRgRRRRARUR�R�R�R�(((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�Es						R�cBs2eZded�Zd�Zd�Zd�ZRS(s%scCs||_||_||_dS(N(RPR�RQ(RRPR�RQ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRps		cCs|jS(N(RP(RR((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRwscCs|j|jfS(N(RPRQ(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRAzscCs-d}|t|j|jtj|j�fS(Ns9<value align="%s" format="%s"><string>%s</string></value>(R�RQR�RVRWRP(Rts((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRU}s

(RfRgRRRRARU(((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�ns		R�cBsDeZded�Zd�Zd�Zd�Zd�Zd�ZRS(s%scCs;||_t|j�|_||_||_|j�dS(N(tformulat	translatet
translatedR�RQR?(RR�R�RQ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�s
			cCs
d|_dS(N(R
Ry(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR?�scCs�|jdkr�y4|jddt|j��|jd�|_Wq�tj�d}t|d�rw|j	|_q�t
|�|_q�Xn|jS(Ns from __future__ import division
s__value__ = eval(%s)t	__value__iRf(RyR
tr_execR�R�tr_evalR.texc_infoRRfRH(RRtexc((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�s	cCs:y|j|j}Wnt|j�}nX||jfS(N(R�RyRHRQ(RRP((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRA�s
cCsdt|j|j|jfS(Ns,<formula align="%s" format="%s">%s</formula>(R�RQR�R�(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRU�s
cCs�g}x�tjd|j�D]�}tjd|�}	|	dk	r�|	j�\}
}t|
�}t|�}
||ko�|knr�||
ko�|knr�t|||
|�}q�n|j	|�qWt
dj|�|j|j
�S(Ns(\w+)s^([A-Z]+)([1-9][0-9]*)$RB(tretsplitR�tmatchR
tgroupstcolname2numR}tcellnameR"R�RXR�RQ(RR#R$R%R&R3R4RYtpartRtsxtsyRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR2�s8(	RfRgRRR?RRARUR2(((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR��s				c	Cs�g}x�tjd|�D]�}tjd|�}|dkrM|j|�q|j�\}}}}t|�}|dkr�d||f}n"t|�}d||||f}|j|�qWdj|�S(s�Translate a formula containing fancy cell names to valid Python code.

    Examples:
        B4 -> cell(2, 4)
        B4:Z100 -> cells(2, 4, 26, 100)
    s(\w+(?::\w+)?)s2^([A-Z]+)([1-9][0-9]*)(?::([A-Z]+)([1-9][0-9]*))?$scell(%s, %s)scells(%s, %s, %s, %s)RBN(R�R�R�R
R"R�R�RX(	R�RYR�RR#R$R%R&R�((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR��scCst|�t|�S(sETranslate a cell coordinate to a fancy cell name (e.g. (1, 1)->'A1').(RFRH(RR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR��scCsI|j�}d}x0|D](}|dt|�td�d}qW|S(sCTranslate a column name to number (e.g. 'A'->1, 'Z'->26, 'AA'->27).iitAi(tuppertord(R�Rtc((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR��s

&cCsJd}x=|rEt|dd�\}}t|td��|}q	W|S(s6Translate a column number to name (e.g. 1->'A', etc.).RBiiR�(tdivmodtchrR�(RR�R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRF�s
	tSheetGUIcBs�eZdZdddd�Zd�Zd�Zd�Zd�Zd	�Zd
�Z	d�Z
d�Zd
�Zd�Z
d�ZeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(s7Beginnings of a GUI for a spreadsheet.

    TO DO:
    - clear multiple cells
    - Insert, clear, remove rows or columns
    - Show new contents while typing
    - Scroll bars
    - Grow grid when window is grown
    - Proper menus
    - Undo, redo
    - Cut, copy and paste
    - Formatting and alignment
    s
sheet1.xmli
icCs*||_t�|_tjj|�r:|jj|�n|jj�\}}t||�}t||�}t	j	�|_
|j
jd|j�t	j|j
dddd�|_
t	j|j
�|_t	j|j
ddd	|j�|_t	j|j
�|_|jjd
ddd
dd�|j
jd
d�|jjd
d�|jjd
ddd
dd�|jjd|j�|jjd|j�|jjd|j�|jjd|j�|jjd|j�|jjd|j�|j||�d|_d|_ |j!d
d
�|j"�dS(slConstructor.

        Load the sheet from the filename argument.
        Set up the Tk widget tree.
        sSpreadsheet: %sRPtA1tfontt	helveticaitboldtSavetcommandtsidetbottomtexpanditfilltbothR	R
Rs<Return>s<Shift-Return>s<Tab>s<Shift-Tab>s<Delete>s<Escape>N(R�iR�(#R_RRhtostpathtisfileReR>R;tTktroottwm_titletLabeltbeacontEntrytentrytButtonRat
savebuttontFrametcellgridtpacktbindtreturn_eventtshift_return_eventt	tab_eventtshift_tab_eventtdelete_eventtescape_eventtmakegridR
t	currentxytcornerxyt
setcurrenttsync(RR_trowstcolumnsR<R=((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�s<			cCsr|j|jkr>|jdk	r>|jj|j|j�n|jj|j�|j�|jjdd�dS(Nitendtbreak(	R�R�R
RhR-R*R�R�tdelete(Rtevent((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�'s!
cCs#|j\}}|j||�dS(N(R�t
load_entry(RR�RR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�0scCs�|jj||�}|dkr*d}n1t|t�rId|j}n|j�\}}|jjdd�|jj	d|�|jj
dd�dS(NRBt=iR�(RhRR
RJR�R�RAR�R�tinserttselection_range(RRR RRPRQ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�4s	c
Cs||_||_i|_tj|jdd�}|jdddddd�|jd|j�x�t	d	|d	�D]�}|jj
|d
d�tj|jdt|�dd�}|jd|dddd
�||j|df<||_d|_
|jd|j�|jd|j�|jd|j�|jd|j�qvWx�t	d	|d	�D]�}tj|jdt|�dd�}|jddd|dd
�||jd|f<d|_||_
|jd|j�|jd|j�|jd|j�|jd|j�q[Wx�t	d	|d	�D]�}x�t	d	|d	�D]�}tj|jdddddd�}|jd|d|dd�||j||f<||_||_
|jd|j�|jd|j�|jd|j�|jd|j�qDWq*WdS(s�Helper to create the grid of GUI cells.

        The edge (x==0 or y==0) is filled with labels; the rest is real cells.
        trelieftraisedtcolumniR{tstickytNSWEs<ButtonPress-1>itminsizei@RPtWEs<B1-Motion>s<ButtonRelease-1>s<Shift-Button-1>tsunkentbgtwhitetfgtblackN(R�R�t	gridcellsR�R�R�tgrid_configureR�t	selectallR!tgrid_columnconfigureRFt_SheetGUI__xt_SheetGUI__ytselectcolumntextendcolumnRHt	selectrowt	extendrowtpresstmotiontrelease(RR�R�RRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�@sN			$		$				cCs*|jdd�|jtjtj�dS(Ni(R�t	setcornerR.R/(RR�((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�rscCs<|j|�\}}|j|d�|j|tj�dS(Ni(twhichxyR�R�R.R/(RR�RR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�vscCsR|j|�\}}|dkrN|j|jdd�|j|tj�ndS(Nii(R�R�R�R�R.R/(RR�RR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�{scCs<|j|�\}}|jd|�|jtj|�dS(Ni(R�R�R�R.R/(RR�RR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR��scCsR|j|�\}}|dkrN|jd|jd�|jtj|�ndS(Nii(R�R�R�R�R.R/(RR�RR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR��scCsD|j|�\}}|dkr@|dkr@|j||�ndS(Ni(R�R�(RR�RR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR��scCsD|j|�\}}|dkr@|dkr@|j||�ndS(Ni(R�R�(RR�RR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR��scCsh|jj|j|j�}|dk	rdt|tj�rdy|j|j	fSWqdt
k
r`qdXndS(Ni(ii(R�twinfo_containingtx_rootty_rootR
RJR�R�R�R�tAttributeError(RR�R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR��s
cCs|jj|j�dS(N(RhRaR_(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRa�scCs�|jdk	r|j�n|j�t||�|jd<|j||�|jj�||f|_d|_	|j
j|j�}|dk	r�d|d<ndS(sMake (x, y) the current cell.RPtyellowR�N(R�R
tchange_cellt
clearfocusR�R�R�R�t	focus_setR�R�R'(RRR tgridcell((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR��s


	c		Csc|jdks$|j||fkr8|j||�dS|j�||f|_|j\}}|jpo|j\}}||kr�||}}n||kr�||}}nxh|jj�D]W\\}}}||ko�|knr�||ko|knr�d|d<q�q�W|jj|j�}|dk	rId|d<n|j||||�dS(Nt	lightBlueR�R(	R�R
R�RR�R�RIR't	setbeacon(	RRR R#R$R%R&RR((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR��s$$
"8
cCs#||kodknrD||ko6tjknrDd}n�||fdtjfkr�||krxd|}qd||f}n�||fdtjfkr�||kr�dt|�}qdt|�t|�f}n.t|j�}t|j�}d||f}||jd<dS(Nit:s%ds%d:%ds%ss%s:%sRP(R.R/RFR�R�R�R�(RR#R$R%R&tnametname1tname2((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR	�s;	
cCs�|jdk	r�|j\}}|jp-|j\}}||krR||}}n||krn||}}nxk|jj�D]W\\}}}||ko�|knr~||ko�|knr~d|d<q~q~WndS(NR�R�(R�R
R�R�RI(RR#R$R%R&RR R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�s"8cCs1|j�|j\}}|j||d�dS(sCallback for the Return key.iR�(RR�R�(RR�RR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR��s
cCs:|j�|j\}}|j|td|d��dS(s0Callback for the Return key with Shift modifier.iR�(RR�R�R;(RR�RR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR��s
cCs1|j�|j\}}|j|d|�dS(sCallback for the Tab key.iR�(RR�R�(RR�RR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR��s
cCs:|j�|j\}}|jtd|d�|�dS(s-Callback for the Tab key with Shift modifier.iR�(RR�R�R;(RR�RR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR��s
cCs�|j\}}|jj�}d}|jd�rFt|d�}nGxDtttt	fD]0}y||�}Wn
qYqYXt
|�}PqYW|dkr�|r�t|�}n|dkr�|jj
||�n|jj|||�|j�dS(s+Set the current cell from the entry widget.R�iN(R�R�R'R
t
startswithR�R}R�R�R�R�R�RhR*R(R�(RRR RPRtclsRy((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRs$cCs�|jj�x�|jj�D]�\\}}}|dks|dkrMqn|jj||�}|dkr{d|d<qt|d�r�|j�\}}nt|�t	}}||d<t
||d<qWdS(s(Fill the GUI cells from the sheet cells.iRBRPRAtanchorN(RhRR�RIRR
RRARHRtalign2anchor(RRR RRRPRQ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR�s
"

(RfRgt__doc__RR�R�R�R�R�R�R�R�R�R�R�R�R�RaR�R�R	RR�R�R�R�RR�(((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR��s4-					2																			cCs�ddl}t�}x�tdd�D]�}x�tdd�D]�}|dkr\t|�}nU|dkrwt|�}n:t|d�}td|�}d||f}t|�}|j|||�q;Wq%W|j�|jd�dS(sBasic non-gui self-test.i����Niis%s*%ss
sheet1.xml(	R�RR!R�R�R�R(RTRa(R�taRR Rtc1tc2R�((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt
test_basic,s	
cCs@tjdrtjd}nd}t|�}|jj�dS(s	GUI test.is
sheet1.xmlN(R.targvR�R�tmainloop(R_tg((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyttest_guiBs

R(#RR�R�R.RVRtxml.parsersRRRRRRRRKR�R�RRRRcR�R�R�R�R�R�R�RFtTkinterR�R�RRRf(((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt<module>s@				�Y)6						�C			

Zerion Mini Shell 1.0