Mailinglist Archive: zypp-devel (102 mails)

< Previous Next >
[zypp-devel] Python Bindings and RepoInfo.baseUrls()
  • From: Jan Blunck <jblunck@xxxxxxx>
  • Date: Tue, 10 Mar 2009 20:24:24 +0100
  • Message-id: <20090310192424.GG23737@xxxxxxxxxxxxxxx>
I have the following example:

import zypp

def main():
myRepoInfo = zypp.RepoInfo()

myRepoInfo.addBaseUrl(zypp.Url("file:///mounts/mirror/SuSE/ftp.opensuse.org/srv/ftp/pub/opensuse/debug/update/11.1/"))
myRepoInfo.setAlias("default")
myRepoInfo.setName("default")
myRepoInfo.setEnabled(True)
myRepoInfo.setType(zypp.RepoType.RPMMD) # for now
myRepoInfo.setGpgCheck(False)

for url in myRepoInfo.baseUrls():
print url

if __name__ == "__main__":
main()

When I let it run I get the following error:

$ python baseurls.py
swig/python detected a memory leak of type 'std::set<
zypp::Url,std::less<zypp::Url >,std::allocator< zypp::Url > > *', no destructor
found.
Traceback (most recent call last):
File "baseurls.py", line 16, in <module>
main()
File "baseurls.py", line 12, in main
for url in myRepoInfo.baseUrls():
TypeError: 'PySwigObject' object is not iterable

It somehow seems that the python bindings are incomplete. Any SWIG expert that
can help me here?

Cheers,
Jan
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups