* Django 1.8 compatibility.
* Remove private headers from response.
* Python-3 compatible get_version.
+## 0.2.4 (2015-04-16)
+
+* Django 1.8 compatibility.
+
+* Remove private headers from response.
+
+* Python-3 compatible get_version.
+
+
## 0.2.3 (2014-09-22)
* Don't assume request object we are passed at any point still has
## 0.2.3 (2014-09-22)
* Don't assume request object we are passed at any point still has
![AGPL Logo](http://www.gnu.org/graphics/agplv3-155x51.png)
![AGPL Logo](http://www.gnu.org/graphics/agplv3-155x51.png)
- Copyright © 2014 Fundacja Nowoczesna Polska <fundacja@nowoczesnapolska.org.pl>
+ Copyright © 2014,2015 Fundacja Nowoczesna Polska <fundacja@nowoczesnapolska.org.pl>
For full list of contributors see AUTHORS section at the end.
For full list of contributors see AUTHORS section at the end.
--- /dev/null
+[bdist_wheel]
+universal=1
+
def get_version():
basedir = os.path.dirname(__file__)
with open(os.path.join(basedir, 'ssify/version.py')) as f:
def get_version():
basedir = os.path.dirname(__file__)
with open(os.path.join(basedir, 'ssify/version.py')) as f:
- VERSION = None
- exec(f.read())
- return VERSION
+ variables = {}
+ exec(f.read(), variables)
+ return variables.get('VERSION')
raise RuntimeError('No version info found.')
raise RuntimeError('No version info found.')
from .version import VERSION
__version__ = VERSION
from .version import VERSION
__version__ = VERSION
__all__ = ('flush_ssi_includes', 'ssi_expect', 'SsiVariable', 'ssi_included', 'ssi_variable')
from .variables import ssi_expect, SsiVariable
__all__ = ('flush_ssi_includes', 'ssi_expect', 'SsiVariable', 'ssi_included', 'ssi_variable')
from .variables import ssi_expect, SsiVariable
# Prepend the SSI variables.
if hasattr(request, 'ssi_vars_needed'):
vars_needed = request.ssi_vars_needed
# Prepend the SSI variables.
if hasattr(request, 'ssi_vars_needed'):
vars_needed = request.ssi_vars_needed
- else:
- vars_needed = json_decode(response.get('X-Ssi-Vars-Needed', '{}'))
+ elif 'X-Ssi-Vars-Needed' in response:
+ vars_needed = json_decode(response['X-Ssi-Vars-Needed'])
for k, v in vars_needed.items():
vars_needed[k] = SsiVariable(*v)
for k, v in vars_needed.items():
vars_needed[k] = SsiVariable(*v)
+ if not settings.DEBUG:
+ del response['X-Ssi-Vars-Needed']
+ else:
+ vars_needed = None
if vars_needed:
response.content = provide_vars(request, vars_needed) + \
if vars_needed:
response.content = provide_vars(request, vars_needed) + \
del response[header]
else:
response[header] = content
del response[header]
else:
response[header] = content
+ if not settings.DEBUG:
+ del response['X-ssi-restore']
else:
for response_modifier in getattr(request, 'ssi_patch_response', []):
response_modifier(response)
else:
for response_modifier in getattr(request, 'ssi_patch_response', []):
response_modifier(response)
"""
from __future__ import unicode_literals
from hashlib import md5
"""
from __future__ import unicode_literals
from hashlib import md5
-from django import template
+from django.template import Node
+from django.template.base import get_library
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.functional import Promise
from django.utils.safestring import mark_safe
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.functional import Promise
from django.utils.safestring import mark_safe
def get_value(self, request):
"""Computes the real value of the variable, using the request."""
taglib, tagname = self.tagpath.rsplit('.', 1)
def get_value(self, request):
"""Computes the real value of the variable, using the request."""
taglib, tagname = self.tagpath.rsplit('.', 1)
- return template.get_library(taglib).tags[tagname].get_value(
+ return get_library(taglib).tags[tagname].get_value(
request, *self.args, **self.kwargs)
def __str__(self):
request, *self.args, **self.kwargs)
def __str__(self):
-class SsiVariableNode(template.Node):
+class SsiVariableNode(Node):
""" Node for the SsiVariable tags. """
def __init__(self, tagpath, args, kwargs, patch_response=None, asvar=None):
self.tagpath = tagpath
""" Node for the SsiVariable tags. """
def __init__(self, tagpath, args, kwargs, patch_response=None, asvar=None):
self.tagpath = tagpath
from __future__ import unicode_literals
from __future__ import unicode_literals
-VERSION = '0.2.3'
\ No newline at end of file
+VERSION = '0.2.4'
\ No newline at end of file
[tox]
envlist=clear,
d1{5,6}-py{26,27,32,33},
[tox]
envlist=clear,
d1{5,6}-py{26,27,32,33},
- d{17,d}-py{27,32,33,34},
+ d{17,18}-py{27,32,33,34},
+ d{d}-py{27,33,34},
d15: Django>=1.5,<1.6
d16: Django>=1.6,<1.7
d17: Django>=1.7,<1.8
d15: Django>=1.5,<1.6
d16: Django>=1.6,<1.7
d17: Django>=1.7,<1.8
- dd: https://github.com/django/django/zipball/master
+ d18: Django>=1.8,<1.9
+ dd: https://github.com/django/django/archive/master.tar.gz
coverage
basepython=
py26: python2.6
coverage
basepython=
py26: python2.6