#NEWLINE# @ app . route ( '/links/<int:n>/<int:offset>' ) #NEWLINE# def link_page( request , n , offset ) : #NEWLINE# #INDENT# 'Generate a page containing n links to other pages which do the same.' #NEWLINE# n = int ( n ) #NEWLINE# offset = int ( offset ) #NEWLINE# n = min ( max ( 1 , n ) , 200 ) #NEWLINE# link = "<a href='{0}'>{1}</a> " #NEWLINE# html = [ '<html><head><title>Links</title></head><body>' ] #NEWLINE# for i in xrange ( n ) : #NEWLINE# #INDENT# if ( i == n ) : #NEWLINE# #INDENT# html . append ( '{0} ' . format ( i ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# html . append ( link . format ( url_for ( 'link_page' , n = n , offset = i ) , i ) ) #NEWLINE# #UNINDENT# #UNINDENT# html . append ( '</body></html>' ) #NEWLINE# return '' . join ( html )