def _get_data_name_item_choices ( self ):
        context = self.input_data_context
        if context is None:
            return []

        if not self.all_choices:
            output_context = self.output_data_context
            if output_context is not None:
                return [ TemplateChoice( choice_value = name )
                          for name in output_context.data_context_values ]

        return ([ TemplateChoice( choice_value = ResetChoice ) ] +
                self._get_choices( context ))
    def _get_choices ( self, context, path = '' ):
        """ Returns the list of available user settings choices for the
            specified context.
        """
        choices = [ TemplateChoice( choice_value = path_for( path, name ) )
                    for name in context.data_context_values ]

        if self.recursive:
            # Now process all of the context's sub-contexts:
            gdc = context.get_data_context
            for name in context.data_contexts:
                choices.extend( self._get_choices( gdc( name ), path_for( path,
                                    context.data_context_name ) ) )

        return choices
 def _get_data_name_item_choice(self):
     return TemplateChoice(choice_value=self.current_name)
Exemple #4
0
 def _get_data_name_item_choice(self):
     return TemplateChoice(choice_value='%dD array' % self.dimensions)