mirror of
https://github.com/jazzband/django-analytical.git
synced 2026-03-16 22:20:25 +00:00
Small changes to enumerate compatibility
Also update the changelog and version number.
This commit is contained in:
parent
861e3b7947
commit
f6a634a64e
3 changed files with 13 additions and 11 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue