* Klaus Kaempf <kkaempf@suse.de> [Oct 14. 2010 13:28]:
* Michael Andres <ma@suse.de> [Oct 14. 2010 13:22]:
That's a bug in the bindings, we try to fix this ASAP.
Here libzypps strict typing gets into the way. zypp.KeyRing.ACCEPT_UNSIGNED_FILE refers to the DefaultAcceptBits enum and appears as Integer in Python.
However, zypp.KeyRing.setDefaultAccept() expects a 'DefaultAccept' type and swig cannot sufficiently decode zypp/KeyRing.h to provide an automatic type conversion.
A quick solution is to provide an explicit type conversion function, e.g. %inline %{ zypp::KeyRing::DefaultAccept toDefaultAccept(int bits) { return (zypp::KeyRing::DefaultAccept) static_cast<zypp::KeyRing::DefaultAccept>(bits); } %} and use this in the sample code as zypp.KeyRing_setDefaultAccept(zypp.toDefaultAccept(zypp.KeyRing.ACCEPT_UNSIGNED_FILE | zypp.KeyRing.ACCEPT_VERIFICATION_FAILED) ) ^^^^^^^^^^^^^^^^^^^^ A more elaborate solution would involve SWIG typemaps (http://www.swig.org/Doc1.3/Typemaps.html) Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org