Mailinglist Archive: zypp-devel (149 mails)
| < Previous | Next > |
[zypp-devel] Yet another bindings issue
- From: "Nikolay Derkach" <nderkach@xxxxxxxxx>
- Date: Wed, 3 Sep 2008 23:44:29 +0400
- Message-id: <f276b80f0809031244i6b5acf9btc30131de110bcaf0@xxxxxxxxxxxxxx>
Hi, I tried to hack python zypp bindings. With this code I want to
list available resolvables in a specified repo:
import zypp
Z = zypp.ZYppFactory_instance().getZYpp()
pool = Z.pool()
repoManager = zypp.RepoManager()
# find a repository with an alias
r = pool.reposFind("qt")
assert r
print "ss: ", r.solvablesSize()
print r.solvablesEmpty()
print r.alias()
repo = r.info()
assert repo
kp = repo.keepPackages()
print kp
repoManager.refreshMetadata(repo)
if not repoManager.isCached( repo ):
repoManager.buildCache( repo )
repoManager.loadFromCache( repo );
print "Available items: %d" % ( pool.size() )
for item in pool:
print item.resolvable().description()
The ouput is:
ss: <Swig Object of type 'zypp::Repository::size_type *' at
0x8357b0>swig/python detected a memory leak of type
'zypp::Repository::size_type *', no destructor found.
True
Traceback (most recent call last):
File "list_available_resolvables.py", line 23, in <module>
kp = repo.keepPackages()
AttributeError: 'PySwigObject' object has no attribute 'keepPackages'
swig/python detected a memory leak of type 'RepoInfo *', no destructor found.
swig/python detected a memory leak of type 'zypp::ResPool *', no
destructor found.
Note that it shows that there are no solvable in the repo.
Any ideas what I'm doing wrong? Thanks.
--
Regards, Nikolay Derkach
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx
list available resolvables in a specified repo:
import zypp
Z = zypp.ZYppFactory_instance().getZYpp()
pool = Z.pool()
repoManager = zypp.RepoManager()
# find a repository with an alias
r = pool.reposFind("qt")
assert r
print "ss: ", r.solvablesSize()
print r.solvablesEmpty()
print r.alias()
repo = r.info()
assert repo
kp = repo.keepPackages()
print kp
repoManager.refreshMetadata(repo)
if not repoManager.isCached( repo ):
repoManager.buildCache( repo )
repoManager.loadFromCache( repo );
print "Available items: %d" % ( pool.size() )
for item in pool:
print item.resolvable().description()
The ouput is:
ss: <Swig Object of type 'zypp::Repository::size_type *' at
0x8357b0>swig/python detected a memory leak of type
'zypp::Repository::size_type *', no destructor found.
True
Traceback (most recent call last):
File "list_available_resolvables.py", line 23, in <module>
kp = repo.keepPackages()
AttributeError: 'PySwigObject' object has no attribute 'keepPackages'
swig/python detected a memory leak of type 'RepoInfo *', no destructor found.
swig/python detected a memory leak of type 'zypp::ResPool *', no
destructor found.
Note that it shows that there are no solvable in the repo.
Any ideas what I'm doing wrong? Thanks.
--
Regards, Nikolay Derkach
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx
| < Previous | Next > |