[zypp-devel] Using libzypp in python to expand patterns
Hello, I was investigating an issue in meego image-creator which uses libzypp python bindings, and wanted to know how to get the contents of a package group (pattern) so as to add it to the list of packages to be installed. Currently the code looks like this : """ todo = zypp.GetResolvablesToInsDel(self.Z.pool()) installed_pkgs = todo._toInstall dlpkgs = [] print "\n\nThese packages will be installed:" for item in installed_pkgs: if not zypp.isKindPattern(item): dlpkgs.append(item) print "%s" % item.name() """ I tried adding : """ else: print "Pattern %s contains %d required items" % (item.name() , item.resolvable().requires().size()) x = item.resolvable().requires().begin() for p in x: print p """ The name of the group and number of items in it was correct but the loop failed to iterate with this error : TypeError: 'SwigPyObject' object is not iterable swig/python detected a memory leak of type 'zypp::Capabilities::const_iterator *', no destructor found. I am definitely doing something wrong :) -- Thanks, Islam Amer
participants (1)
-
Islam Amer