mò DµMc@s÷dZdkZdkZdkZdkZdkZdkZdkZdkl Z dk l Z dk l Z dklZeidƒZddd d gZd e fd „ƒYZdefd „ƒYZd „Zhdd„Zddddd„ZdS(s¢ This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) N(s web2py_uuid(sStorage(sHTTP(sBEAUTIFYtweb2pytRestrictedErrort restrictedt TicketStoragetcompile2cBsVtZdZedd„Zd„Zd„Zd„Zed„Zd„Z d„Z RS( sP defines the ticket object and the default values of its members (None) t web2py_ticketcCs||_||_dS(N(tdbtselft tablename(RRR((t:/home/camdpams_www/Products_Activation/gluon/restricted.pyt__init__!s cCs8|io|i|||ƒn|i|||ƒdS(sX stores the ticket. It will figure out if this must be on disk or in db N(RRt _store_in_dbtrequestt ticket_idt ticket_datat_store_on_disk(RR R R((R tstore)s cCs[|i|i|i|iƒ}|id|dt i |ƒd|i ƒt id|ƒdS(NR Rtcreated_datetimes"In FILE: %(layer)s %(traceback)s (Rt _get_tableRRR t applicationttabletinsertR tcPickletdumpsRtnowtloggerterror(RR R RR((R R 2s   cCs#ti||i||dƒƒdS(Ntwb(RtdumpRRt _error_fileR R (RR R R((R R9scCsu|i}|o(tiitii|dƒ|ƒ}ntiitii|dƒƒ}t tii||ƒ|ƒS(Ns..terrors( R tfoldertroottapptostpathtjointabspatht errors_foldertopenR tmode(RR R R(R!R&R ((R R<s  (!cCs~|d|}|i|dƒ}|djoM|iƒ|i||idddƒ|iddƒ|iddƒƒ}n|S( Nt_R tlengthidRttextRtdatetime( RR!RtgettNoneRtrollbackt define_tabletField(RRRR!R((R RCs   cCs‰|ip#ti|i||d|ƒƒSn|i|i|i |ƒ}|i|i|jƒi ƒ}|oti |diƒSndS(Ntrbi(RRRtloadRR R R!RRRtselecttrowstloadsRR.(RR R!R R5R((R R3Qs #( t__name__t __module__t__doc__R.R RR RRRR3(((R Rs     cBs5tZdZdddhd„Zd„Zd„ZRS(s  class used to wrap an exception that occurs in the restricted environment below. the traceback is used to log the exception and generate a ticket. tcCs‰||_||_||_|oHtiƒ|_y"tddd|d|ƒ|_Wq|h|_q|Xnd|_h|_||_dS(sg layer here is some description of where in the system the exception occurred. tcontexti tcodet environments (no error)N(tlayerRR<toutputt tracebackt format_exctsnapshotR=(RR>R<R?R=((R R fs    "  cCs¿yhdt|iƒ<dt|iƒ<dt|iƒ<dt|iƒ<d|i<}td|i ƒ}|i ||i iddƒd|ƒ|i SWnti|iƒd SnXd S( s% logs the exception. R>R<R?R@RBRt/iN(tstrRR>R<R?R@RBtdRR t tickets_dbtticket_storageRtuuidtsplitRRR.(RR RERG((R tlog€sZ& cCsqtd|iƒ}|i|||ƒ}|d|_ |d|_ |d|_ |d|_ |i dƒ|_dS(s+ loads a logged exception. RR>R<R?R@RBN(RR RFRGR3R!R RERR>R<R?R@R-RB(RR R!R RERG((R R3•s    (R7R8R9R RJR3(((R R`s  cCs&t|iƒiddƒd|dƒS(sO The +' ' is necessary else compile fails when code ends in a comment. s s texecN(tcompileR<trstriptreplaceR>(R<R>((R R£stUnknowncBsÌ||dR=ttypeR<ttypestCodeTypetccodeRtHTTPt Exceptiont __debug__R"tenvirontsystexc_infotetypetevaluettbt excepthookR(R<R=R>RUR]R^R\((R R©s   ic) s„dk}(dk}dk}&dk} dk‰dk}dk‰dk}|p t i ƒ\}} } t|ƒ|ijo |i}nh}%dt iiƒddt i|%d<|&i|&iƒƒ|%d<|i| |ƒ}g|%d| t?ƒoexbt@| ƒD]P}|djpt iAd jo-ˆi:i;tB| |ƒƒ}"|"|%d|×stfiletfunctcalltlinestlnumcs>dˆ|d