Author: kkaempf Date: Fri Sep 26 15:52:19 2008 New Revision: 11184 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11184&view=rev Log: allow to limit repo.search to Solvable or Keyname Modified: trunk/sat-solver/bindings/dataiterator.i trunk/sat-solver/bindings/python/tests/search.py trunk/sat-solver/bindings/repo.i Modified: trunk/sat-solver/bindings/dataiterator.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/dataiterator.i?rev=11184&r1=11183&r2=11184&view=diff ============================================================================== --- trunk/sat-solver/bindings/dataiterator.i (original) +++ trunk/sat-solver/bindings/dataiterator.i Fri Sep 26 15:52:19 2008 @@ -30,12 +30,12 @@ * Complete Dataiterator constructor, to be used via %python in Swig */ - Dataiterator(Repo *repo, const char *match, int option, XSolvable *xs = 0, XRepokey *key = 0) + Dataiterator(Repo *repo, const char *match, int option, XSolvable *xs = 0, const char *keyname = 0) { Dataiterator *di = calloc(1, sizeof( Dataiterator )); Solvable *s = 0; if (xs) s = xsolvable_solvable(xs); - dataiterator_init(di, repo, s ? s - repo->pool->solvables : 0, key ? xrepokey_repokey(key)->name : 0, match, option); + dataiterator_init(di, repo, s ? s - repo->pool->solvables : 0, keyname ? str2id(repo->pool, keyname, 0) : 0, match, option); return di; } Modified: trunk/sat-solver/bindings/python/tests/search.py URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/python/tests/search.py?rev=11184&r1=11183&r2=11184&view=diff ============================================================================== --- trunk/sat-solver/bindings/python/tests/search.py (original) +++ trunk/sat-solver/bindings/python/tests/search.py Fri Sep 26 15:52:19 2008 @@ -32,7 +32,7 @@ repo = pool.add_solv( "os11-biarch.solv" ) repo.set_name("test") i = 0 - for d in repo.search("/usr/bin/python", satsolver.SEARCH_STRING|satsolver.SEARCH_FILES): + for d in repo.search("/usr/bin/python", satsolver.SEARCH_STRING|satsolver.SEARCH_FILES, None, "solvable:filelist"): print d.solvable(), "matches '/usr/bin/python' in ", d.keyname(), ": ", d.value() i = i + 1 if i > 10: Modified: trunk/sat-solver/bindings/repo.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/repo.i?rev=11184&r1=11183&r2=11184&view=diff ============================================================================== --- trunk/sat-solver/bindings/repo.i (original) +++ trunk/sat-solver/bindings/repo.i Fri Sep 26 15:52:19 2008 @@ -162,8 +162,8 @@ */ #if defined(SWIGPYTHON) %pythoncode %{ - def search(self, match, flags): - d = Dataiterator(self,match,flags) + def search(self, match, flags, solvable = None, keyname = None): + d = Dataiterator(self,match,flags, solvable, keyname) while d.step(): yield d %} -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org