#NEWLINE# def get_items_from_entries( self , signature , * attrs ) : #NEWLINE# #INDENT# registry = get_module_registry ( ) #NEWLINE# def canonicalize( sig_item ) : #NEWLINE# #INDENT# if isinstance ( sig_item , tuple ) : #NEWLINE# #INDENT# descriptor = registry . get_descriptor ( sig_item [ 0 ] ) #NEWLINE# label = sig_item [ 1 ] #NEWLINE# return ( descriptor , label ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( sig_item , list ) : #NEWLINE# #INDENT# descriptor = registry . get_descriptor_by_name ( get_vistrails_basic_pkg_id ( ) , 'List' ) #NEWLINE# return ( descriptor , None ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( registry . get_descriptor ( sig_item ) , None ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# ps_items = [ ] #NEWLINE# if ( not isinstance ( signature , list ) ) : #NEWLINE# #INDENT# signature = [ signature ] #NEWLINE# #UNINDENT# self . _resize_attrs ( signature , * attrs ) #NEWLINE# for ( i , item_tuple ) in enumerate ( izip ( signature , * attrs ) ) : #NEWLINE# #INDENT# ( descriptor , item_label ) = canonicalize ( item_tuple [ 0 ] ) #NEWLINE# kwargs = self . _set_attrs ( None , * item_tuple [ 1 : ] ) #NEWLINE# if ( not kwargs [ 'label' ] ) : #NEWLINE# #INDENT# if ( item_label != '<no description>' ) : #NEWLINE# #INDENT# kwargs [ 'label' ] = item_label #NEWLINE# #UNINDENT# #UNINDENT# ps_item = PortSpecItem ( pos = canonicalize , package = descriptor . identifier , module = descriptor . name , namespace = descriptor . namespace , ** kwargs ) #NEWLINE# ps_items . append ( ps_item ) #NEWLINE# #UNINDENT# return ps_items