@@ -121,6 +121,7 @@ def load_folders(self,name_or_uri=None,force=False):
121121 while len (self ._foldersnotyetloaded )> 0 :
122122 logger .info ( "-----------------------" )
123123 queryuri = self ._foldersnotyetloaded .pop (0 )
124+ queryuri = self ._foldersnotyetloaded .pop (0 )
124125 parent = self ._folders .get (queryuri ) # parent is None for the first query for the root folder
125126
126127 logger .info ( f"Retrieving { queryuri = } parent { self ._folders .get (queryuri )} " )
@@ -487,6 +488,14 @@ def get_local_config(self, name_or_uri, global_config_uri=None):
487488 result = cu
488489 return result
489490
491+ def list_configs ( self ):
492+ configs = []
493+ self .load_configs ()
494+ for cu , cd in self ._configurations .items ():
495+ configs .append ( cd ['name' ] )
496+
497+ return configs
498+
490499 # for RM, load the typesystem using the OSLC shape resources listed for the Requirements and Requirements Collection creation factories
491500 def _load_types (self ,force = False ):
492501 logger .debug ( f"load type { self = } { force = } " )
@@ -626,13 +635,23 @@ def get_local_component_details(self):
626635 results [compuri ] = compdetail ['name' ]
627636 return results
628637
638+
629639 def find_local_component (self , name_or_uri ):
630640 self .load_components_and_configurations ()
631641 for compuri , compdetail in self ._components .items ():
632642 if compuri == name_or_uri or compdetail ['name' ] == name_or_uri :
633643 return compdetail ['component' ]
634644 return None
635-
645+
646+ def list_components ( self ):
647+ # list all the component names
648+ self .load_components_and_configurations ()
649+ components = []
650+ for compuri , compdetail in self ._components .items ():
651+ if compdetail .get ('name' ):
652+ components .append ( compdetail .get ('name' ) )
653+ return components
654+
636655 def _create_component_api (self , component_prj_url , component_name , confs_to_load ):
637656 logger .info ( f"CREATE RM COMPONENT { self = } { component_prj_url = } { component_name = } { self .app = } { self .is_optin = } { self .singlemode = } " )
638657 result = _RMComponent (component_name , component_prj_url , self .app , self .is_optin , self .singlemode , defaultinit = False , project = self )
0 commit comments