#NEWLINE# def _flags_for( self , p , content ) : #NEWLINE# #INDENT# flags = 0 #NEWLINE# if ( p == self . position ) : #NEWLINE# #INDENT# flags |= curses . color_pair ( 2 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( self . _state in self . ACTIVE_STATES ) and self . _in_current_subtable ( p ) ) : #NEWLINE# #INDENT# if ( self . _state == self . State . select ) : #NEWLINE# #INDENT# flags |= curses . A_REVERSE #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert ( self . _state == self . State . deselect ) #NEWLINE# flags |= curses . color_pair ( 1 ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( p in flags . _selection ) : #NEWLINE# #INDENT# flags |= curses . A_REVERSE #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# flags |= curses . color_pair ( 1 ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return flags