#NEWLINE# def populate_datastore_choices( self , request , context ) : #NEWLINE# #INDENT# choices = ( ) #NEWLINE# set_initial = False #NEWLINE# datastores = self . datastores ( datastores ) #NEWLINE# if ( datastores is not None ) : #NEWLINE# #INDENT# num_datastores_with_one_version = 0 #NEWLINE# for ds in datastores : #NEWLINE# #INDENT# versions = self . datastore_versions ( request , ds . name ) #NEWLINE# if ( not set_initial ) : #NEWLINE# #INDENT# if ( len ( versions ) >= 2 ) : #NEWLINE# #INDENT# set_initial = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( versions ) == 1 ) : #NEWLINE# #INDENT# num_datastores_with_one_version += 1 #NEWLINE# if ( num_datastores_with_one_version > 1 ) : #NEWLINE# #INDENT# set_initial = True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if ( len ( versions ) > 0 ) : #NEWLINE# #INDENT# version_choices = ( ) #NEWLINE# for v in versions : #NEWLINE# #INDENT# version_choices = ( version_choices + ( ( ( ( ds . name + ',' ) + v . name ) , v . name ) , ) ) #NEWLINE# #UNINDENT# datastore_choices = ( ds . name , version_choices ) #NEWLINE# choices = ( choices + ( datastore_choices , ) ) #NEWLINE# #UNINDENT# #UNINDENT# if set_initial : #NEWLINE# #INDENT# initial = ( 'select_datastore_type_version' , _ ( 'Select datastore type and version' ) ) #NEWLINE# choices = ( ( initial , ) + choices ) #NEWLINE# #UNINDENT# #UNINDENT# return choices