fix python binding of port_mapping_t

This commit is contained in:
arvidn 2017-09-04 01:09:55 +02:00 committed by Arvid Norberg
parent fe1c395579
commit 9c7f87ed5d
2 changed files with 5 additions and 2 deletions

View File

@ -575,7 +575,7 @@ void bind_alert()
class_<portmap_error_alert, bases<alert>, noncopyable>(
"portmap_error_alert", no_init)
.def_readonly("mapping", &portmap_error_alert::mapping)
.add_property("mapping", make_getter(&portmap_error_alert::mapping, by_value()))
.def_readonly("error", &portmap_error_alert::error)
.def_readonly("map_transport", &portmap_error_alert::map_transport)
#ifndef TORRENT_NO_DEPRECATE
@ -586,7 +586,7 @@ void bind_alert()
;
class_<portmap_alert, bases<alert>, noncopyable>("portmap_alert", no_init)
.def_readonly("mapping", &portmap_alert::mapping)
.add_property("mapping", make_getter(&portmap_alert::mapping, by_value()))
.def_readonly("external_port", &portmap_alert::external_port)
.def_readonly("map_protocol", &portmap_alert::map_protocol)
.def_readonly("map_transport", &portmap_alert::map_transport)

View File

@ -19,6 +19,7 @@
#include "libtorrent/file_storage.hpp" // for file_flags_t
#include "libtorrent/alert.hpp"
#include "libtorrent/create_torrent.hpp" // for create_flags_t
#include "libtorrent/portmap.hpp" // for port_mapping_t
#include <vector>
using namespace boost::python;
@ -299,6 +300,7 @@ void bind_converters()
to_python_converter<lt::piece_index_t, from_strong_typedef<lt::piece_index_t>>();
to_python_converter<lt::file_index_t, from_strong_typedef<lt::file_index_t>>();
to_python_converter<lt::port_mapping_t, from_strong_typedef<lt::port_mapping_t>>();
to_python_converter<lt::torrent_flags_t, from_bitfield_flag<lt::torrent_flags_t>>();
to_python_converter<lt::peer_flags_t, from_bitfield_flag<lt::peer_flags_t>>();
to_python_converter<lt::peer_source_flags_t, from_bitfield_flag<lt::peer_source_flags_t>>();
@ -358,6 +360,7 @@ void bind_converters()
to_strong_typedef<lt::piece_index_t>();
to_strong_typedef<lt::file_index_t>();
to_strong_typedef<lt::port_mapping_t>();
to_bitfield_flag<lt::torrent_flags_t>();
to_bitfield_flag<lt::peer_flags_t>();
to_bitfield_flag<lt::peer_source_flags_t>();