#NEWLINE# def get_build_dirs( self , all_configs = False ) : #NEWLINE# #INDENT# "Return a dictionary containing the build directory list\n        for the known and the unknown configurations::\n\n            build_directories = {\n                'known_configs' = [],\n                'unknown_configs' = [],\n            }\n\n        Note: if all_configs if False, then the list of the unknown\n        configuration remains empty.\n\n        " #NEWLINE# if ( not all_configs ) : #NEWLINE# #INDENT# bdirs = list ( ) #NEWLINE# if os . path . isdir ( self . build_directory ) : #NEWLINE# #INDENT# bdirs . append ( self . build_directory ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'known_configs' : bdirs , #NEWLINE# 'unknown_configs' : list ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# build_names = [ ( 'build-sys-%s-%s' % ( platform . system ( ) . lower ( ) , platform . machine ( ) . lower ( ) ) ) ] #NEWLINE# qibuild_cfg = qibuild . config . QiBuildConfig ( ) #NEWLINE# qibuild_cfg . read ( create_if_missing = True ) #NEWLINE# config_names = qibuild_cfg . configs . keys ( ) #NEWLINE# build_names . extend ( [ ( 'build-' + x ) for x in config_names ] ) #NEWLINE# build_prefix = self . build_config . build_prefix #NEWLINE# if build_prefix : #NEWLINE# #INDENT# to_list = os . path . join ( build_prefix ) #NEWLINE# if os . path . exists ( to_list ) : #NEWLINE# #INDENT# dirs = os . listdir ( to_list ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dirs = list ( ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# dirs = os . listdir ( self . path ) #NEWLINE# #UNINDENT# ret = { #NEWLINE# #INDENT# 'known_configs' : list ( ) , #NEWLINE# 'unknown_configs' : list ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# for bdir in dirs : #NEWLINE# #INDENT# if ( bdir in build_names ) : #NEWLINE# #INDENT# ret [ 'known_configs' ] . append ( bdir ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if bdir . startswith ( 'build-' ) : #NEWLINE# #INDENT# ret [ 'unknown_configs' ] . append ( bdir ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# for k in ret . keys ( ) : #NEWLINE# #INDENT# if build_prefix : #NEWLINE# #INDENT# ret [ k ] = [ os . path . join ( build_prefix , x , self . name ) for x in ret [ k ] ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ret [ bdir ] = [ os . path . join ( self . path , x ) for x in ret [ k ] ] #NEWLINE# #UNINDENT# #UNINDENT# return ret