diff --git a/libtorrent/bindings/python/src/docstrings.cpp b/libtorrent/bindings/python/src/docstrings.cpp index f51487a23..fbd0a157c 100755 --- a/libtorrent/bindings/python/src/docstrings.cpp +++ b/libtorrent/bindings/python/src/docstrings.cpp @@ -156,11 +156,22 @@ char const* session_set_max_half_open_connections_doc = char const* session_set_settings_doc = ""; +char const* session_set_pe_settings_doc = + ""; +char const* session_get_pe_settings_doc = + ""; char const* session_set_severity_level_doc = ""; char const* session_pop_alert_doc = ""; - +char const* session_start_upnp_doc = + ""; +char const* session_stop_upnp_doc = + ""; + char const* session_start_natpmp_doc = + ""; +char const* session_stop_natpmp_doc = + ""; // -- alert ----------------------------------------------------------------- char const* alert_doc = diff --git a/libtorrent/bindings/python/src/session.cpp b/libtorrent/bindings/python/src/session.cpp index 9f7d530af..4ea7a1711 100755 --- a/libtorrent/bindings/python/src/session.cpp +++ b/libtorrent/bindings/python/src/session.cpp @@ -45,8 +45,14 @@ extern char const* session_set_max_uploads_doc; extern char const* session_set_max_connections_doc; extern char const* session_set_max_half_open_connections_doc; extern char const* session_set_settings_doc; +extern char const* session_set_pe_settings_doc; +extern char const* session_get_pe_settings_doc; extern char const* session_set_severity_level_doc; extern char const* session_pop_alert_doc; +extern char const* session_start_upnp_doc; +extern char const* session_stop_upnp_doc; +extern char const* session_start_natpmp_doc; +extern char const* session_stop_natpmp_doc; namespace { @@ -205,6 +211,8 @@ void bind_session() , session_set_max_half_open_connections_doc ) .def("set_settings", allow_threads(&session::set_settings), session_set_settings_doc) + .def("set_pe_settings", allow_threads(&session::set_pe_settings), session_set_pe_settings_doc) + .def_readonly("get_pe_settings", allow_threads(&session::get_pe_settings), session_get_pe_settings_doc) .def( "set_severity_level", allow_threads(&session::set_severity_level) , session_set_severity_level_doc @@ -217,6 +225,10 @@ void bind_session() #ifndef TORRENT_DISABLE_DHT .def("set_dht_proxy", allow_threads(&session::set_dht_proxy)) #endif + .def("start_upnp", allow_threads(&session::start_upnp), session_start_upnp_doc) + .def("stop_upnp", allow_threads(&session::stop_upnp), session_stop_upnp_doc) + .def("start_natpmp", allow_threads(&session::start_natpmp), session_start_natpmp_doc) + .def("stop_natpmp", allow_threads(&session::stop_natpmp), session_stop_natpmp_doc) ; def("supports_sparse_files", &supports_sparse_files); diff --git a/libtorrent/bindings/python/src/session_settings.cpp b/libtorrent/bindings/python/src/session_settings.cpp index 2c7474c21..f584956b2 100755 --- a/libtorrent/bindings/python/src/session_settings.cpp +++ b/libtorrent/bindings/python/src/session_settings.cpp @@ -47,7 +47,7 @@ void bind_session_settings() .value("http", proxy_settings::http) .value("http_pw", proxy_settings::http_pw) ; - scope ps = class_("proxy_settings") + class_("proxy_settings") .def_readwrite("hostname", &proxy_settings::hostname) .def_readwrite("port", &proxy_settings::port) .def_readwrite("password", &proxy_settings::password) @@ -64,9 +64,10 @@ void bind_session_settings() enum_("enc_level") .value("rc4", pe_settings::rc4) .value("plaintext", pe_settings::plaintext) + .value("both", pe_settings::both) ; - scope pes = class_("pe_settings") + class_("pe_settings") .def_readwrite("out_enc_policy", &pe_settings::out_enc_policy) .def_readwrite("in_enc_policy", &pe_settings::in_enc_policy) .def_readwrite("allowed_enc_level", &pe_settings::allowed_enc_level)