It should be possible to import portageq and use its functions to enhance other python code that interacts with portage. Currently this is difficult because portageq executes main() without checking if it's being imported, and then quits because no options were given directly. Reproducible: Always Steps to Reproduce: In addition to adding: if __name__ == '__main__': main() to the bottom of portageq, it would be very helpful if the core portageq (as opposed to its various symlinks) filename ended with the .py extension.
Most of the functions in portageq are very simple wrappers around the existing public portage API. Which functions are you interested in using? If they are small functions that use the public API then you may just want to copy the code from portageq and use the public API directly.
(In reply to comment #1) > Most of the functions in portageq are very simple wrappers around the existing > public portage API. True, and now that I've read through what I thought was a medium-sized function, it turns out most of what it's doing is validating inputs. I can do that myself, I guess. Thanks! (To answer your question, I'm not entirely sure which features I would've ended up using, but I'm looking for a way to compare names from pypi to those in portage. My goal is to write a g-cpan workalike for pypi.)
(In reply to comment #2) > My goal is to write a g-cpan workalike for pypi. You might check g-pypi: http://code.google.com/p/g-pypi/
(In reply to comment #3) > You might check g-pypi: http://code.google.com/p/g-pypi/ Heehee. Opening a bug always finds me the answer I'm looking for. Thanks!