#NEWLINE# def _get_value_from_conf_file( self , kind , converter = None ) : #NEWLINE# #INDENT# 'A helper function to read a value from one of the state files.' #NEWLINE# file_name = self . get_conf_file_name ( kind ) #NEWLINE# msg = _ ( 'Error while reading %s' ) #NEWLINE# try : #NEWLINE# #INDENT# with open ( file_name , 'r' ) as f : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return ( converter ( f . read ( ) ) if converter else f . read ( ) ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# msg = _ ( 'Unable to convert value in %s' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except IOError : #NEWLINE# #INDENT# msg = _ ( 'Unable to access %s' ) #NEWLINE# #UNINDENT# LOG . debug ( msg , file_name ) #NEWLINE# return None