HOME


Mini Shell 1.0
DIR: /usr/lib/python3/dist-packages/twisted/web/__pycache__/
Upload File :
Current File : //usr/lib/python3/dist-packages/twisted/web/__pycache__/rewrite.cpython-312.pyc
�

Ϫ�fK��F�ddlmZGd�dej�Zd�Zd�Zy)�)�resourcec�$�eZdZd�Zd�Zd�Zd�Zy)�RewriterResourcec�p�tjj|�||_t|�|_y�N)r�Resource�__init__�list�rewriteRules)�self�origrs   �5/usr/lib/python3/dist-packages/twisted/web/rewrite.pyr	zRewriterResource.__init__	s*�����"�"�4�(���
� ��.���c�6�|jD]
}||��yr)r)r�request�rewriteRules   r�_rewritezRewriterResource._rewrites���,�,�	!�K��� �	!rc�4�|jjd|�|jj�|j	|�|jjd�}|jj|�|jj||�S)Nr)�postpath�insert�prepath�popr�appendr�getChildWithDefault)r�pathrs   r�getChildzRewriterResource.getChildss��������4�(��������
�
�g�����#�#�A�&�������t�$��}�}�0�0��w�?�?rc�Z�|j|�|jj|�Sr)rr�render)rrs  rrzRewriterResource.renders#���
�
�g���}�}�#�#�G�,�,rN)�__name__�
__module__�__qualname__r	rrr�rrrrs��/�
!�@�-rrc���|jrh|jddddk(rRd|jdddg|jddddj|j|jz�z|_yyy)Nr��~�users�/)r�joinrr)rs r�tildeToUsersr)sy�����G�,�,�Q�/���3�s�:� '��)9�)9�!�)<�Q�R�)@�A�����!���S�X�X�g�o�o��8H�8H�&H�I�I���;�rc�Z����jd���jd����fd�}|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.
    r'c����|jdt���k(rS|jt��d}�|z|_ddj|j|jz�z|_yy)Nr')r�lenr(rr)r�after�	aliasPath�
sourcePaths  ��r�rewriterzalias.<locals>.rewriter1sj������,�c�)�n�-��:��$�$�S��^�%5�6�E�)�E�1�G������'�/�/�G�<L�<L�*L�!M�M�G�L�;r)�split)r.r/r0s`` r�aliasr2%s0����!�!�#�&�J�����$�I�N��OrN)�twisted.webrrrr)r2r"rr�<module>r4s'��
!�-�x�(�(�-�.J�r