|
|
@ -50,13 +50,12 @@ from tornado import version as tornadoVersion
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
from urllib.parse import quote
|
|
|
|
from urllib.parse import quote
|
|
|
|
from imp import reload
|
|
|
|
from imp import reload
|
|
|
|
from past.builtins import xrange
|
|
|
|
|
|
|
|
except ImportError as e:
|
|
|
|
except ImportError as e:
|
|
|
|
from urllib import quote
|
|
|
|
from urllib import quote
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
from flask_login import __version__ as flask_loginVersion
|
|
|
|
from flask_login import __version__ as flask_loginVersion
|
|
|
|
except ImportError, e:
|
|
|
|
except ImportError as e:
|
|
|
|
from flask_login.__about__ import __version__ as flask_loginVersion
|
|
|
|
from flask_login.__about__ import __version__ as flask_loginVersion
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
@ -260,6 +259,10 @@ class Pagination(object):
|
|
|
|
def iter_pages(self, left_edge=2, left_current=2,
|
|
|
|
def iter_pages(self, left_edge=2, left_current=2,
|
|
|
|
right_current=5, right_edge=2):
|
|
|
|
right_current=5, right_edge=2):
|
|
|
|
last = 0
|
|
|
|
last = 0
|
|
|
|
|
|
|
|
if 'xrange' not in globals():#no xrange in Python3
|
|
|
|
|
|
|
|
global xrange
|
|
|
|
|
|
|
|
xrange = range
|
|
|
|
|
|
|
|
|
|
|
|
for num in xrange(1, self.pages + 1): # ToDo: can be simplified
|
|
|
|
for num in xrange(1, self.pages + 1): # ToDo: can be simplified
|
|
|
|
if num <= left_edge or (num > self.page - left_current - 1 and num < self.page + right_current) \
|
|
|
|
if num <= left_edge or (num > self.page - left_current - 1 and num < self.page + right_current) \
|
|
|
|
or num > self.pages - right_edge:
|
|
|
|
or num > self.pages - right_edge:
|
|
|
|