From 92f4792ee72f544fb56ad4fa51a6ba5a86b19183 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 8 Jun 2007 23:57:22 +0000 Subject: [PATCH] updated python bindings --- bindings/python/src/peer_info.cpp | 7 +++++- bindings/python/src/session_settings.cpp | 27 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/bindings/python/src/peer_info.cpp b/bindings/python/src/peer_info.cpp index 22820100b..49570b795 100755 --- a/bindings/python/src/peer_info.cpp +++ b/bindings/python/src/peer_info.cpp @@ -21,7 +21,6 @@ void bind_peer_info() .def_readonly("total_upload", &peer_info::total_upload) .def_readonly("pid", &peer_info::pid) .def_readonly("pieces", &peer_info::pieces) - .def_readonly("seed", &peer_info::seed) .def_readonly("upload_limit", &peer_info::upload_limit) .def_readonly("download_limit", &peer_info::download_limit) .def_readonly("load_balancing", &peer_info::load_balancing) @@ -45,6 +44,12 @@ void bind_peer_info() pi.attr("handshake") = (int)peer_info::handshake; pi.attr("connecting") = (int)peer_info::connecting; pi.attr("queued") = (int)peer_info::queued; + pi.attr("on_parole") = (int)peer_info::on_parole; + pi.attr("seed") = (int)peer_info::seed; +#ifndef TORRENT_DISABLE_ENCRYPTION + pi.attr("rc4_encrypted") = (int)peer_info::rc4_encrypted; + pi.attr("plaintext_encrypted") = (int)peer_info::plaintext_encrypted; +#endif pi.attr("standard_bittorrent") = 0; pi.attr("web_seed") = 1; diff --git a/bindings/python/src/session_settings.cpp b/bindings/python/src/session_settings.cpp index 4d7026676..abbbf7a0e 100755 --- a/bindings/python/src/session_settings.cpp +++ b/bindings/python/src/session_settings.cpp @@ -23,6 +23,20 @@ void bind_session_settings() .def_readwrite("peer_timeout", &session_settings::peer_timeout) .def_readwrite("urlseed_timeout", &session_settings::urlseed_timeout) .def_readwrite("urlseed_pipeline_size", &session_settings::urlseed_pipeline_size) + .def_readwrite("file_pool_size", &session_settings::file_pool_size) + .def_readwrite("allow_multiple_connections_per_ip", &session_settings::allow_multiple_connections_per_ip) + .def_readwrite("max_failcount", &session_settings::max_failcount) + .def_readwrite("min_reconnect_time", &session_settings::min_reconnect_time) + .def_readwrite("peer_connect_timeout", &session_settings::peer_connect_timeout) + .def_readwrite("ignore_limits_on_local_network", &session_settings::ignore_limits_on_local_network) + .def_readwrite("connection_speed", &session_settings::connection_speed) + .def_readwrite("send_redundant_have", &session_settings::send_redundant_have) + .def_readwrite("lazy_bitfields", &session_settings::lazy_bitfields) + .def_readwrite("inactivity_timeout", &session_settings::inactivity_timeout) + .def_readwrite("unchoke_interval", &session_settings::unchoke_interval) +#ifndef TORRENT_DISABLE_DHT + .def_readwrite("use_dht_as_fallback", &session_settings::use_dht_as_fallback) +#endif ; scope ps = class_("proxy_settings") @@ -38,5 +52,18 @@ void bind_session_settings() ps.attr("socks5_pw") = (int)proxy_settings::socks5_pw; ps.attr("http") = (int)proxy_settings::http; ps.attr("http_pw") = (int)proxy_settings::http_pw; + + scope pes = 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) + .def_readwrite("prefer_rc4", &pe_settings::prefer_rc4) + ; + + pes.attr("forced") = pe_settings::forced; + pes.attr("enabled") = pe_settings::enabled; + pes.attr("disabled") = pe_settings::disabled; + pes.attr("plaintext") = pe_settings::plaintext; + pes.attr("rc4") = pe_settings::rc4; }