I've put together a little test config file and extremely basic
It works quite well from my live python trials.
brian@big_squirt ~/porthole/trunk/porthole/backends/test $ python
Python 2.5.2 (r252:60911, Apr 25 2008, 19:29:41)
[GCC 4.1.2 (Gentoo 4.1.2 p1.0.2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from commands import get_cmd as g
>>> from commands import get_sections, get_items, get_options
['sync', 'install_opts', 'update', 'install', 'uninstall']
['install_pv', 'install_p', 'install']
[('install_pv', 'emerge -pv'), ('install_p', 'emerge -p'), ('install',
Of course it can be refined a lot more, but seems to work quite well. I
will need to change the way porthole builds it commands to be more
compatible with pkgcore. But I think this method will work better
overall. I have had requests for the ability to specify custom scripts
for several of the currently hard coded 'emerge' commands. That part of
it can be taken care of by checking for a users ~/.porthole/portage.cfg
or ~/.porthole/pkgcore.cfg depending on the backend selected and using
it instead of the pre-configured one in the backend subdirectory.