404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.15.148.210: ~ $
3

�G�\�1�@sdZddlmZmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
ddlmZmZmZmZes�ejZejZndd�Zd	d
�ZdZdjd
�ejed�ejejdd>ejdB�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�Z dS)a�
    jinja2.bccache
    ~~~~~~~~~~~~~~

    This module implements the bytecode cache system Jinja is optionally
    using.  This is useful if you have very complex template situations and
    the compiliation of all those templates slow down your application too
    much.

    Situations where this is useful are often forking web applications that
    are initialized on the first request.

    :copyright: (c) 2017 by the Jinja Team.
    :license: BSD.
�)�path�listdirN)�sha1)�open_if_exists)�BytesIO�pickle�PY2�	text_typecCs,t|t�rtj||�n|jtj|��dS)N)�
isinstance�file�marshal�dump�write�dumps)�code�f�r�/usr/lib/python3.6/bccache.py�marshal_dump$s
rcCs"t|t�rtj|�Stj|j��S)N)r
rr�load�loads�read)rrrr�marshal_load*s

r�Zj2�ascii���c@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�BucketauBuckets are used to store the bytecode for one template.  It's created
    and initialized by the bytecode cache and passed to the loading functions.

    The buckets get an internal checksum from the cache assigned and use this
    to automatically reject outdated cache material.  Individual bytecode
    cache subclasses don't have to care about cache invalidation.
    cCs||_||_||_|j�dS)N)�environment�key�checksum�reset)�selfrr r!rrr�__init__EszBucket.__init__cCs
d|_dS)z)Resets the bucket (unloads the bytecode).N)r)r#rrrr"KszBucket.resetc
Csx|jtt��}|tkr"|j�dStj|�}|j|krB|j�dSyt|�|_Wn"t	t
tfk
rr|j�dSXdS)z/Loads bytecode from a file or file like object.N)r�len�bc_magicr"rrr!rr�EOFError�
ValueError�	TypeError)r#r�magicr!rrr�
load_bytecodeOs

zBucket.load_bytecodecCs<|jdkrtd��|jt�tj|j|d�t|j|�dS)z;Dump the bytecode into the file or file like object passed.Nzcan't write empty bucketr)rr)rr&rr
r!r)r#rrrr�write_bytecodebs


zBucket.write_bytecodecCs|jt|��dS)zLoad bytecode from a string.N)r+r)r#�stringrrr�bytecode_from_stringjszBucket.bytecode_from_stringcCst�}|j|�|j�S)zReturn the bytecode as string.)rr,�getvalue)r#�outrrr�bytecode_to_stringns
zBucket.bytecode_to_stringN)
�__name__�
__module__�__qualname__�__doc__r$r"r+r,r.r1rrrrr<src@sJeZdZdZdd�Zdd�Zdd�Zdd	d
�Zdd�Zd
d�Z	dd�Z
dS)�
BytecodeCachea�To implement your own bytecode cache you have to subclass this class
    and override :meth:`load_bytecode` and :meth:`dump_bytecode`.  Both of
    these methods are passed a :class:`~jinja2.bccache.Bucket`.

    A very basic bytecode cache that saves the bytecode on the file system::

        from os import path

        class MyCache(BytecodeCache):

            def __init__(self, directory):
                self.directory = directory

            def load_bytecode(self, bucket):
                filename = path.join(self.directory, bucket.key)
                if path.exists(filename):
                    with open(filename, 'rb') as f:
                        bucket.load_bytecode(f)

            def dump_bytecode(self, bucket):
                filename = path.join(self.directory, bucket.key)
                with open(filename, 'wb') as f:
                    bucket.write_bytecode(f)

    A more advanced version of a filesystem based bytecode cache is part of
    Jinja2.
    cCs
t��dS)z�Subclasses have to override this method to load bytecode into a
        bucket.  If they are not able to find code in the cache for the
        bucket, it must not do anything.
        N)�NotImplementedError)r#�bucketrrrr+�szBytecodeCache.load_bytecodecCs
t��dS)z�Subclasses have to override this method to write the bytecode
        from a bucket back to the cache.  If it unable to do so it must not
        fail silently but raise an exception.
        N)r7)r#r8rrr�
dump_bytecode�szBytecodeCache.dump_bytecodecCsdS)z�Clears the cache.  This method is not used by Jinja2 but should be
        implemented to allow applications to clear the bytecode cache used
        by a particular environment.
        Nr)r#rrr�clear�szBytecodeCache.clearNcCsDt|jd��}|dk	r<d|}t|t�r2|jd�}|j|�|j�S)z3Returns the unique hash key for this template name.zutf-8N�|)r�encoder
r	�update�	hexdigest)r#�name�filename�hashrrr�
get_cache_key�s


zBytecodeCache.get_cache_keycCst|jd��j�S)z"Returns a checksum for the source.zutf-8)rr<r>)r#�sourcerrr�get_source_checksum�sz!BytecodeCache.get_source_checksumcCs0|j||�}|j|�}t|||�}|j|�|S)zwReturn a cache bucket for the given template.  All arguments are
        mandatory but filename may be `None`.
        )rBrDrr+)r#rr?r@rCr r!r8rrr�
get_bucket�s


zBytecodeCache.get_bucketcCs|j|�dS)zPut the bucket into the cache.N)r9)r#r8rrr�
set_bucket�szBytecodeCache.set_bucket)N)r2r3r4r5r+r9r:rBrDrErFrrrrr6us


r6c@sBeZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�FileSystemBytecodeCachea�A bytecode cache that stores bytecode on the filesystem.  It accepts
    two arguments: The directory where the cache items are stored and a
    pattern string that is used to build the filename.

    If no directory is specified a default cache directory is selected.  On
    Windows the user's temp directory is used, on UNIX systems a directory
    is created for the user in the system temp directory.

    The pattern can be used to have multiple separate caches operate on the
    same directory.  The default pattern is ``'__jinja2_%s.cache'``.  ``%s``
    is replaced with the cache key.

    >>> bcc = FileSystemBytecodeCache('/tmp/jinja_cache', '%s.cache')

    This bytecode cache supports clearing of the cache using the clear method.
    N�__jinja2_%s.cachecCs |dkr|j�}||_||_dS)N)�_get_default_cache_dir�	directory�pattern)r#rJrKrrrr$�sz FileSystemBytecodeCache.__init__cCsZdd�}tj�}tjdkr|Sttd�s.|�dtj�}tjj||�}ytj|t	j
�Wn0tk
r�}z|jtj
krz�WYdd}~XnXyPtj|t	j
�tj|�}|jtj�ks�t	j|j�s�t	j|j�t	j
kr�|�Wn4tk
�r}z|jtj
k�r�WYdd}~XnXtj|�}|jtj�k�sPt	j|j��sPt	j|j�t	j
k�rV|�|S)NcSstd��dS)NzJCannot determine safe temp directory.  You need to explicitly provide one.)�RuntimeErrorrrrr�_unsafe_dir�szCFileSystemBytecodeCache._get_default_cache_dir.<locals>._unsafe_dir�nt�getuidz_jinja2-cache-%d)�tempfileZ
gettempdir�osr?�hasattrrOr�join�mkdir�stat�S_IRWXU�OSError�errnoZEEXIST�chmod�lstat�st_uid�S_ISDIR�st_mode�S_IMODE)r#rMZtmpdir�dirnameZ
actual_dir�eZactual_dir_statrrrrI�s:




z.FileSystemBytecodeCache._get_default_cache_dircCstj|j|j|j�S)N)rrSrJrKr )r#r8rrr�_get_cache_filenamesz+FileSystemBytecodeCache._get_cache_filenamec
Cs6t|j|�d�}|dk	r2z|j|�Wd|j�XdS)N�rb)rrar+�close)r#r8rrrrr+s
z%FileSystemBytecodeCache.load_bytecodec
Cs.t|j|�d�}z|j|�Wd|j�XdS)N�wb)�openrar,rc)r#r8rrrrr9sz%FileSystemBytecodeCache.dump_bytecodecCsbddlm}tjt|j�|jd�}x8|D]0}y|tj|j|��Wq*t	k
rXYq*Xq*WdS)Nr)�remove�*)
rQrf�fnmatch�filterrrJrKrrSrW)r#rf�filesr@rrrr:s
zFileSystemBytecodeCache.clear)NrH)
r2r3r4r5r$rIrar+r9r:rrrrrG�s
)rGc@s*eZdZdZddd�Zdd�Zd	d
�ZdS)�MemcachedBytecodeCacheavThis class implements a bytecode cache that uses a memcache cache for
    storing the information.  It does not enforce a specific memcache library
    (tummy's memcache or cmemcache) but will accept any class that provides
    the minimal interface required.

    Libraries compatible with this class:

    -   `werkzeug <http://werkzeug.pocoo.org/>`_.contrib.cache
    -   `python-memcached <https://www.tummy.com/Community/software/python-memcached/>`_
    -   `cmemcache <http://gijsbert.org/cmemcache/>`_

    (Unfortunately the django cache interface is not compatible because it
    does not support storing binary data, only unicode.  You can however pass
    the underlying cache client to the bytecode cache which is available
    as `django.core.cache.cache._client`.)

    The minimal interface for the client passed to the constructor is this:

    .. class:: MinimalClientInterface

        .. method:: set(key, value[, timeout])

            Stores the bytecode in the cache.  `value` is a string and
            `timeout` the timeout of the key.  If timeout is not provided
            a default timeout or no timeout should be assumed, if it's
            provided it's an integer with the number of seconds the cache
            item should exist.

        .. method:: get(key)

            Returns the value for the cache key.  If the item does not
            exist in the cache the return value must be `None`.

    The other arguments to the constructor are the prefix for all keys that
    is added before the actual cache key and the timeout for the bytecode in
    the cache system.  We recommend a high (or no) timeout.

    This bytecode cache does not support clearing of used items in the cache.
    The clear method is a no-operation function.

    .. versionadded:: 2.7
       Added support for ignoring memcache errors through the
       `ignore_memcache_errors` parameter.
    �jinja2/bytecode/NTcCs||_||_||_||_dS)N)�client�prefix�timeout�ignore_memcache_errors)r#rmrnrorprrrr$QszMemcachedBytecodeCache.__init__cCsPy|jj|j|j�}Wn tk
r8|js0�d}YnX|dk	rL|j|�dS)N)rm�getrnr �	Exceptionrpr.)r#r8rrrrr+Xs
z$MemcachedBytecodeCache.load_bytecodecCs\|j|j|j�f}|jdk	r*||jf7}y|jj|�Wntk
rV|jsR�YnXdS)N)rnr r1rorm�setrrrp)r#r8�argsrrrr9bs
z$MemcachedBytecodeCache.dump_bytecode)rlNT)r2r3r4r5r$r+r9rrrrrk#s
,

rk)!r5rQrr�sysrUrXrrPrhZhashlibrZjinja2.utilsrZjinja2._compatrrrr	r
rrrZ
bc_versionr<r�version_infor&�objectrr6rGrkrrrr�<module>s. 9N`

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 2.42 KB 0644
__init__.cpython-36.pyc File 2.42 KB 0644
_compat.cpython-36.opt-1.pyc File 3.21 KB 0644
_compat.cpython-36.pyc File 3.21 KB 0644
_identifier.cpython-36.opt-1.pyc File 1.75 KB 0644
_identifier.cpython-36.pyc File 1.75 KB 0644
asyncfilters.cpython-36.opt-1.pyc File 4.63 KB 0644
asyncfilters.cpython-36.pyc File 4.63 KB 0644
asyncsupport.cpython-36.opt-1.pyc File 7.9 KB 0644
asyncsupport.cpython-36.pyc File 7.9 KB 0644
bccache.cpython-36.opt-1.pyc File 12.37 KB 0644
bccache.cpython-36.pyc File 12.37 KB 0644
compiler.cpython-36.opt-1.pyc File 45.69 KB 0644
compiler.cpython-36.pyc File 45.75 KB 0644
constants.cpython-36.opt-1.pyc File 1.61 KB 0644
constants.cpython-36.pyc File 1.61 KB 0644
debug.cpython-36.opt-1.pyc File 9.01 KB 0644
debug.cpython-36.pyc File 9.07 KB 0644
defaults.cpython-36.opt-1.pyc File 1.37 KB 0644
defaults.cpython-36.pyc File 1.37 KB 0644
environment.cpython-36.opt-1.pyc File 41.85 KB 0644
environment.cpython-36.pyc File 42.2 KB 0644
exceptions.cpython-36.opt-1.pyc File 4.85 KB 0644
exceptions.cpython-36.pyc File 4.85 KB 0644
ext.cpython-36.opt-1.pyc File 19.53 KB 0644
ext.cpython-36.pyc File 19.58 KB 0644
filters.cpython-36.opt-1.pyc File 33.84 KB 0644
filters.cpython-36.pyc File 33.97 KB 0644
idtracking.cpython-36.opt-1.pyc File 9.62 KB 0644
idtracking.cpython-36.pyc File 9.66 KB 0644
lexer.cpython-36.opt-1.pyc File 17.96 KB 0644
lexer.cpython-36.pyc File 18.08 KB 0644
loaders.cpython-36.opt-1.pyc File 16.14 KB 0644
loaders.cpython-36.pyc File 16.14 KB 0644
meta.cpython-36.opt-1.pyc File 3.53 KB 0644
meta.cpython-36.pyc File 3.53 KB 0644
nativetypes.cpython-36.opt-1.pyc File 4.96 KB 0644
nativetypes.cpython-36.pyc File 4.96 KB 0644
nodes.cpython-36.opt-1.pyc File 35.39 KB 0644
nodes.cpython-36.pyc File 35.75 KB 0644
optimizer.cpython-36.opt-1.pyc File 1.94 KB 0644
optimizer.cpython-36.pyc File 1.94 KB 0644
parser.cpython-36.opt-1.pyc File 24.7 KB 0644
parser.cpython-36.pyc File 24.7 KB 0644
runtime.cpython-36.opt-1.pyc File 23.95 KB 0644
runtime.cpython-36.pyc File 23.98 KB 0644
sandbox.cpython-36.opt-1.pyc File 13.82 KB 0644
sandbox.cpython-36.pyc File 13.82 KB 0644
tests.cpython-36.opt-1.pyc File 4.26 KB 0644
tests.cpython-36.pyc File 4.26 KB 0644
utils.cpython-36.opt-1.pyc File 20.15 KB 0644
utils.cpython-36.pyc File 20.15 KB 0644
visitor.cpython-36.opt-1.pyc File 3.22 KB 0644
visitor.cpython-36.pyc File 3.22 KB 0644