#NEWLINE# def is_last_page( self , page ) : #NEWLINE# #INDENT# ' Is the page the last page? ' #NEWLINE# if ( page in self . _pages ) : #NEWLINE# #INDENT# if ( not ( page is self . _pages [ ( - 1 ) ] ) ) : #NEWLINE# #INDENT# is_last = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . next_controller is None ) : #NEWLINE# #INDENT# is_last = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# is_last = self . next_controller . is_last_page ( page ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . next_controller is not None ) : #NEWLINE# #INDENT# is_last = self . next_controller . is_last_page ( page ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( self . _pages ) > 0 ) : #NEWLINE# #INDENT# is_last = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# is_last = True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return is_last