#NEWLINE# def _get_num_pages( self ) : #NEWLINE# #INDENT# 'Returns the total number of pages.' #NEWLINE# if ( self . _num_pages is None ) : #NEWLINE# #INDENT# if ( ( self . count == 0 ) and ( not self . allow_empty_first_page ) ) : #NEWLINE# #INDENT# self . _num_pages = 0 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# hits = max ( 1 , ( self . count - self . orphans ) ) #NEWLINE# self . _num_pages = int ( ceil ( ( hits / float ( self . per_page ) ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return self . _num_pages