Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
ó ¿œ^c@sädZddlZddlZddlZddlZddlZddlmZdddf\ZZ Z d„Z d„Z d „Z ie e6e e 6e e 6Zid e6d e 6d e 6Zied 6e d 6e d 6Zid e6d e 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 „Z d „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||fR!t colnum2nameRR;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 txmls%ss% %s ss (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(NR s (RUtopentwritetendswithtclose(RtfilenameRPtf((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pytsaveÓs   cCs0t|dƒ}t|ƒj|ƒ|jƒdS(Ntr(R[t SheetParsert 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„Z d „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|ƒ||%s(RsttypeRyRft align2xmlRQR€(RRw((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyRUXs  cCs8d|jkodknr*d|jS|jƒSdS(Niis %sI€i€I€(Ryt _xml_long(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt_xml_int_s cCs d|jS(Ns%s(Ry(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyR–escCsdt|jƒS(Ns%s(treprRy(R((s./usr/lib64/python2.7/Demo/tkinter/guido/ss1.pyt _xml_floathscCsdt|jƒS(Ns%s(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%s(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,%s(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 tgroupst colname2numR}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 „Z d „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 j d|jƒt 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: %sRPtA1tfontt helveticaitboldtSavetcommandtsidetbottomtexpanditfilltbothR R Rssss ssN(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|fitminsizei@RPtWEs sstsunkentbgtwhitetfgtblackN(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|ds@         ÀY )6   ÿC