Small changes to enumerate compatibility

Also update the changelog and version number.
This commit is contained in:
Joost Cassee 2011-07-21 07:17:01 +02:00
parent 861e3b7947
commit f6a634a64e
3 changed files with 13 additions and 11 deletions

View file

@ -1,3 +1,7 @@
Version 0.9.1
-------------
* Fixed compatibility with Python 2.5 (Iván Raskovsky)
Version 0.9.0
-------------
* Updated Clicky tracking code to support multiple site ids.

View file

@ -10,6 +10,6 @@ Django_ project. See the ``docs`` directory for more information.
__author__ = "Joost Cassee"
__email__ = "joost@cassee.net"
__version__ = "0.9.0"
__version__ = "0.9.1"
__copyright__ = "Copyright (C) 2011 Joost Cassee and others"
__license__ = "MIT License"

View file

@ -10,6 +10,14 @@ from django.template import Library, Node, TemplateSyntaxError
from analytical.utils import is_internal_ip, disable_html, get_required_setting
def enumerate(sequence, start=0):
"""Copy of the Python 2.6 `enumerate` builtin for compatibility."""
n = start
for elem in sequence:
yield n, elem
n += 1
SCOPE_VISITOR = 1
SCOPE_SESSION = 2
SCOPE_PAGE = 3
@ -36,16 +44,6 @@ CUSTOM_VAR_CODE = "_gaq.push(['_setCustomVar', %(index)s, '%(name)s', " \
register = Library()
def enumerate(sequence, start=0):
"""
Port of 2.6's python enumerate() for compatibility with previos versions
"""
n = start
for elem in sequence:
yield n, elem
n += 1
@register.tag
def google_analytics(parser, token):
"""