From 5192d038529c56b83e6950c146be9cbc6e39f66a Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 14 Jun 2012 15:41:39 +0000 Subject: [PATCH] fixed python binding build with no deprecated functions --- bindings/python/src/magnet_uri.cpp | 6 +++++- bindings/python/src/torrent_handle.cpp | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/bindings/python/src/magnet_uri.cpp b/bindings/python/src/magnet_uri.cpp index bb66f52da..ea4dbcb57 100644 --- a/bindings/python/src/magnet_uri.cpp +++ b/bindings/python/src/magnet_uri.cpp @@ -16,7 +16,8 @@ extern void dict_to_add_torrent_params(dict params , std::list& storage); namespace { - + +#ifndef TORRENT_NO_DEPRECATE torrent_handle _add_magnet_uri(session& s, std::string uri, dict params) { add_torrent_params p; @@ -34,6 +35,7 @@ namespace { return add_magnet_uri(s, uri, p, ec); #endif } +#endif std::string (*make_magnet_uri0)(torrent_handle const&) = make_magnet_uri; std::string (*make_magnet_uri1)(torrent_info const&) = make_magnet_uri; @@ -41,7 +43,9 @@ namespace { void bind_magnet_uri() { +#ifndef TORRENT_NO_DEPRECATE def("add_magnet_uri", &_add_magnet_uri); +#endif def("make_magnet_uri", make_magnet_uri0); def("make_magnet_uri", make_magnet_uri1); } diff --git a/bindings/python/src/torrent_handle.cpp b/bindings/python/src/torrent_handle.cpp index f3941355f..c330c1f87 100644 --- a/bindings/python/src/torrent_handle.cpp +++ b/bindings/python/src/torrent_handle.cpp @@ -256,6 +256,7 @@ void connect_peer(torrent_handle& th, tuple ip, int source) th.connect_peer(tuple_to_endpoint(ip), source); } +#ifndef TORRENT_NO_DEPRECATE void set_peer_upload_limit(torrent_handle& th, tuple const& ip, int limit) { th.set_peer_upload_limit(tuple_to_endpoint(ip), limit); @@ -265,6 +266,7 @@ void set_peer_download_limit(torrent_handle& th, tuple const& ip, int limit) { th.set_peer_download_limit(tuple_to_endpoint(ip), limit); } +#endif void add_piece(torrent_handle& th, int piece, char const *data, int flags) { @@ -275,7 +277,9 @@ void bind_torrent_handle() { void (torrent_handle::*force_reannounce0)() const = &torrent_handle::force_reannounce; +#ifndef TORRENT_NO_DEPRECATE bool (torrent_handle::*super_seeding0)() const = &torrent_handle::super_seeding; +#endif void (torrent_handle::*super_seeding1)(bool) const = &torrent_handle::super_seeding; int (torrent_handle::*piece_priority0)(int) const = &torrent_handle::piece_priority; @@ -315,7 +319,6 @@ void bind_torrent_handle() .def("resume", _(&torrent_handle::resume)) .def("clear_error", _(&torrent_handle::clear_error)) .def("set_priority", _(&torrent_handle::set_priority)) - .def("super_seeding", super_seeding0) .def("super_seeding", super_seeding1) .def("auto_managed", _(&torrent_handle::auto_managed)) @@ -331,6 +334,7 @@ void bind_torrent_handle() #endif // deprecated #ifndef TORRENT_NO_DEPRECATE + .def("super_seeding", super_seeding0) .def("filter_piece", _(&torrent_handle::filter_piece)) .def("is_piece_filtered", _(&torrent_handle::is_piece_filtered)) .def("write_resume_data", _(&torrent_handle::write_resume_data)) @@ -372,10 +376,12 @@ void bind_torrent_handle() .def("set_download_limit", _(&torrent_handle::set_download_limit)) .def("download_limit", _(&torrent_handle::download_limit)) .def("set_sequential_download", _(&torrent_handle::set_sequential_download)) +#ifndef TORRENT_NO_DEPRECATE .def("set_peer_upload_limit", &set_peer_upload_limit) .def("set_peer_download_limit", &set_peer_download_limit) - .def("connect_peer", &connect_peer) .def("set_ratio", _(&torrent_handle::set_ratio)) +#endif + .def("connect_peer", &connect_peer) .def("save_path", _(&torrent_handle::save_path)) .def("set_max_uploads", _(&torrent_handle::set_max_uploads)) .def("set_max_connections", _(&torrent_handle::set_max_connections))