#NEWLINE# def _get_feature_menu( self ) : #NEWLINE# #INDENT# " Returns the 'Features' sub_menu.\n        " #NEWLINE# enable_features_action . enabled = disable_features_action . enabled = False #NEWLINE# for feature in features : #NEWLINE# #INDENT# if ( feature . feature_name != '' ) : #NEWLINE# #INDENT# if ( feature . state == 1 ) : #NEWLINE# #INDENT# disable_features_action . enabled = True #NEWLINE# if enable_features_action . enabled : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# enable_features_action . enabled = True #NEWLINE# if disable_features_action . enabled : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# actions = [ ] #NEWLINE# for feature in features : #NEWLINE# #INDENT# if ( feature . feature_name != '' ) : #NEWLINE# #INDENT# actions . append ( Action ( name = feature . feature_name , action = 'on_toggle_feature' , _feature = feature , style = 'toggle' , checked = ( feature . state == 1 ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( len ( actions ) > 0 ) : #NEWLINE# #INDENT# actions . sort ( ( lambda l , r : cmp ( l . name , r . name ) ) ) #NEWLINE# actions [ 0 : 0 ] = [ Separator ( ) ] #NEWLINE# #UNINDENT# return Menu ( * ( [ enable_features_action , disable_features_action ] + actions ) , name = 'Features' )