summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9c0dadb)
I went for the minimal option and tried to preserve the previous logic
as much as possible.
I target Python 3.3 so that I don't have to touch the u'' strings.
# Check whether there are any other autopaginations are later in this template
expr = lambda obj: (obj.token_type == TOKEN_BLOCK and \
len(obj.split_contents()) > 0 and obj.split_contents()[0] == "autopaginate")
# Check whether there are any other autopaginations are later in this template
expr = lambda obj: (obj.token_type == TOKEN_BLOCK and \
len(obj.split_contents()) > 0 and obj.split_contents()[0] == "autopaginate")
- multiple_paginations = len(filter(expr, parser.tokens)) > 0
+ multiple_paginations = len([tok for tok in parser.tokens if expr(tok)]) > 0
i = iter(token.split_contents())
paginate_by = None
i = iter(token.split_contents())
paginate_by = None
orphans = None
word = None
try:
orphans = None
word = None
try:
assert word == "autopaginate"
assert word == "autopaginate"
- queryset_var = i.next()
- word = i.next()
+ queryset_var = next(i)
+ word = next(i)
if word != "as":
paginate_by = word
try:
paginate_by = int(paginate_by)
except ValueError:
pass
if word != "as":
paginate_by = word
try:
paginate_by = int(paginate_by)
except ValueError:
pass
if word != "as":
orphans = word
try:
orphans = int(orphans)
except ValueError:
pass
if word != "as":
orphans = word
try:
orphans = int(orphans)
except ValueError:
pass
except StopIteration:
pass
if queryset_var is None:
except StopIteration:
pass
if queryset_var is None:
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.3",
],
install_requires=[
'django >= 1.2',
],
install_requires=[
'django >= 1.2',