def read_config_file(libname):
filename = glymurrc_fname()<EOL>if filename is None:<EOL><INDENT>return None<EOL><DEDENT>parser = ConfigParser()<EOL>parser.read(filename)<EOL>try:<EOL><INDENT>path = parser.get('<STR_LIT>', libname)<EOL><DEDENT>except (NoOptionError, NoSectionError):<EOL><INDENT>path = None<EOL><DEDENT>return path<EOL>
Extract library locations from a configuration file.

Parameters
----------
libname : str
    One of either 'openjp2' or 'openjpeg'

Returns
-------
path : None or str
    None if no location is specified, otherwise a path to the library