#NEWLINE# def _in_process_find_conf_file( conf_src_dir , conf_file_name , use_sample = True ) : #NEWLINE# #INDENT# "\n    Look for a file first in conf_src_dir, if it exists, otherwise optionally\n    look in the source tree sample 'etc' dir.\n\n    :param conf_src_dir: Directory in which to search first for conf file. May\n                         be None\n    :param conf_file_name: Name of conf file\n    :param use_sample: If True and the conf_file_name is not found, then return\n                       any sample conf file found in the source tree sample\n                       'etc' dir by appending '-sample' to conf_file_name\n    :returns: Path to conf file\n    :raises InProcessException: If no conf file is found\n    " #NEWLINE# dflt_src_dir = os . path . normpath ( os . path . join ( os . path . abspath ( __file__ ) , os . pardir , os . pardir , os . pardir , 'etc' ) ) #NEWLINE# conf_src_dir = ( dflt_src_dir if ( conf_src_dir is None ) else conf_src_dir ) #NEWLINE# conf_file_path = os . path . join ( conf_src_dir , conf_file_name ) #NEWLINE# if os . path . exists ( conf_file_path ) : #NEWLINE# #INDENT# return conf_file_path #NEWLINE# #UNINDENT# if use_sample : #NEWLINE# #INDENT# conf_file_name += '-sample' #NEWLINE# conf_file_path = os . path . join ( dflt_src_dir , conf_file_name ) #NEWLINE# if os . path . exists ( conf_file_path ) : #NEWLINE# #INDENT# return conf_file_path #NEWLINE# #UNINDENT# #UNINDENT# msg = ( 'Failed to find config file %s' % conf_file_name ) #NEWLINE# raise InProcessException ( msg )