def locate_config(confname, app_name,<EOL>location=None, prefix='<STR_LIT>', verbose=False):
candidates = []<EOL>if location:<EOL><INDENT>candidate = os.path.normpath(os.path.join(location, confname))<EOL>if os.path.isfile(candidate):<EOL><INDENT>candidates += [candidate]<EOL><DEDENT><DEDENT>candidate = os.path.normpath(os.path.join(<EOL>os.path.dirname(os.path.dirname(sys.executable)),<EOL>prefix, app_name, confname))<EOL>if os.path.isfile(candidate):<EOL><INDENT>candidates += [candidate]<EOL><DEDENT>candidate = os.path.normpath('<STR_LIT>' % (prefix, app_name, confname))<EOL>if os.path.isfile(candidate):<EOL><INDENT>candidates += [candidate]<EOL><DEDENT>candidate = os.path.normpath(os.path.join(os.getcwd(), confname))<EOL>if os.path.isfile(candidate):<EOL><INDENT>candidates += [candidate]<EOL><DEDENT>if candidates:<EOL><INDENT>if verbose:<EOL><INDENT>LOGGER.info("<STR_LIT>", candidates[<NUM_LIT:0>])<EOL><DEDENT>return candidates[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>LOGGER.warning("<STR_LIT>", confname)<EOL><DEDENT>return None<EOL>
Returns absolute path on the filesystem to a config file named *confname*.