buildout/buildout — pull request #88 by jaap3 (2013-02-26 15:59:33+00:00)
Title: Refactored picked versions logic to make it easier to use for plugins

I've taken a look at making the picked_versions stuff more usable for plugins (as mentioned in issue #70)

Extracted the formatting logic of _print_picked_versions logic into zc.buildout.buildout._format_picked_versions. It takes the output of the newly introduced function zc.buidlout.easy_install.get_picked_versions which was also extracted from the same method.

Renamed zc.buidlout.easy_install.store_picked_versions to zc.buidlout.easy_install.store_required_by. It turns out that the Installer always records the picked version information, _store_picked_versions was only used to toggle the storage of "required by" information. This new name makes the intent much clearer.

With these changes I was able to rewrite buildout.dumppickedversions2 to not do any monkey patching (and only one use of a private function, _format_picked_versions). It would also make it real easy to write a plugin that creates a requirements.txt based on the info available through zc.buidlout.easy_install.get_picked_versions.