403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.156
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/pystache/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/pystache/__pycache__/loader.cpython-310.pyc
o

r|a�@sLdZddlZddlmZddlmZddlmZdd�ZGdd	�d	e�Z	dS)
zJ
This module provides a Loader class for locating and reading templates.

�N)�common)�defaults)�LocatorcCsddd�}|S)NcSs|durtj}t||tj�S)zW
        Raises a TypeError exception if the given string is already unicode.

        N)r�STRING_ENCODING�str�
DECODE_ERRORS)�s�encoding�r
�1/usr/lib/python3/dist-packages/pystache/loader.py�
to_unicodesz$_make_to_unicode.<locals>.to_unicode�Nr
)rr
r
r�_make_to_unicodes
	rc@sVeZdZdZ				ddd�Zdd�Zddd�Zdd	d
�Zdd�Zd
d�Z	dd�Z
dS)�Loaderz�
    Loads the template associated to a name or user-defined object.

    All load_*() methods return the template as a unicode string.

    NcCsT|durtj}|durtj}|durtj}|durt�}||_||_||_||_dS)a
        Construct a template loader instance.

        Arguments:

          extension: the template file extension, without the leading dot.
            Pass False for no extension (e.g. to use extensionless template
            files).  Defaults to the package default.

          file_encoding: the name of the encoding to use when converting file
            contents to unicode.  Defaults to the package default.

          search_dirs: the list of directories in which to search when loading
            a template by name or file name.  Defaults to the package default.

          to_unicode: the function to use when converting strings of type
            str to unicode.  The function should have the signature:

              to_unicode(s, encoding=None)

            It should accept a string of type str and an optional encoding
            name and return a string of type unicode.  Defaults to calling
            Python's built-in function unicode() using the package string
            encoding and decode errors defaults.

        N)	r�TEMPLATE_EXTENSION�
FILE_ENCODING�SEARCH_DIRSr�	extension�
file_encoding�search_dirsr)�selfrrrrr
r
r�__init__)s!
zLoader.__init__cCst|jd�S)N)r)rr)rr
r
r�
_make_locator\szLoader._make_locatorcCst|t�r	t|�S|�||�S)an
        Convert a string to unicode using the given encoding, and return it.

        This function uses the underlying to_unicode attribute.

        Arguments:

          s: a basestring instance to convert to unicode.  Unlike Python's
            built-in unicode() function, it is okay to pass unicode strings
            to this function.  (Passing a unicode string to Python's unicode()
            with the encoding argument throws the error, "TypeError: decoding
            Unicode is not supported.")

          encoding: the encoding to pass to the to_unicode attribute.
            Defaults to None.

        )�
isinstancerr)rrr	r
r
rr_s
z
Loader.strcCsDt�|�}|dur|j}t��dkr|�||��dd�S|�||�S)zZ
        Read the template at the given path, and return it as a unicode string.

        N�Windows�
�)r�readr�platform�systemr�replace)r�pathr	�br
r
rrvs
zLoader.readcC� |��}|�||j�}|�|�S)z�
        Find and return the template with the given file name.

        Arguments:

          file_name: the file name of the template.

        )r�	find_filerr)r�	file_name�locatorr!r
r
r�	load_file��	
zLoader.load_filecCr#)z�
        Find and return the template with the given template name.

        Arguments:

          name: the name of the template.

        )r�	find_namerr)r�namer&r!r
r
r�	load_name�r(zLoader.load_namecCr#)z�
        Find and return the template associated to the given object.

        Arguments:

          obj: an instance of a user-defined class.

          search_dirs: the list of directories in which to search.

        )r�find_objectrr)r�objr&r!r
r
r�load_object�s
zLoader.load_object)NNNNr
)�__name__�
__module__�__qualname__�__doc__rrrrr'r+r.r
r
r
rr s	
�3


r)
r2r�pystacherr�pystache.locatorrr�objectrr
r
r
r�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit