On Thursday 01 September 2011 14:48:59 Klaus Kaempf wrote:
* Zhang, Qiang Z <qiang.z.zhang@intel.com> [Aug 30. 2011 07:54]:
Hi all,
We would like to use more python API in libzypp-bindings, such as PoolQuery, and I have tried to import the related API to libzypp, but fails.
Uhm, I'm not very fond of exposing more of libzypp's C++ details to the bindings. I'd rather access the underlying satsolver library for which clean bindings already exist.
Well, class sat::LookupAttr is a generic and quite easy to use wrapper around satsolvers dataiterator stuff. Not exposing that many C++ details. Just define the attribute or substructure attribute, maybe add some matcher (glob/regex/..) and get back an iterator to navigate through the results. PoolQuery basically runs multiple LookupAttr queries in parallel, combining the results. Unfortunately PoolQuery is not generic. You can just combine a few predefined queries (name && arch && repo..). So I would not offer this in the bindings. Instead I'd provide a generic interface that allows to combine arbitrary LookupAttr queries. This way you can easily build queries for whatever purpose: (name="foo*") && (repo="baa" || ! arch="i386") -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres SUSE LINUX Products GmbH, Development, ma@suse.de GF:Jeff Hawn,Jennifer Guild,Felix Imendörffer, HRB16746(AG Nürnberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org