Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib64/python3.7/site-packages/twisted/web/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/site-packages/twisted/web/__pycache__/rewrite.cpython-37.pyc

B

;��]<�@s2ddlmZGdd�dej�Zdd�Zdd�ZdS)	�)�resourcec@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�RewriterResourcecGs tj�|�||_t|�|_dS)N)r�Resource�__init__�list�rewriteRules)�self�origr�r
�F/opt/alt/python37/lib64/python3.7/site-packages/twisted/web/rewrite.pyr	szRewriterResource.__init__cCsx|jD]}||�qWdS)N)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�|�S)N)r
r�render)rr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�after)�	aliasPath�
sourcePathr
r�rewriter/s
zalias.<locals>.rewriter)�split)r r!r"r
)r r!r�alias$s	

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