Ñò ô†³Kc@sßdZddkZddkZddkZyddklZWn#ej oddklZnXddklZl Z l Z ddk l Z ddk l Z ddgZd efd „ƒYZeƒZdefd „ƒYZd efd „ƒYZdefd„ƒYZdefd„ƒYZeeddeddddedded„ Zed„Zd„Zd„ZeiieƒZxOee eƒƒD];Z!ee!i"ƒi#dƒodi$ee!ƒe_Pq–q–W[![dS(s Error handler middleware iÿÿÿÿN(tStringIO(t formattert collectortreporter(twsgilib(trequesttErrorMiddlewarethandle_exceptiont _NoDefaultcBseZd„ZRS(cCsdS(Ns ((tself((sD/usr/lib/python2.6/site-packages/paste/exceptions/errormiddleware.pyt__repr__s(t__name__t __module__R (((sD/usr/lib/python2.6/site-packages/paste/exceptions/errormiddleware.pyRscBsYeZdZdeddeddddedddd„ Zd„Zd„Zd„Z RS(s³ Error handling middleware Usage:: error_catching_wsgi_app = ErrorMiddleware(wsgi_app) Settings: ``debug``: If true, then tracebacks will be shown in the browser. ``error_email``: an email address (or list of addresses) to send exception reports to ``error_log``: a filename to append tracebacks to ``show_exceptions_in_wsgi_errors``: If true, then errors will be printed to ``wsgi.errors`` (frequently a server error log, or stderr). ``from_address``, ``smtp_server``, ``error_subject_prefix``, ``smtp_username``, ``smtp_password``, ``smtp_use_tls``: variables to control the emailed exception reports ``error_message``: When debug mode is off, the error message to show to users. ``xmlhttp_key``: When this key (default ``_``) is in the request GET variables (not POST!), expect that this is an XMLHttpRequest, and the response should be more minimal; it should not be a complete HTML page. Environment Configuration: ``paste.throw_errors``: If this setting in the request environment is true, then this middleware is disabled. This can be useful in a testing situation where you don't want errors to be caught and transformed. ``paste.expected_exceptions``: When this middleware encounters an exception listed in this environment variable and when the ``start_response`` has not yet occurred, the exception will be re-raised instead of being caught. This should generally be set by middleware that may (but probably shouldn't be) installed above this middleware, and wants to get certain exceptions. Exceptions raised after ``start_response`` have been called are always caught since by definition they are no longer expected. cCsddkl}||_|djo h}n|tjo|i|idƒƒ}n|tjo|i|idƒƒ}n|i|ƒ|_|djoC|idƒp-|idƒp|idƒp |idƒ}n|i|ƒ|_ ||_ ||_ |djo|id d ƒ}n||_ |djo|id d ƒ}n||_ | p |id ƒ|_| p |idƒ|_| p|i|idƒƒ|_| pd|_| djo|idƒ} n| |_|djo|iddƒ}n||_dS(Niÿÿÿÿ(t converterstdebugtshow_exceptions_in_wsgi_errorst error_emailt admin_emailtwebmaster_emailtsysadmin_emailterror_from_addressserrors@localhostt smtp_servert localhostt smtp_usernamet smtp_passwordt smtp_use_tlstt error_messaget xmlhttp_keyt_(t paste.utilR t applicationtNonet NoDefaulttasbooltgett debug_modetaslistRt error_logRt from_addressRRRRterror_subject_prefixRR(R Rt global_confRRR&RR'RRRRR(RRR ((sD/usr/lib/python2.6/site-packages/paste/exceptions/errormiddleware.pyt__init__QsB             "   c Csû|idƒo|i||ƒSt|dError in .close():
%ss500 Internal Server Errors content-types text/html(s content-types text/html(R,RLR3RMt StopIterationRJtnextR+t_closeR R/R0R2RKRF(R R5tclose_responseR0R9((sD/usr/lib/python2.6/site-packages/paste/exceptions/errormiddleware.pyRPÚs4               cCs|ip|iƒndS(N(RMRQ(R ((sD/usr/lib/python2.6/site-packages/paste/exceptions/errormiddleware.pytcloseús cCsZt|idƒpdSy|iiƒdSWn&|iitiƒ|iƒ}|SXdS(s"Close and return any error messageRSN( thasattrRHR RSRLR2R/R0R3(R RR((sD/usr/lib/python2.6/site-packages/paste/exceptions/errormiddleware.pyRQs  (R R RER*RNRPRSRQ(((sD/usr/lib/python2.6/site-packages/paste/exceptions/errormiddleware.pyR=Çs    R,cBs^eZdZd„Zd„Zhdd 6dd6dd6dd6d d6d d6d d6d d6ZRS(s^ This is a supplement used to display standard WSGI information in the traceback. cCs(||_||_ti|ƒ|_dS(N(t middlewareR3Rt construct_urlt source_url(R RUR3((sD/usr/lib/python2.6/site-packages/paste/exceptions/errormiddleware.pyR*s  c CsZh}h}|dtfilenametfilesError - %s: %s tinclude_hidden_framestinclude_reusabletshow_extra_datas” An error occurred. See the error logs for more information. (Turn debug on to display exception reports here) tshow_hidden_framess t-i<N(RARtcollect_exceptionRt EmailReportert send_reportR+t LogReportert FileReportertwritetexception_typetexception_valueRt format_htmlt error_cssthide_display_jsterror_templateR t format_text(R0t error_streamR>R$RR&RR?RRRRR(RR@treportedtexc_datat extra_datatreptrep_errt return_errort error_htmlt head_htmltmsgt err_report((sD/usr/lib/python2.6/site-packages/paste/exceptions/errormiddleware.pyR?sv              cCsy|i|ƒWnetƒ}tid|ƒ|o$dtit|ƒƒ|iƒfSdt|ƒ|iƒfSnXdSdS(NRosw

Additionally an error occurred while sending the %s report:

%s

s>Additionally an error occurred while sending the %s report: %sR(treportRt tracebackt print_exctcgitescapetstrtgetvalue(R†R„R>toutput((sD/usr/lib/python2.6/site-packages/paste/exceptions/errormiddleware.pyRw¢s !cCsd|||fS(Ns” Server Error %s

Server Error

%s %s ((RŠt exceptionRX((sD/usr/lib/python2.6/site-packages/paste/exceptions/errormiddleware.pyR€¶s cKst|d||S(NR)(R(tappR)tkw((sD/usr/lib/python2.6/site-packages/paste/exceptions/errormiddleware.pytmake_error_middlewareÄstSettings(%RER/RŽRt cStringIORt ImportErrortpaste.exceptionsRRRtpasteRRt__all__tobjectRR!RR-R=R,R+RAR RRwR€R˜t splitlinest doc_linestrangetlentitstript startswithtjoin(((sD/usr/lib/python2.6/site-packages/paste/exceptions/errormiddleware.pytsP     ¥ F2 W