[Python-modules-commits] [django-jinja] 01/03: Import django-jinja_2.1.3.orig.tar.gz

Edward Betts edward at moszumanska.debian.org
Fri May 27 10:30:07 UTC 2016


This is an automated email from the git hooks/post-receive script.

edward pushed a commit to branch master
in repository django-jinja.

commit 84aad78da1860a30945988faa3366d43e49cb270
Author: Edward Betts <edward at 4angle.com>
Date:   Fri May 27 09:40:08 2016 +0100

    Import django-jinja_2.1.3.orig.tar.gz
---
 PKG-INFO                       |  2 +-
 README.rst                     | 11 +++++++++++
 django_jinja.egg-info/PKG-INFO |  2 +-
 django_jinja/backend.py        | 17 ++++++++++++-----
 setup.cfg                      |  2 +-
 setup.py                       |  2 +-
 6 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/PKG-INFO b/PKG-INFO
index 06ff406..0d668aa 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: django-jinja
-Version: 2.1.2
+Version: 2.1.3
 Summary: Jinja2 templating language integrated in Django.
 Home-page: https://github.com/niwinz/django-jinja
 Author: Andrey Antukh
diff --git a/README.rst b/README.rst
index 7e40190..d0d46a9 100644
--- a/README.rst
+++ b/README.rst
@@ -27,3 +27,14 @@ You can install it with pip:
 .. code-block:: shell
 
     pip install django-jinja
+
+How to run tests as a developer
+-------------------------------
+
+Install the Tox automation tool (outside a virtualenv), then
+
+.. code-block:: shell
+
+    tox
+
+Tox will create virtualenvs for different interpreter versions and run the test suite.
diff --git a/django_jinja.egg-info/PKG-INFO b/django_jinja.egg-info/PKG-INFO
index 06ff406..0d668aa 100644
--- a/django_jinja.egg-info/PKG-INFO
+++ b/django_jinja.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: django-jinja
-Version: 2.1.2
+Version: 2.1.3
 Summary: Jinja2 templating language integrated in Django.
 Home-page: https://github.com/niwinz/django-jinja
 Author: Andrey Antukh
diff --git a/django_jinja/backend.py b/django_jinja/backend.py
index 8fb0ad4..599df7f 100644
--- a/django_jinja/backend.py
+++ b/django_jinja/backend.py
@@ -27,6 +27,7 @@ from django.template import TemplateSyntaxError
 from django.template.backends.base import BaseEngine
 from django.template.backends.utils import csrf_input_lazy
 from django.template.backends.utils import csrf_token_lazy
+from django.template.context import BaseContext
 from django.utils import lru_cache
 from django.utils import six
 from django.utils.encoding import smart_text
@@ -54,18 +55,18 @@ class Template(object):
     def __init__(self, template, backend):
         self.template = template
         self.backend = backend
-
-        self._debug = False
         self.origin = Origin(name=template.filename, template_name=template.name)
 
     @property
     def name(self):
-        return self.origin.name
+        return self.template.name
 
     def render(self, context=None, request=None):
         if context is None:
             context = {}
 
+        context = base.dict_from_context(context)
+
         if request is not None:
             def _get_val():
                 token = get_token(request)
@@ -83,7 +84,6 @@ class Template(object):
 
         if self.backend._tmpl_debug:
             from django.test import signals
-            from django.template.context import BaseContext
 
             # Define a "django" like context for emitatet the multi
             # layered context object. This is mainly for apps like
@@ -172,7 +172,14 @@ class Jinja2(BaseEngine):
 
         environment_cls = import_string(environment_clspath)
 
-        options.setdefault("loader", jinja2.FileSystemLoader(self.template_dirs))
+        if isinstance(options.get("loader"), six.string_types):
+            # Allow to specify a loader as string
+            loader_cls = import_string(options.pop("loader"))
+        else:
+            # Backward compatible default
+            loader_cls = jinja2.FileSystemLoader
+
+        options.setdefault("loader", loader_cls(self.template_dirs))
         options.setdefault("extensions", builtins.DEFAULT_EXTENSIONS)
         options.setdefault("auto_reload", settings.DEBUG)
         options.setdefault("autoescape", True)
diff --git a/setup.cfg b/setup.cfg
index a669c45..00bb0ae 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,5 @@
 [egg_info]
+tag_date = 0
 tag_svn_revision = 0
 tag_build = 
-tag_date = 0
 
diff --git a/setup.py b/setup.py
index f94237e..bcf0d1e 100644
--- a/setup.py
+++ b/setup.py
@@ -15,7 +15,7 @@ if sys.version_info < (2, 7):
 
 setup(
     name = "django-jinja",
-    version = "2.1.2",
+    version = "2.1.3",
     description = "Jinja2 templating language integrated in Django.",
     long_description = "",
     keywords = "django, jinja2",

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/django-jinja.git



More information about the Python-modules-commits mailing list