/usr/lib64/python2.6/site-packages/jinja2
Edit: /usr/lib64/python2.6/site-packages/jinja2/bccache.pyc (13477B)
Ñò
îºÓXc @ sK d Z d d k l Z l Z d d k Z d d k Z d d k Z d d k Z d d k l
Z
d d k Z d d k Z d d k Z y d d k
l Z Wn# e j
o d d k l Z n Xd d k l Z d Z d i d
ƒ e i e d ƒ Z d e f d
„ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d S( sÉ
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) 2009 by the Jinja Team.
:license: BSD.
iÿÿÿÿ( t patht listdirN( t StringIO( t sha1( t new( t open_if_existsi t j2t asciii t Bucketc B sD e Z d Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z RS( su Buckets 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.
c C s) | | _ | | _ | | _ | i ƒ d S( N( t environmentt keyt checksumt reset( t selfR R
R ( ( s4 /usr/lib64/python2.6/site-packages/jinja2/bccache.pyt __init__. s c C s
d | _ d S( s) Resets the bucket (unloads the bytecode).N( t Nonet code( R
( ( s4 /usr/lib64/python2.6/site-packages/jinja2/bccache.pyR 4 s c C s¡ | i t t ƒ ƒ } | t j o | i ƒ d St i | ƒ } | i | j o | i ƒ d St | t ƒ o t i | ƒ | _
n t i | i ƒ ƒ | _
d S( s/ Loads bytecode from a file or file like object.N( t readt lent bc_magicR t picklet loadR t
isinstancet filet marshalR t loads( R
t ft magicR ( ( s4 /usr/lib64/python2.6/site-packages/jinja2/bccache.pyt
load_bytecode8 s
c C s‡ | i d j o t d ƒ ‚ n | i t ƒ t i | i | d ƒ t | t ƒ o t
i | i | ƒ n | i t
i | i ƒ ƒ d S( s; Dump the bytecode into the file or file like object passed.s can't write empty bucketi N( R R t TypeErrort writeR R t dumpR R R R t dumps( R
R ( ( s4 /usr/lib64/python2.6/site-packages/jinja2/bccache.pyt write_bytecodeK s
c C s | i t | ƒ ƒ d S( s Load bytecode from a string.N( R R ( R
t string( ( s4 /usr/lib64/python2.6/site-packages/jinja2/bccache.pyt bytecode_from_stringV s c C s t ƒ } | i | ƒ | i ƒ S( s Return the bytecode as string.( R R! t getvalue( R
t out( ( s4 /usr/lib64/python2.6/site-packages/jinja2/bccache.pyt bytecode_to_stringZ s
( t __name__t
__module__t __doc__R R R R! R# R&