Skip to content

Commit

Permalink
added python 2.5 compatibility to google_analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
rasca committed Jul 18, 2011
1 parent 2e4cb7f commit a0c6d99
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions analytical/templatetags/google_analytics.py
Expand Up @@ -36,6 +36,15 @@

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):
Expand Down

0 comments on commit a0c6d99

Please sign in to comment.