+
    üÐjŽ  ã                   óJ  € R t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHtH	t	 ^ RI
Ht ^ RIHtHtHtHtHt Rt ! R R	]4      t ! R
 R4      t]P,                  ! RR]4      tR tR t ! R R]P4                  4      t ! R R]P4                  4      t ! R R]P4                  4      tR# )zH
I contain PythonScript, which is a very simple python script resource.
N)ÚStringIO)Ú	copyright)ÚexecfileÚnetworkString)Ú_coerceToFilesystemEncoding)ÚhttpÚresourceÚserverÚstaticÚutilzº<p>You forgot to assign to the variable "resource" in your script. For example:</p>
<pre>
# MyCoolWebApp.rpy

import mygreatresource

resource = mygreatresource.MyGreatResource()
</pre>
c                   ó   € ] tR t^tRtRtR# )ÚAlreadyCachedz?
This exception is raised when a path has already been cached.
© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   ó    Ú4/usr/lib/python3/dist-packages/twisted/web/script.pyr   r      s   † õr   r   c                   ó2   a € ] tR t^$t o R tR tR tRtV tR# )ÚCacheScannerc                ó,   € Wn         W n        ^ V n        R# )é    N)ÚpathÚregistryÚdoCache©Úselfr   r   s   &&&r   Ú__init__ÚCacheScanner.__init__%   s   € ØŒ	Ø ŒØˆŽr   c                óŽ   € V P                   P                  V P                  4      pVe   \        V4      hV P	                  4        R # ©N)r   ÚgetCachedPathr   r   Úrecache)r   Úcs   & r   ÚcacheÚCacheScanner.cache*   s3   € Ø�M‰M×'Ñ'¨¯	©	Ó2ˆØŠ=Ü Ó"Ð"Ø�‰Žr   c                ó   € ^V n         R# )é   N)r   )r   s   &r   r%   ÚCacheScanner.recache0   s	   € ØˆŽr   )r   r   r   N)	r   r   r   r   r    r'   r%   r   Ú__classdictcell__©Ú__classdict__s   @r   r   r   $   s   ø‡ € òò
÷ð r   r   éô  úWhoops! Internal Errorc           
     óT  € \        W4      pR\        RV 4      R\        RVRVP                  RVP                  /p \        WV4       TR,          pTP                  '       d   T\        Jd   TP                  Y4       T#   \         d   pTP                  ^ ,          u Rp?# Rp?ii ; i)zš
I am a normal py file which must define a 'resource' global, which should
be an instance of (a subclass of) web.resource.Resource; it will be
renderred.
Ú__file__Ú r   r   r'   r%   N)
r   r   ÚnoRsrcr'   r%   r   r   Úargsr   Ú	cachePath)r   r   ÚcsÚglobÚacÚrsrcs   &&    r   ÚResourceScriptr;   7   sœ   € ô 
�dÓ	%€BàÔ/°°DÓ9Ø”FØ�HØ�—‘Ø�2—:‘:ð€DðÜ�˜TÔ"ð �
Õ€DØ	‡z‡z€z�d¤&Ó(Ø×Ñ˜4Ô&Ø€Køô ô Ø�w‰w�q�zÕûðús   »A? Á?B'Â
B"ÂB'Â"B'c                 ó*  € ^ RI Hp R\        RV 4      R\        P                  ! RR\
        4      RV/p\        V 4      ;_uu_ 4       pVP                  W@4      pRRR4       \        XR	R
4      p\        WcV4       VR,          #   + '       g   i     L2; i)r   )Úptl_compiler2   r3   r   r/   r0   r   Nz<source>Úexec)
Úquixoter=   r   r   Ú_UnsafeErrorPageÚrpyNoResourceÚopenÚcompile_templateÚcompileÚeval)r   r   r=   r8   ÚfÚeÚcodes   &&     r   ÚResourceTemplaterI   O   s‡   € Ý#ð 	Ô/°°DÓ9Ø”H×-Ò-ØÐ)¬=ó
ð 	�Hð€Dô 
ˆd�Œ�qØ×(Ñ(¨Ó1ˆ÷ 
ä�1�j &Ó)€DÜˆ�TÔØ�
ÕÐ÷	 
�ús   ÁBÂB	c                   ó6   a € ] tR t^at o RR ltR tR tRtV tR# )ÚResourceScriptWrapperNc                ó˜   € \         P                  P                  V 4       Wn        T;'       g    \        P
                  ! 4       V n        R # r#   ©r   ÚResourcer    r   r
   ÚRegistryr   r   s   &&&r   r    ÚResourceScriptWrapper.__init__b   s1   € Ü×Ñ×"Ñ" 4Ô(ØŒ	Ø ×5Ð5¤F§O¢OÓ$5ˆŽr   c                ód   € \        V P                  V P                  4      pVP                  V4      # r#   )r;   r   r   Úrender)r   ÚrequestÚress   && r   rR   ÚResourceScriptWrapper.renderg   s%   € Ü˜TŸY™Y¨¯©Ó6ˆØ�z‰z˜'Ó"Ð"r   c                ód   € \        V P                  V P                  4      pVP                  W4      # r#   )r;   r   r   ÚgetChildWithDefault)r   r   rS   rT   s   &&& r   rW   Ú)ResourceScriptWrapper.getChildWithDefaultk   s'   € Ü˜TŸY™Y¨¯©Ó6ˆØ×&Ñ& tÓ5Ð5r   ©r   r   r#   )	r   r   r   r   r    rR   rW   r   r,   r-   s   @r   rK   rK   a   s   ø‡ € ô6ò
#÷6ð 6r   rK   c                   ó:   a € ] tR t^pt o RtRR ltR tR tRtV t	R# )ÚResourceScriptDirectoryaç  
L{ResourceScriptDirectory} is a resource which serves scripts from a
filesystem directory.  File children of a L{ResourceScriptDirectory} will
be served using L{ResourceScript}.  Directory children will be served using
another L{ResourceScriptDirectory}.

@ivar path: A C{str} giving the filesystem path in which children will be
    looked up.

@ivar registry: A L{static.Registry} instance which will be used to decide
    how to interpret scripts found as children of this resource.
Nc                ó˜   € \         P                  P                  V 4       Wn        T;'       g    \        P
                  ! 4       V n        R # r#   rM   )r   Úpathnamer   s   &&&r   r    Ú ResourceScriptDirectory.__init__~   s1   € Ü×Ñ×"Ñ" 4Ô(ØŒ	Ø ×5Ð5¤F§O¢OÓ$5ˆŽr   c                óh  € \         P                  P                  V P                  V4      p\         P                  P                  V4      '       d   \	        W0P
                  4      # \         P                  P                  V4      '       d   \        W0P
                  4      # \        P                  ! 4       # r#   )
Úosr   ÚjoinÚisdirr[   r   Úexistsr;   r   Ú_UnsafeNoResource)r   r   rS   Úfns   &&& r   ÚgetChildÚ ResourceScriptDirectory.getChildƒ   sm   € Ü�W‰W�\‰\˜$Ÿ)™) TÓ*ˆä�7‰7�=‰=˜×ÒÜ*¨2¯}©}Ó=Ð=Ü�7‰7�>‰>˜"×ÒÜ! "§m¡mÓ4Ð4Ü×)Ò)Ó+Ð+r   c                óJ   € \         P                  ! 4       P                  V4      # r#   )r   rd   rR   )r   rS   s   &&r   rR   ÚResourceScriptDirectory.renderŒ   s   € Ü×)Ò)Ó+×2Ñ2°7Ó;Ð;r   rY   r#   )
r   r   r   r   r   r    rf   rR   r   r,   r-   s   @r   r[   r[   p   s   ø‡ € ñô6ò
,÷<ð <r   r[   c                   ó4   a € ] tR t^�t o RtRtR tR tRtV t	R# )ÚPythonScriptz®
I am an extremely simple dynamic resource; an embedded python script.

This will execute a file (usually of the extension '.epy') as Python code,
internal to the webserver.
Tc                ó   € Wn         W n        R# )z#
Initialize me with a script name.
N©Úfilenamer   )r   rn   r   s   &&&r   r    ÚPythonScript.__init__š   s   € ð !ŒØ Žr   c                óü  € VP                  R\        R\        P                  ,          4      4       RVR\	        RV P
                  4      RV P                  /p \        V P
                  W"4       VP3                  4        \4        P6                  #   \         do   pTP                  ^8X  dT   TP                  \        P                  4       TP                  \        P                  ! R4      P!                  T4      4        Rp?L”Rp?i\"         dl    \%        4       p\&        P(                  ! TR	7       \*        P,                  ! TP/                  4       4      pTP1                  R
4      pTP                  T4        ELi ; i)a  
Render me to a web client.

Load my file, execute it in a special namespace (with 'request' and
'__file__' global vars) and finish the request.  Output to the web-page
will NOT be handled with print - standard output goes to the log - but
with request.write.
s   x-powered-byz
Twisted/%srS   r2   r3   r   zFile not found.N)ÚfileÚutf8)Ú	setHeaderr   r   Úversionr   rn   r   r   ÚOSErrorÚerrnoÚsetResponseCoder   Ú	NOT_FOUNDÚwriter   rd   rR   ÚBaseExceptionr   Ú	tracebackÚ	print_excr   Ú_PREÚgetvalueÚencodeÚfinishr	   ÚNOT_DONE_YET)r   rS   Ú	namespacerG   ÚioÚoutputs   &&    r   rR   ÚPythonScript.render¡   s  € ð 	×ÑØœ]¨<¼)×:KÑ:KÕ+KÓLô	
ð �wØÔ3°B¸¿¹ÓFØ˜Ÿ™ð
ˆ	ð
	"Ü�T—]‘] IÔ9ð 	�‰ÔÜ×"Ñ"Ð"øô ô 	Ø�w‰w˜!Œ|Ø×'Ñ'¬¯©Ô7Ø—‘Ü×.Ò.Ð/@ÓA×HÑHÈÓQôÿøô ô 	"Ü“ˆBÜ×Ò RÕ(Ü—Y’Y˜rŸ{™{›}Ó-ˆFØ—]‘] 6Ó*ˆFØ�M‰M˜&×!ð	"ús&   ÁB ÂE;ÂA$DÄE;ÄA(E;Å:E;rm   N)
r   r   r   r   r   ÚisLeafr    rR   r   r,   r-   s   @r   rk   rk   �   s    ø‡ € ñð €Fò!÷ #ð  #r   rk   )r   r`   r{   rƒ   r   Útwistedr   Útwisted.python.compatr   r   Útwisted.python.filepathr   Útwisted.webr   r   r	   r
   r   rA   Ú	Exceptionr   r   r@   r4   r;   rI   rN   rK   r[   rk   r   r   r   Ú<module>rŒ      s™   ðñ
ó
 
Û Ý å ß 9Ý ?ß <Õ <ð€ô�Iô ÷ñ ð  
×	"Ò	" 3Ð(@À-Ó	P€òò0ô$6˜H×-Ñ-ô 6ô<˜h×/Ñ/ô <ô@1#�8×$Ñ$ö 1#r   