[Zope-dev] docs.zope.org automation

Martijn Faassen faassen at startifact.com
Mon Aug 2 12:26:29 EDT 2010


On 08/02/2010 05:25 PM, Jens Vagelpohl wrote:
>> python setup.py --long-description
>
> Can someone tell me how to do that when I am in Python code already?
> Given the path to the checkout, can I use some setuptools/pkg_resources
> or pkginfo magic to get at this data?

Oh, this is where I always get scared because I always get lost. :)

The pkg_resources documentation is here:

http://packages.python.org/distribute/pkg_resources.html

You can probably create a Distribution object somehow (handwave) from a 
path (whether that's the path of the package or the path the package is 
in, not sure).

Then maybe 'get_metadata('long_description') on the distribution object, 
but maybe not as one seems to have to supply metadata when constructing 
a distribution..

But again, I always get lost here, perhaps you need an Environment or a 
WorkingSet first, etc.

Regards,

Martijn



More information about the Zope-Dev mailing list