PhEc@sdZddkTddkZddklZddkZddkZddkZddkZddk Z ddk Z ddk Z ddk Z ddk ZddklZddkiZddkiZddklZlZeiZdZeZdd d gZdefd YZd Z e!d Z"e!dZ#defdYZ$de$fdYZ%dfdYZ&de$fdYZ'dS(sThe request package and its primary class, Request, provide the "m" object in Myghty templates. The Request is instantiated by the Interpreter and handles component execution state as well as buffered state. It provides the interface to all actions taken by components, such as writing output, calling other components, calling subrequests, and controllling request state. Also provides the programmatic interface to key objects such as caches and sessions. i(t*N(t exception(tCreationAbortedError(tUnicodeRequestBuffertStrRequestBuffertstricttRequesttinstancet threadlocalcBseZdZdfdfdeeeddfddfeeeeedZe dddZ e ddd Z e d dd Z d Z e d ddZdZdZddgdYZdZdZdZdZdZdZdZdZhdfdfdfedZdZddZdfedZedfd Zd!Zd"d#Z d$Z!dfd%Z"d&dfdfd'Z#d(Z$d)Z%d*Z&d+Z'd,Z(d-Z)dfdfd.Z*dfd/Z+dfd0Z,dfd1Z-dfd2Z.d3Z/d4Z0d5Z1ed6Z2d7Z3d8Z4d9Z5dfdfd:Z6d;Z7d<Z8d=Z9e d>dd?Z:e d@ddAZ;e dBddCZ<e dDddEZ=e dFddGZ>e dHddIZ?e dJddKZ@e dLddMZAdNZBe eBddOZCdPZDe eDddQZEdRdSZFdTZGdUZHdVZIdWZJdXZKdYZLdZZMd[ZNd\ZOd]ZPd^ZQd_ZRd`ZSdaZTdbZUdcZVddZWdeZXRS(hsrequest object, calls components and directs output. also is the primary programmatic interface presented to a template's environment.i trequesticKsO||_||_t|_||_g|_||_||_||_| |_ | |_ | |_ h|_ | |_ d|_ti|_h|_h|_| |_||_| dj o(| i|_| i|_| i|_nh|_||_d|_|o ||_nt||_d|_||f|_t||_dS(s-init is called internally by the Interpreter.N(t componentt auto_flushtFalsetexecutedt interpretertexecution_stackt max_recursiontdont_auto_flush_filterst use_dhandlerstdisable_wrappingt raise_errortparent_requestt _attributest request_depthtNonetcurrent_csourcettimet starttimetcomphasht compcachest request_pathtresolver_contextt root_requesttdeclined_componentst dhandler_patht request_impltDefaultRequestImpltbuffert_Request__output_encodingtbooltdisable_unicode(tselfRR R#RR RRRRRRRRtoutput_encodingtencoding_errorsR(tparams((s2/usr/lib/python2.6/site-packages/myghty/request.pyt__init__)s@                          cCs|iS((t attributes(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pytkstdocsA synonym for m.attributescCs |iiS((R R(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyR/mssC The URI sent to the ultimate root request of this Request. cCs |iiS((R t request_args(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyR/pss[ The request argument dictionary sent to the ultimate root request of this Request. cCs#|idj o |iiSdSdS(N(RRR.(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyt _parentattrts cstifdS(cs iS((R2((R)(s2/usr/lib/python2.6/site-packages/myghty/request.pyR/zs(t InheritedDictR(R)((R)s2/usr/lib/python2.6/site-packages/myghty/request.pyR/zss A dictionary where arbitrary attributes can be stored and retrieved. Inherits data from its parent request, if any. cCs |idj S(s-returns True if this request is a subrequest.N(RR(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyt is_subrequestscKsC|idp|ii||dtbase_componenttcontentt is_call_selfRt content_argst isinstancetmyghtyt Componentt has_filterR@R;(R)R R R>RARBRCR?((R R)R>R s2/usr/lib/python2.6/site-packages/myghty/request.pyR-s      # cCsd|_dS(NcSs|S(((R=((s2/usr/lib/python2.6/site-packages/myghty/request.pyR/s(R@(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyt reset_filters(t__name__t __module__t__doc__R-RI(((s2/usr/lib/python2.6/site-packages/myghty/request.pyR8s cCs|i|dS(sa synonym for writeN(twrite(R)tstring((s2/usr/lib/python2.6/site-packages/myghty/request.pytoutscCs|ii|dS(s4writes textual content to the current output buffer.N(R%RM(R)RN((s2/usr/lib/python2.6/site-packages/myghty/request.pyRMscCs|iidS(s5flushes the current output buffer to its destination.N(R%tflush(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyt flush_bufferscCs|iidS(s2clears all content from the current output buffer.N(R%tclear(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyt clear_bufferscCs{|io|idnt|_tioti}nd }ti|ti }|i t_ |i d jpt |i toH|iot|i i|_qt|i i|i|i|_n|i i|_|ii|_|_|i i|_|i i|_g}|iiiD]"\}}||ii||q.~g}|iiiD]}||ii|d qn~|i}zypt|t i!jo|i"|}n|i#o|i$|_%n||_&d}g|_'xc|o[|i'i(||i)pPn|i*}|d7}||i+jo|id|qqW|i,o|i'd} n|i'd} d } y%|i-| d|i&d|i} WnNt.i/j o n7t.i0j o} | i1} nt.i2j onX| SWnt.i3j o} |i i4| i$nt.i/j o"} |i i5| i6| i7nmt.i8j o} | } nPt9j o} t.i8d| } n*t:i;d} t.i8d| } nX| oU| i<|i|i d j o | q2|i=o | q2|i i>| |nWd |`|`d |_|t_ |oti|n ti?Xd S( s{executes this request after constructed. This is the first method called, and can only be called once per request.s(Can only call execute() once per requestiisTMax %d levels deep in determining inheritance chain (recursive inheritance pattern?)iRAR>twrappedN(@R t _raise_errortTruet reqinstancetexiststgetRtputtwarningst showwarningt_Request__showwarningRRER#tCapturingRequestImplR(RR%RR*R+RMROR1R<Rt iteritemst setdefaulttcompilert allow_globalsR ttypettypest StringTypetfetch_lead_componenttis_file_componenttpathRtrequest_componentt wrapper_chaintappendtis_filetparent_componentRRtexecute_componentRtAborttDeclinetdeclined_valuet AbortRequestt Redirectedt send_redirectt send_abortt aborted_valuetreasontErrort Exceptiontsystexc_infot initTracebackRt handle_errortremove(R)texisting_requesttsaved_showwarningt_[1]tktvt_[2]R tdepthtfirst_componenttresulttdteterror((s2/usr/lib/python2.6/site-packages/myghty/request.pytexecutes        @:         %        cKs|id|d|S(scomponent calling method which takes a simple parameter list. this method is meant to be the default method to call when calling components programmatically. compare to scomp().R R>(Rn(R)R R,((s2/usr/lib/python2.6/site-packages/myghty/request.pytcomp$scKs<|ii|id|d|dd|iiiS(s9component calling method which returns output as a stringR R>tstoreN(R%tpush_capture_bufferRnRtpop_capture_buffertgetvalue(R)R R,((s2/usr/lib/python2.6/site-packages/myghty/request.pytscomp.s cKs|i||idS(screates a subrequest with the given component and request parameters and executes it. see create_subrequest().N(tmake_subrequestR(R)R R,((s2/usr/lib/python2.6/site-packages/myghty/request.pytsubexec4scCsd}t|tijo|}|i|}n|i|ijo|id|in|p|ip|i o|o{|i omt i d| oYt i d|}|o|i|i d}n|}|i o |i}q(q,t|io|idi}q,nti||||||} |ii| |ii} |o|ii|n|io|ii| in|i} |io%| djp |io t} qn| djo#t|idjo |i} n| p|iint } zf|i!i"dto4t#} |i$d| |i!ot} | Sn|i%||}t} Wd|ii&|ii'| d | X|S( scomponent calling method which takes parameter list as a dictionary, and allows special execution options. This method is used by component call tags and internally within the Request object.s<%d levels deep in component stack (infinite recursive call?)s"(?:SELF|PARENT|REQUEST)(?:\:..*)?$s(.*):iit use_cachetretvalNtdiscard((RRcRdRetfetch_componentRRRUtis_method_componenttis_sub_componenttis_module_componenttretmatchtgrouptownertlenRRARR8RkR%t get_stateRRHt push_filterR;tuse_auto_flushRR R t push_bufferRVtflagsR`tvaluet cache_selftruntpopt pop_to_state(R)R R>RARBRRCRhRtframetinitial_buffer_statet do_auto_flushtdiscard_buffered_outputRR((s2/usr/lib/python2.6/site-packages/myghty/request.pyRn;s^    #     c Cstidd|}|}y1|ii|d|id|id|i}Wn$tij o}|i nX|i }||_ ||_ |ii |}t|do|i|_n|idjo ||_n|S(s fetches the top level (initial) component to be executed by this request. Differs from fetch_component in that the resolver context is "request" or "subrequest" and the dhandler flag is enabled when resolving. Also does not support method calls. s/+t/Rtenable_dhandlerR!R"N(RtsubRtresolve_componentRRR!RtComponentNotFoundtcreate_topleveltcsourceRt resolutiontload_componentthasattrR"RR(R)RhRRtcfoundRR ((s2/usr/lib/python2.6/site-packages/myghty/request.pyRfs1    R c Ksti|ddj}|p|djo|iS|djo,|ii}|p|idq|Sq|djo|iS|djo|idqn|io|oti d|d \}}|djo|i ||S|d d jo|i |d |S|i |d ||}|i |} | S|p"|ii |} | o| Snti|ii|}n-|id j oti|ii|}n|i|d ||S(s Given a component path (absolute or relative), returns a component. Handles SELF, PARENT, REQUEST, comp:method, relative->absolute conversion, MODULE, and local subcomponents. t:itSELFtPARENTs4PARENT designator used from component with no parenttREQUESTtMODULEs&MODULE designator requires module nameiit@RN(RNtfindRAtcurrent_componentRmRURithas_current_componentRtsplittfetch_module_componentRtlocate_inherited_methodtget_sub_componenttunixpathtjointdir_nameRRR( R)RhRR,thascolonRt owner_pathtargumenttowner_componenttmethod_componenttsubcomp((s2/usr/lib/python2.6/site-packages/myghty/request.pyRs>        cCs d}d}t|tijo0|djo|id\}}q|}n.|}|i}|djo|idnd|d|}|ii|o |i|S|i i d|d|}||i|<|o$|djot i d|n|S(s~fetches a module-based component. Usually called by fetch_component when the 'MODULE' keyword is given as a prefix. Rs+classname is required with component modulesmodule:targsCant locate component %sN( RRcRdReRRJRURR5Rtload_module_componentRR(R)t moduleorpatht classnameRtmodulet modulenametkeyR ((s2/usr/lib/python2.6/site-packages/myghty/request.pyRs$      cKsdt||f}|ii|o|i|}n/|ii|d|d||}||i|<|o$|djotid|n|S(sa mirror of interpreter.load() which caches its results in a request-local dictionary, thereby bypassing all the filesystem checks that interp does for a repeated file-based request.s%s_%sRRsCant locate component %sN(tstrRR5RtloadRRR(R)RhRRR,RR ((s2/usr/lib/python2.6/site-packages/myghty/request.pyRs! cKs|i|d|S(socreates a subrequest with the given component and request parameters. see create_subrequest().R1(tcreate_subrequest(R)R R,((s2/usr/lib/python2.6/site-packages/myghty/request.pyRst subrequestcKst|tijo)|ioti|ii|}n||d<||d<|ido:t |i ||d<|i dt |i dt n|id||}|id|_|i|ijotid n|S( sbase subrequest-creation method. A subrequest is a request that is a child to this one, enabling execution of a component and its full inheritance chain within this request.R Rt out_bufferR#R*R+Risrecursion limit exceeded(RcRdReRRRRRRYR^R#R`tDEFAULT_OUTPUT_ENCODINGtDEFAULT_ENCODING_ERRORSR6RRRRx(R)R RR,R ((s2/usr/lib/python2.6/site-packages/myghty/request.pyRs#    cKs |i|S(sa synonym for get_cache().(t get_cache(R)R,((s2/usr/lib/python2.6/site-packages/myghty/request.pytcache0scKs|djo|i}n*t|tijo|i|}n|ii|ip2|i i i d|d|i ||i|iRRC( RRCR RIRnRtcomponent_argsRVR(R)t output_buffert return_bufferR((s2/usr/lib/python2.6/site-packages/myghty/request.pyR]s ' cOs|ii||S(syreturns the Session object used by this request. If the session has not been created it will be created when this method is called. Once the session is created, this method will return the same session object repeatedly. **params is a dictionary of options used when the session is first constructed; if it already exists, the parameters are ignored.(R#t get_session(R)R>R,((s2/usr/lib/python2.6/site-packages/myghty/request.pyRnscCst|idjS(sreturns if this request has a currently executing component. This could return false if the request's top-level-component is in the loading stage.i(RR(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyRvscKs|ii||S(s0returns True if the given component path exists.(Rtcomponent_exists(R)RhR,((s2/usr/lib/python2.6/site-packages/myghty/request.pyR}sc Cs|djo d}n'|iot|}n t|}|ii}y)g}|D]}|||qW~}Wn&tj o}|id|nXx|D]}||}qW|S(sxapplies the given escape flags to the given text. escapes is a list of escape flags, such as 'h', 'u', and 'x'.tsno such escape '%s'N(RR(RtunicodeRtescapestKeyErrorRU( R)ttextRtesctableRtesctescfuncsRR=((s2/usr/lib/python2.6/site-packages/myghty/request.pyt apply_escapess     )cCs&d|ii|ii|iifS(s?debugging method that returns the current execution stack entrys2Base Comp: %s _request Comp: %s _current Comp: %s (RARRiR(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyt _get_statuss  cCs9|djotintid|d|dS(sraises an abort exception. RvRwN(RRRrRo(R)t status_codeRw((s2/usr/lib/python2.6/site-packages/myghty/request.pytaborts cCsc|ii|id|id|i}|i|i|ii<|i}t i d|dS(sused by dhandlers to decline handling the current request. Control will be passed to the next enclosing dhandler, or if none is found a ComponentNotFound (and possibly 404 error) is raised.R R1RqN( R%RRRRR1RiR!RRRRp(R)t returnvaltsubreqR((s2/usr/lib/python2.6/site-packages/myghty/request.pytdeclines    cCs3|djotd|iS|i|iSdS(sreturns the list of components in the current call stack. if an integer index is given, returns the component at that position in the current call stack.cSs|iS((R (R=((s2/usr/lib/python2.6/site-packages/myghty/request.pyR/sN(RtmapRR (R)tindex((s2/usr/lib/python2.6/site-packages/myghty/request.pytcallerss cCs3|djotd|iS|i|iSdS(sreturns the list of component arguments in the current call stack. if an integer index is given, returns the component arguments at that position in the current call stack.cSs|iS((R>(R=((s2/usr/lib/python2.6/site-packages/myghty/request.pyR/sN(RRRR>(R)R((s2/usr/lib/python2.6/site-packages/myghty/request.pyt caller_argss cCs$|djo|iS|i|SdS(sreturns the current execution stack, which consists of StackFrame objects. if an integer index is given, returns the StackFrame object at that position in the current call stack.N(RR(R)R((s2/usr/lib/python2.6/site-packages/myghty/request.pyt call_stacks cKs?|i}h}|i|i|i||i||S(sused within an inheritance chain to call the next component in the chain. If **params are given, each parameter will override the arguments sent to this component when calling the next component.(t fetch_nexttupdateR1R(R)R,RR>((s2/usr/lib/python2.6/site-packages/myghty/request.pyt call_nexts   cCsCy|ii|idSWn tj o|idnXdS(s`in an inheritance chain (i.e. of autohandlers), returns the next component in the chainis'No component available for fetch_next()N(RjRt IndexErrorRU(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyRs  cCs8g}x+t|io|i|iiq W|S(sJpops off the entire remaining list of components in the inheritance chain.(RRjRkR(R)R((s2/usr/lib/python2.6/site-packages/myghty/request.pyt fetch_alls cCs|oti|ntid|ov|id\}}tg}tid|D]7}|ti|i dti|i dfq\~}nh}|i i |i |d|i d|}|i|i itidS( ssends a redirect to the given path. If hard is True, sends an HTTP 302 redirect via the underlying RequestImpl being used. If False, clears out the current output buffer and executes a subrequest with the given path. The path can also contain url encoded query string arguments with a question mark which will be converted to key/value arguments for the next request, even if hard=False.s\?t?s([^=&]*)=([^=&]*)iiRR1N(RRsRtsearchRtdicttfinditerRt url_unescapeRR%RRRRRRPRr(R)RhthardtqueryRR9R>treq((s2/usr/lib/python2.6/site-packages/myghty/request.pyRtsa   cCs|ididjS(sdreturns whether or not the current component call was called with captured content specifiediN(RRBR(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyt has_contentscKsk|idipdS|ii}z||id_|iWdd|id_|ii|XdS(sJcalls the "captured content" function within a component call with contentiN(RRBRRDRRk(R)tkwargsR((s2/usr/lib/python2.6/site-packages/myghty/request.pyt call_contentscKs;|iiz|i|Wd|ii}X|iS(swhen inside a component call with content, this method calls the "captured content" function and buffers the content, returning the string value.N(R%RRRR(R)RR%((s2/usr/lib/python2.6/site-packages/myghty/request.pyRBs  cCskti||||i|t}|djo h}n|ii|z||Wd|iiXdS(sgiven a function, will execute it with the given arguments, after pushing the given content function onto the call stack via a new StackFrame, enabling the function to call it via the content() method.N(RR8RAR RRRkR(R)tfuncRBR>R((s2/usr/lib/python2.6/site-packages/myghty/request.pytclosure_with_contents!  cCs|ii|dS(N(RR(R)R((s2/usr/lib/python2.6/site-packages/myghty/request.pyRU'scCs|ii|dS(swrites a message to the request log. The log is RequestImpl-specific and can be standard error, a webserver error log, or a user-defined file object.N(R#tlog(R)tmessage((s2/usr/lib/python2.6/site-packages/myghty/request.pyR*sc Cs|i}ysy|i|}Wn$tj o|id|}nXtii||}|i}|i|i|}}WnnXt i ||||} | i do| d } n|i | dS(s#A custom warnings handler. smemory:s iN( Rtreverse_lookupRRRxt ReverseFileRt file_pathtget_line_numberR[t formatwarningtendswithR( R)RtcategorytfilenametlinenoRtcomprect reversefileRtmesg((s2/usr/lib/python2.6/site-packages/myghty/request.pyt __showwarning/s  cCs t|S((t_Logger(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyR/FssJ returns the logger for this Request, which is a file-like object. cCs t|iS((RR(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyR/Jss: Returns the current depth of the execution stack. cCs|idiS(i(RRA(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyR/Nss Returns the "base component" for the current stack frame, which is either the top level component or the owning component of a method component. cCs|idiS(i(RR>(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyR/Tss returns the argument dictionary from the current stack frame, corresponding to the arguments sent to the currently executing component. cCs|idiS(i(RRD(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyR/Yss returns the component-call-with-content argument dictionary from the current stack frame, corresponding to the arguments sent in an m.content() call. cCs|idiS(i(RR (R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyR/^ssM returns the calling component for the currently executing component. cCs|iS((R"(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyR/bss returns the current dhandler_argument, which corresopnds to the remaining path tokens in the request URI when executing a dhandler. cCs|idiS(i(RR (R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyR/gssP returns the component currently executing from the current stack frame. cCs$|io |iiS|idSdS(Ni(R%tencodingR&(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pytget_output_encodingls  sCThe ouput encoding for the request This is the encoding of the output written to the output buffer of the top-level request. (I.e. the encoding delivered to the user.) This is a read-only attribute, though you can change its value using the `set_output_encoding`_ method. cCs$|io |iiS|idSdS(Ni(R%terrorsR&(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pytget_encoding_errors}s  s;The encoding error handling strategy for the request This is the error handling strategy used when encoding text writtent to the output buffer of the top-level request. This is a read-only attribute, though you can change its value using the `set_output_encoding`_ method. RcCsO|io2|ii|||ii|iif|_n||f|_dS(s9Change the output_encoding. Note that in most cases you do not want to change it after you have written any output (as then your output will be in two different encodings --- probably not what you wanted unless, perhaps, you are generating Mime multipart output.) N(R%t set_encodingR(R*R&(R)R(R*((s2/usr/lib/python2.6/site-packages/myghty/request.pytset_output_encodings cCs |i|S(s(deprecated. use the attributes property.(tnotes(R)R((s2/usr/lib/python2.6/site-packages/myghty/request.pyt get_attributescCs|i||dS(s(deprecated. use the attributes property.N(R.(R)RR((s2/usr/lib/python2.6/site-packages/myghty/request.pyt set_attributescCs|iS(s(deprecated. use the attributes property.(R.(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pytget_attributesscCs|iS(s$deprecated. use the depth property.(R(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyt get_depthscCs|iS(s%deprecated. use the logger property.(tlogger(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pytget_logscCs|iS(s'deprecated. use the starttime property.(R(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pytget_start_timescCs|iS(s+deprecated. use the request_args property.(R1(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pytget_request_argsscCs|iS(s-deprecated. use the base_component property.(RA(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pytget_base_componentscCs|iS(s-deprecated. use the base_component property.(RA(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyt base_compscCs|iS(s0deprecated. use the request_component property.(Ri(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pytget_request_componentscCs|iS(s0deprecated. use the request_component property.(Ri(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyt request_compscCs|iS(s-deprecated. use the component_args property.(R(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pytget_component_argsscCs|iS(s@deprecated. use the request_path or dhandler_argument property.(R(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pytget_dhandler_argumentscCs|iS(s@deprecated. use the request_path or dhandler_argument property.(R(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyt dhandler_argscCs|iS(s+deprecated. use the request_path property.(R(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pytget_request_pathscCs|iS(s*deprecated. use the interpreter property.(R(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pytget_interpreterscCs|iS(s0deprecated. use the current_component property.(R(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pytget_current_componentscCs|iS(s0deprecated. use the current_component property.(R(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyRsN((YRJRKRLRR RVRRR-tpropertyR.troot_request_pathtroot_request_argsR2R.R4R6R8RORMRQRSRRRRRnRfRRRRRRRRRRRRRRRRRRRRRR RtRRRBRRURR]R3RRARRDtcallertdhandler_argumentRR)R*R+R+R-R/R0R1R2R4R5R6R7R8R9R:R;R<R=R>R?R@R(((s2/usr/lib/python2.6/site-packages/myghty/request.pyR$s 2              m  T  1                                                        cCs tiS(s@returns the Request instance corresponding to the current thread(RWRY(((s2/usr/lib/python2.6/site-packages/myghty/request.pyRscCs t|S(sOreturns a thread local container, with initial value that of the given variable(t ThreadLocal(R((s2/usr/lib/python2.6/site-packages/myghty/request.pyRscCs t|S(svreturns a value container object. useful for mutating data that was instantiated in a requestonce or shared block(tValue(R((s2/usr/lib/python2.6/site-packages/myghty/request.pyRstAbstractRequestImplcBsPeZdZdZdZdZdZdZdZdZ RS(cCs tdS(N(tNotImplementedError(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyR6scKs tdS(N(RI(R)RR9R,((s2/usr/lib/python2.6/site-packages/myghty/request.pyR}scKs tdS(N(RI(R)R,((s2/usr/lib/python2.6/site-packages/myghty/request.pyRscCs tdS(N(RI(R)Rh((s2/usr/lib/python2.6/site-packages/myghty/request.pyRtscCs tdS(N(RI(R)RRw((s2/usr/lib/python2.6/site-packages/myghty/request.pyRuscCs tdS(N(RI(R)R((s2/usr/lib/python2.6/site-packages/myghty/request.pyRscKsd}y|o||||SWnltij o}|}nPtj o}tid|}n*tid}tid|}nX|o@|i|i|id|i t i |i dnt S(NRTis"Custom error handler had an error:s (RRRxRyRzR{R|RRMt writelinesRNRtformatR (R)thandlerR3RR9R,terrR((s2/usr/lib/python2.6/site-packages/myghty/request.pyt_run_error_handlers   #cCs1d|_d|_d|_d|_d|_dS(N(RR<R1R3R%R (R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyR-s     ( RJRKR6R}RRtRuRRNR-(((s2/usr/lib/python2.6/site-packages/myghty/request.pyRHs       R$cBs8eZdddddZdZdZdZRS(cKs|o ||_n ti|_||_|djo h}n||_|djo h|_n|i|_ti|_ |i|_ dS(N( RRzt __stdout__t error_handlerRR1R<tcopytstderrR3R%(R)RR<R1RPR,((s2/usr/lib/python2.6/site-packages/myghty/request.pyR-s         cKsA|i|i|i|||odStii|idS(N(RNRPR3RzRRRMRK(R)RR9R,((s2/usr/lib/python2.6/site-packages/myghty/request.pyR}s"cCs|ii|ddS(Ns (R3RM(R)R((s2/usr/lib/python2.6/site-packages/myghty/request.pyR"scKst||}|iS(N(R7R6(R)R,tcloner((s2/usr/lib/python2.6/site-packages/myghty/request.pyR6$sN(RJRKRR-R}RR6(((s2/usr/lib/python2.6/site-packages/myghty/request.pyR$s  R'cBs)eZdZdZdZdZRS(sEA file-like object which "writes" to an object ``log()`` method. cCs ||_dS(N(timpl(R)RT((s2/usr/lib/python2.6/site-packages/myghty/request.pyR-+scCs|ii|dS(N(RTR(R)R((s2/usr/lib/python2.6/site-packages/myghty/request.pyRM,scCs"x|D]}|i|qWdS(N(RM(R)tlinesR((s2/usr/lib/python2.6/site-packages/myghty/request.pyRJ-s(RJRKRLR-RMRJ(((s2/usr/lib/python2.6/site-packages/myghty/request.pyR'(s  R^cBs;eZddddZedZdZdZRS(cKsr||_|_||_|djo|ii}n||_|djo |i}n||_||_dS(N(R%Rtparent_request_implRR1RQR<RP(R)RVRR1R<RPR,((s2/usr/lib/python2.6/site-packages/myghty/request.pyR-2s      cCs t|S((R'(R)((s2/usr/lib/python2.6/site-packages/myghty/request.pyR/FscKsG|io#|i|i|i|||n|ii|||dS(N(RPRNR3RVR}(R)RR9R,((s2/usr/lib/python2.6/site-packages/myghty/request.pyR}Hs  cCs|ii|dS(N(RVR(R)R((s2/usr/lib/python2.6/site-packages/myghty/request.pyROsN(RJRKRR-RAR3R}R(((s2/usr/lib/python2.6/site-packages/myghty/request.pyR^0s   ((RLt myghty.utilt myghty.bufferRFRRzRNRRRdtosRR[t posixpathRtmyghty.containerRtmyghty.escapesRtmyghty.csourceRtmyghty.requestbufferRRtgetdefaultencodingRRRFRWt__all__tobjectRRRRRRHR$R'R^(((s2/usr/lib/python2.6/site-packages/myghty/request.pyts0  `      $"