
July 29, 2005
10:51 a.m.
At 12:17 PM 7/29/2005 -0500, Ian Bicking wrote:
What's the correct way to get access to files in the .egg-info directory (where I'm putting some custom configuration files)? I got this far:
req = pkg_resources.Requirement('ProjectName')
dist = get_provider(req) contents = dist.get_metadata('some_filename_in_egg_info') See IMetadataProvider for the other methods you can use on metadata, such as has_metadata(), metadata_isdir(), metadata_listdir(), etc. Distributions support both IMetadataProvider and IResourceProvider, if they were created with an appropriate metadata object. (i.e, they're ones created by find_distributions() and its kin, as opposed to ones that are just links found on a web page.)