#NEWLINE# def iter_pages( self , left_edge = 2 , left_current = 2 , right_current = 5 , right_edge = 2 ) : #NEWLINE# #INDENT# 'Iterates over the page numbers in the pagination.  The four\n        parameters control the thresholds how many numbers should be produced\n        from the sides.  Skipped page numbers are represented as `None`.\n        This is how you could render such a pagination in the templates:\n        .. sourcecode:: html+jinja\n            {% macro render_pagination(pagination, endpoint) %}\n              <div class=pagination>\n              {%- for page in pagination.iter_pages() %}\n                {% if page %}\n                  {% if page != pagination.page %}\n                    <a href="{{ url_for(endpoint, page=page) }}">{{ page }}</a>\n                  {% else %}\n                    <strong>{{ page }}</strong>\n                  {% endif %}\n                {% else %}\n                  <span class=ellipsis>...</span>\n                {% endif %}\n              {%- endfor %}\n              </div>\n            {% endmacro %}\n        ' #NEWLINE# last = 0 #NEWLINE# for num in xrange ( 1 , ( self . pages + 1 ) ) : #NEWLINE# #INDENT# if ( ( num <= left_edge ) or ( ( num > ( ( self . page - left_current ) - 1 ) ) and ( num < ( self . page + right_current ) ) ) or ( num > ( self . pages - right_edge ) ) ) : #NEWLINE# #INDENT# if ( ( last + 1 ) != num ) : #NEWLINE# #INDENT# ( yield None ) #NEWLINE# #UNINDENT# ( yield num ) #NEWLINE# last = num