#NEWLINE# def get_layout( install_root ) : #NEWLINE# #INDENT# "Returns a dictionary representing the layout of an SDK installation.\n\n    For example, the 'bin' key points to the directory which contains the executables under the\n    given installation root.\n\n    Additionally, the installation root is checked to make sure all required files and directories\n    are there. Since this is an expensive operation, the result of calling get_layout() should be\n    cached and passed around instead of invoking this function each time.\n\n    " #NEWLINE# rootdir = os . path . abspath ( install_root ) #NEWLINE# pydir = ( 'python%s.%s' % sys . version_info [ : 2 ] ) #NEWLINE# layout = { #NEWLINE# #INDENT# 'root' : rootdir , #NEWLINE# 'bin' : os . path . join ( rootdir , 'bin' ) , #NEWLINE# 'include' : os . path . join ( rootdir , 'include' ) , #NEWLINE# 'lib' : os . path . join ( rootdir , 'lib' ) , #NEWLINE# 'plugins' : os . path . join ( rootdir , 'plugins' ) , #NEWLINE# 'python' : os . path . join ( rootdir , pydir ) , #NEWLINE# 'sip' : os . path . join ( rootdir , 'share' , 'sip' ) , #NEWLINE# #UNINDENT# } #NEWLINE# for path in layout . values ( ) : #NEWLINE# #INDENT# if ( not os . path . isdir ( path ) ) : #NEWLINE# #INDENT# print ( ( 'WARNING: Missing required directory %s' % path ) ) #NEWLINE# #UNINDENT# #UNINDENT# sipconfig = os . path . join ( layout [ 'python' ] , 'sipconfig.py' ) #NEWLINE# if ( not os . path . isfile ( path ) ) : #NEWLINE# #INDENT# print ( ( 'WARNING: Missing required file %s' % sipconfig ) ) #NEWLINE# #UNINDENT# return layout