Python jinja2.__version__() Examples

The following are 3 code examples of jinja2.__version__(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module jinja2 , or try the search function .
Example #1
Source File: app_cfg.py    From allura with Apache License 2.0 6 votes vote down vote up
def _setup_bytecode_cache(cls):
        cache_type = config.get('jinja_bytecode_cache_type')
        bcc = None
        try:
            if cache_type == 'memcached' and config.get('memcached_host'):
                import pylibmc
                from jinja2 import MemcachedBytecodeCache
                client = pylibmc.Client([config['memcached_host']])
                bcc_prefix = 'jinja2/{}/'.format(jinja2.__version__)
                if six.PY3:
                    bcc_prefix += 'py{}{}/'.format(sys.version_info.major, sys.version_info.minor)
                bcc = MemcachedBytecodeCache(client, prefix=bcc_prefix)
            elif cache_type == 'filesystem':
                from jinja2 import FileSystemBytecodeCache
                bcc = FileSystemBytecodeCache(pattern='__jinja2_{}_%s.cache'.format(jinja2.__version__))
        except:
            log.exception("Error encountered while setting up a" +
                          " %s-backed bytecode cache for Jinja" % cache_type)
        return bcc 
Example #2
Source File: packages_info.py    From repostat with GNU General Public License v3.0 5 votes vote down vote up
def get_pygit2_info():
    return f'{pygit2.__name__} v{pygit2.__version__} (backed by libgit2 v{pygit2.LIBGIT2_VERSION})' 
Example #3
Source File: packages_info.py    From repostat with GNU General Public License v3.0 5 votes vote down vote up
def get_jinja_info():
    return f'{jinja2.__name__} v{jinja2.__version__}'