/usr/lib64/python2.7/Demo/tkinter/guido
NameSizeModeActions
AttrDialog.py143400644editdlrm
AttrDialog.pyc187650644editdlrm
AttrDialog.pyo187650644editdlrm
brownian.py10910644editdlrm
brownian.pyc16250644editdlrm
brownian.pyo16250644editdlrm
brownian2.py13790644editdlrm
brownian2.pyc17850644editdlrm
brownian2.pyo17850644editdlrm
canvasevents.py66050755editdlrm
canvasevents.pyc107160644editdlrm
canvasevents.pyo107160644editdlrm
dialog.py32010755editdlrm
dialog.pyc31830644editdlrm
dialog.pyo31830644editdlrm
electrons.py23220755editdlrm
electrons.pyc23860644editdlrm
electrons.pyo23860644editdlrm
hanoi.py46490644editdlrm
hanoi.pyc39130644editdlrm
hanoi.pyo39130644editdlrm
hello.py3310644editdlrm
hello.pyc7010644editdlrm
hello.pyo7010644editdlrm
imagedraw.py5090644editdlrm
imagedraw.pyc11550644editdlrm
imagedraw.pyo11550644editdlrm
imageview.py2050644editdlrm
imageview.pyc5700644editdlrm
imageview.pyo5700644editdlrm
kill.py38840755editdlrm
kill.pyc49280644editdlrm
kill.pyo49280644editdlrm
listtree.py9910644editdlrm
listtree.pyc15330644editdlrm
listtree.pyo15330644editdlrm
ManPage.py68560644editdlrm
ManPage.pyc64230644editdlrm
ManPage.pyo64230644editdlrm
mbox.py74770755editdlrm
mbox.pyc83690644editdlrm
mbox.pyo83690644editdlrm
MimeViewer.py44970755editdlrm
MimeViewer.pyc49490644editdlrm
MimeViewer.pyo49490644editdlrm
newmenubardemo.py12320755editdlrm
newmenubardemo.pyc16240644editdlrm
newmenubardemo.pyo16240644editdlrm
optionmenu.py4410644editdlrm
optionmenu.pyc5940644editdlrm
optionmenu.pyo5940644editdlrm
paint.py18980644editdlrm
paint.pyc22430644editdlrm
paint.pyo22430644editdlrm
rmt.py44910755editdlrm
rmt.pyc50450644editdlrm
rmt.pyo50450644editdlrm
ShellWindow.py41720644editdlrm
ShellWindow.pyc56010644editdlrm
ShellWindow.pyo56010644editdlrm
solitaire.py177890755editdlrm
solitaire.pyc208970644editdlrm
solitaire.pyo208970644editdlrm
sortvisu.py193460755editdlrm
sortvisu.pyc237390644editdlrm
sortvisu.pyo237390644editdlrm
ss1.py261830644editdlrm
ss1.pyc324270644editdlrm
ss1.pyo318180644editdlrm
svkill.py48640755editdlrm
svkill.pyc59410644editdlrm
svkill.pyo59410644editdlrm
switch.py15590644editdlrm
switch.pyc29210644editdlrm
switch.pyo29210644editdlrm
tkman.py90040755editdlrm
tkman.pyc90890644editdlrm
tkman.pyo90890644editdlrm
wish.py6230644editdlrm
wish.pyc7370644editdlrm
wish.pyo7370644editdlrm
Edit: /usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyc (32427B)
 ^c@sdZddlZddlZddlZddlZddlZddlmZdddf\ZZ Z dZ dZ d Z ie e6e e 6e e 6Zid e6d e 6d e 6Zied 6e d 6e d 6Zid e6d e 6de 6ZdZdfdYZdfdYZdfdYZdefdYZdefdYZdefdYZdZdZdZdZddlZd fd!YZd"Z d#Z!e"d$kre!ndS(%sSS1 -- a spreadsheet.iN(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   tSheetcBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZRS(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|dr1|j|jS|SdS(Ntrecalc(tgetcellthasattrRR(RRtyR((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR*scCs||kr||}}n||kr8||}}ng}xRt||dD]=}x4t||dD]}|j|j||qlWqRW|S(Ni(trangetappendR(Rtx1ty1tx2ty2RR R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR1s  !cCs|jj||fS(N(Rtget(RRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR<scCsJ|dkr|dkstt|ts3t||j||ftlentstrRt iteritemsRRRRDR)R(RRR't align2action(RR?R@twidththeighttcolwidthtfullRttextt alignmentR Rtseptline((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pytdisplaysR &!&!"  ! '  cCsdg}xn|jjD]]\\}}}t|drI|j}ndtj|}|jd|||fqW|jddj|S(Ns txmls%ss% %s ss (RRLRRWtcgitescapeR"tjoin(RtoutRR Rtcellxml((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRWs "  cCs\|j}t|d}|j||rN|jd rN|jdn|jdS(NR s (RWtopentwritetendswithtclose(RtfilenameRRtf((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pytsaves   cCs0t|d}t|j||jdS(Ntr(R]t SheetParsert parsefileR`(RRaRb((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pytloads(t__name__t __module__RRRRR+R-R0R3R4R.R9R:R;R<R=RARBRRVRWRcRg(((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR s,                  2 RecBseZdZdZdZdZdZdZdZeZ dZ dZ d Z d Z d Zd Zd ZdZRS(cCs ||_dS(N(tsheet(RRj((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRscCsAtj}|j|_|j|_|j|_|j|dS(N( Rt ParserCreatet startelementtStartElementHandlert endelementtEndElementHandlertdatatCharacterDataHandlert ParseFile(RRbtparser((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRfs     cCsct|d|d}|rVx*|jD]\}}t|||%s(RuttypeR{Rht align2xmlRSR(RRy((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRWXs  cCs8d|jkodknr*d|jS|jSdS(Niis %sIiI(R{t _xml_long(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt_xml_int_s cCs d|jS(Ns%s(R{(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRescCsdt|jS(Ns%s(treprR{(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt _xml_floathscCsdt|jS(Ns%s(RR{(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt _xml_complexks( RhRiRRRRDRWRRRR(((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyREs      RcBs2eZdedZdZdZdZRS(s%scCsUt|ttfst|tttfks6t||_||_||_ dS(N( R)RKtunicodeR(RRRRRRRS(RRRRRS((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRps   cCs|jS(N(RR(RR((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRwscCs|j|jfS(N(RRRS(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRDzscCs-d}|t|j|jtj|jfS(Ns9%s(RRSRRXRYRR(Rts((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRW}s  (RhRiRRRRDRW(((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRns  RcBsDeZdedZdZdZdZdZdZRS(s%scCsV|tttfkst||_t|j|_||_||_|j dS(N( RRRR(tformulat translatet translatedRRSRB(RRRRS((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRs    cCs d|_dS(N(R R{(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRBscCs|jdkry4|jddt|j|jd|_Wqtjd}t|drw|j |_qt ||_qXn|jS(Ns from __future__ import division s__value__ = eval(%s)t __value__iRh( R{R tr_execRRtr_evalR1texc_infoRRhRK(RRtexc((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRs cCs:y|j|j}Wnt|j}nX||jfS(N(RR{RKRS(RRR((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRDs cCsdt|j|j|jfS(Ns,%s(RRSRR(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRWs cCsg}xtjd|jD]}tjd|} | dk r| j\} } t| } t| } || ko|knr|| ko|knrt| || |}qn|j |qWt dj ||j |j S(Ns(\w+)s^([A-Z]+)([1-9][0-9]*)$RE(tretsplitRtmatchR tgroupst colname2numRtcellnameR"RRZRRS(RR#R$R%R&R6R7R[tpartRtsxtsyRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR5s   8( RhRiRRRBRRDRWR5(((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRs     c Csg}xtjd|D]}tjd|}|dkrM|j|q|j\}}}}t|}|dkrd||f}n"t|}d||||f}|j|qWdj|S(sTranslate 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)REN(RRRR R"RRRZ( RR[RRR#R$R%R&R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRs    cCs&|dkstt|t|S(sETranslate a cell coordinate to a fancy cell name (e.g. (1, 1)->'A1').i(R(RIRK(RR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRscCsk|j}d}xR|D]J}d|ko6dknsAt|dt|tdd}qW|S(sCTranslate a column name to number (e.g. 'A'->1, 'Z'->26, 'AA'->27).itAtZii(tupperR(tord(RRtc((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRs   "&cCs\|dkstd}x=|rWt|dd\}}t|td|}qW|S(s6Translate a column number to name (e.g. 1->'A', etc.).iREiiR(R(tdivmodtchrR(RRR((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRIs  tSheetGUIcBseZdZddddZdZdZdZdZd Zd Z d Z d Z d Z dZ dZeZdZdZdZdZdZdZdZdZdZdZdZdZRS(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 j d|jt j |j dddd|_ t j|j |_t j|j ddd |j|_t j|j |_|jjd d d 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: %sRRtA1tfontt helveticaitboldtSavetcommandtsidetbottomtexpanditfilltbothR R Rssss ssN(RiR(#RaRRjtostpathtisfileRgRAR>tTktroottwm_titletLabeltbeacontEntrytentrytButtonRct savebuttontFrametcellgridtpacktbindt return_eventtshift_return_eventt tab_eventtshift_tab_eventt delete_eventt escape_eventtmakegridR t currentxytcornerxyt setcurrenttsync(RRatrowstcolumnsR?R@((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRs<     cCsr|j|jkr>|jdk r>|jj|j|jn|jj|j|j|jjdddS(Nitendtbreak( RRR RjR0R-RRtdelete(Rtevent((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR's ! cCs#|j\}}|j||dS(N(Rt load_entry(RRRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR0scCs|jj||}|dkr*d}n1t|trId|j}n|j\}}|jjdd|jj d||jj dddS(NREt=iR( RjRR R)RRRDRRtinserttselection_range(RRR RRRRS((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR4s  c Cs||_||_i|_tj|jdd}|jdddddd|jd|jxt d |d D]}|jj |d d tj|jd t |dd}|jd|dddd ||j|df<||_ d|_ |jd|j|jd|j|jd|j|jd|jqvWxt d |d D]}tj|jd t|dd}|jddd|dd ||jd|fitminsizei@RRtWEs sstsunkentbgtwhitetfgtblackN(RRt gridcellsRRRtgrid_configureRt selectallR!tgrid_columnconfigureRIt _SheetGUI__xt _SheetGUI__yt selectcolumnt extendcolumnRKt selectrowt extendrowtpresstmotiontrelease(RRRRRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR@sN   $  $    cCs*|jdd|jtjtjdS(Ni(Rt setcornerR1R2(RR((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRrscCs<|j|\}}|j|d|j|tjdS(Ni(twhichxyRRR1R2(RRRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRvscCsR|j|\}}|dkrN|j|jdd|j|tjndS(Nii(RRRRR1R2(RRRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR{s cCs<|j|\}}|jd||jtj|dS(Ni(RRRR1R2(RRRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRscCsR|j|\}}|dkrN|jd|jd|jtj|ndS(Nii(RRRRR1R2(RRRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRs cCsD|j|\}}|dkr@|dkr@|j||ndS(Ni(RR(RRRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRscCsD|j|\}}|dkr@|dkr@|j||ndS(Ni(RR(RRRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRscCsh|jj|j|j}|dk rdt|tjrdy|j|j fSWqdt k r`qdXndS(Ni(ii( Rtwinfo_containingtx_rootty_rootR R)RRRRtAttributeError(RRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRs cCs|jj|jdS(N(RjRcRa(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRcscCs|jdk r|jn|jt|||jd<|j|||jj||f|_d|_ |j j |j}|dk rd|d(RRRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRs cCs1|j|j\}}|j|d|dS(sCallback for the Tab key.iR(RRR(RRRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRs cCs:|j|j\}}|jtd|d|dS(s-Callback for the Tab key with Shift modifier.iR(RRRR>(RRRR ((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRs cCs|j\}}|jj}d}|jdrFt|d}nGxDtttt fD]0}y||}Wn qYqYXt |}PqYW|dkr|rt |}n|dkr|j j ||n|j j||||jdS(s+Set the current cell from the entry widget.RiN(RRR'R t startswithRRRRRRRRjR-R+R(RRR RRRtclsR{((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRs$  cCs|jjx|jjD]\\}}}|dks|dkrMqn|jj||}|dkr{d|ds@         Y )6   C