#NEWLINE# def find_mesh_in_catkin_ws( filename ) : #NEWLINE# #INDENT# if ( not find_mesh_in_catkin_ws . cache ) : #NEWLINE# #INDENT# result = '' #NEWLINE# for ( root , dirs , files ) in os . walk ( catkin_ws_path , followlinks = True ) : #NEWLINE# #INDENT# for currfile in files : #NEWLINE# #INDENT# if ( currfile . endswith ( '.stl' ) or currfile . endswith ( '.dae' ) ) : #NEWLINE# #INDENT# partial_path = '' #NEWLINE# for path_part in root . split ( '/' ) : #NEWLINE# #INDENT# partial_path += ( path_part + '/' ) #NEWLINE# if os . path . exists ( ( partial_path + '/package.xml' ) ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# catkin_stack_path = partial_path . replace ( ( path_part + '/' ) , '' ) #NEWLINE# filename_path = os . path . join ( root , currfile ) . replace ( catkin_stack_path , '' ) #NEWLINE# find_mesh_in_catkin_ws . cache . append ( filename_path ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# matching = [ path for path in find_mesh_in_catkin_ws . cache if ( filename in path ) ] #NEWLINE# return ' OR ' . join ( matching )