#NEWLINE# def create( typname , version = None , server = None , res_desc = None , **ctor_args ) : #NEWLINE# #INDENT# 'Create and return an object specified by the given type,\n    version, etc.\n    ' #NEWLINE# obj = None #NEWLINE# msgs = [ ] #NEWLINE# for fct in _factories : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# obj = fct . create ( typname , version , server , res_desc , ** ctor_args ) #NEWLINE# #UNINDENT# except Exception as err : #NEWLINE# #INDENT# if ( str ( err ) not in msgs ) : #NEWLINE# #INDENT# msgs . append ( str ( err ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( obj is not None ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# if ( obj is not None ) : #NEWLINE# #INDENT# typeset . add ( typname ) #NEWLINE# return obj #NEWLINE# #UNINDENT# if msgs : #NEWLINE# #INDENT# msg = ( ': ' + '\n' . join ( msgs ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# msg = '' #NEWLINE# #UNINDENT# raise NameError ( ( ( ( "unable to create object of type '" + typname ) + "'" ) + msg ) )