#NEWLINE# def read_version( ide_path , version_file_name ) : #NEWLINE# #INDENT# lib_path = os . path . join ( ide_path , 'lib' ) #NEWLINE# version_file_path = os . path . join ( lib_path , version_file_name ) #NEWLINE# version_file = base . abs_file . File ( version_file_path ) #NEWLINE# version_name = version_file . read ( ) . strip ( ) #NEWLINE# if ( not version_name ) : #NEWLINE# #INDENT# version_name = 'unknown version' #NEWLINE# #UNINDENT# version_txt = version_name #NEWLINE# if ( ':' in version_txt ) : #NEWLINE# #INDENT# version_txt = version_txt . split ( ':' ) [ 1 ] #NEWLINE# #UNINDENT# if version_txt . startswith ( 'v' ) : #NEWLINE# #INDENT# version_txt = version_txt [ 1 : ] #NEWLINE# #UNINDENT# version_txt = version_txt . replace ( '.' , '' ) #NEWLINE# version = '0' #NEWLINE# for char in version_txt : #NEWLINE# #INDENT# if ( not ( char in '0123456789' ) ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# version += char #NEWLINE# #UNINDENT# version = str ( int ( version ) ) #NEWLINE# return ( version_name , version_file_path )