HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/twisted/web/__pycache__/rewrite.cpython-38.pyc
U


W[<�@s2ddlmZGdd�dej�Zdd�Zdd�ZdS)	�)�resourcec@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�RewriterResourcecGs tj�|�||_t|�|_dS�N)r�Resource�__init__�list�rewriteRules)�selfZorigr�r
�5/usr/lib/python3/dist-packages/twisted/web/rewrite.pyr	szRewriterResource.__init__cCs|jD]}||�qdSr)r)r	�requestZrewriteRuler
r
r�_rewrites
zRewriterResource._rewritecCsH|j�d|�|j��|�|�|j�d�}|j�|�|j�||�S)Nr)�postpath�insert�prepath�popr
�appendrZgetChildWithDefault)r	�pathrr
r
r�getChilds

zRewriterResource.getChildcCs|�|�|j�|�Sr)r
r�render)r	rr
r
rrs
zRewriterResource.renderN)�__name__�
__module__�__qualname__rr
rrr
r
r
rrsrcCsX|jrT|jddd�dkrTd|jddd�g|jdd�<dd�|j|j�|_dS)Nr��~Zusers�/)r�joinrr)rr
r
r�tildeToUserss rcs&��d����d����fdd�}|S)a�
    I am not a very good aliaser. But I'm the best I can be. If I'm
    aliasing to a Resource that generates links, and it uses any parts
    of request.prepath to do so, the links will not be relative to the
    aliased path, but rather to the aliased-to path. That I can't
    alias static.File directory listings that nicely. However, I can
    still be useful, as many resources will play nice.
    rcsN|jdt����krJ|jt��d�}�||_dd�|j|j�|_dS)Nr)r�lenrrr)rZafter��	aliasPath�
sourcePathr
r�rewriter/s
zalias.<locals>.rewriter)�split)r r!r"r
rr�alias$s	

r$N)Ztwisted.webrrrrr$r
r
r
r�<module>s