the python bindings should not use types internal to libtorrent (fixes shared library linking)

This commit is contained in:
Arvid Norberg 2014-03-25 06:23:10 +00:00
parent f3535b1e69
commit fd6623fa5c
4 changed files with 2 additions and 35 deletions

View File

@ -86,7 +86,6 @@ python-extension libtorrent
src/version.cpp src/version.cpp
src/alert.cpp src/alert.cpp
src/datetime.cpp src/datetime.cpp
src/torrent.cpp
src/peer_info.cpp src/peer_info.cpp
src/ip_filter.cpp src/ip_filter.cpp
src/magnet_uri.cpp src/magnet_uri.cpp

View File

@ -22,7 +22,6 @@ void bind_session_settings();
void bind_version(); void bind_version();
void bind_alert(); void bind_alert();
void bind_datetime(); void bind_datetime();
void bind_torrent();
void bind_peer_info(); void bind_peer_info();
void bind_ip_filter(); void bind_ip_filter();
void bind_magnet_uri(); void bind_magnet_uri();
@ -51,7 +50,6 @@ BOOST_PYTHON_MODULE(libtorrent)
bind_version(); bind_version();
bind_alert(); bind_alert();
bind_datetime(); bind_datetime();
bind_torrent();
bind_peer_info(); bind_peer_info();
bind_ip_filter(); bind_ip_filter();
bind_magnet_uri(); bind_magnet_uri();

View File

@ -7,13 +7,13 @@
#include <string> #include <string>
#include <libtorrent/session.hpp> #include <libtorrent/session.hpp>
#include <libtorrent/settings.hpp> // for bencode_map_entry #include <libtorrent/settings.hpp> // for bencode_map_entry
#include <libtorrent/torrent.hpp>
#include <libtorrent/storage.hpp> #include <libtorrent/storage.hpp>
#include <libtorrent/ip_filter.hpp> #include <libtorrent/ip_filter.hpp>
#include <libtorrent/disk_io_thread.hpp> #include <libtorrent/disk_io_thread.hpp>
#include <libtorrent/extensions.hpp> #include <libtorrent/extensions.hpp>
#include <libtorrent/lazy_entry.hpp> #include <libtorrent/lazy_entry.hpp>
#include <libtorrent/bencode.hpp> #include <libtorrent/bencode.hpp>
#include <libtorrent/aux_/session_impl.hpp> // for settings_map()
#include <libtorrent/extensions/lt_trackers.hpp> #include <libtorrent/extensions/lt_trackers.hpp>
#include <libtorrent/extensions/metadata_transfer.hpp> #include <libtorrent/extensions/metadata_transfer.hpp>
@ -81,14 +81,6 @@ namespace
#endif // TORRENT_DISABLE_EXTENSIONS #endif // TORRENT_DISABLE_EXTENSIONS
} }
#ifndef TORRENT_NO_DEPRECATE
boost::shared_ptr<torrent_plugin> dummy_plugin_wrapper(torrent* t) {
return boost::shared_ptr<torrent_plugin>();
}
#endif
void session_set_settings(session& ses, dict const& sett_dict) void session_set_settings(session& ses, dict const& sett_dict)
{ {
bencode_map_entry* map; bencode_map_entry* map;
@ -186,7 +178,7 @@ namespace
{ {
// torrent_info objects are always held by an intrusive_ptr in the python binding // torrent_info objects are always held by an intrusive_ptr in the python binding
if (params.has_key("ti") && params.get("ti") != boost::python::object()) if (params.has_key("ti") && params.get("ti") != boost::python::object())
p.ti = extract<intrusive_ptr<torrent_info> >(params["ti"]); p.ti = extract<boost::intrusive_ptr<torrent_info> >(params["ti"]);
if (params.has_key("info_hash")) if (params.has_key("info_hash"))
p.info_hash = extract<sha1_hash>(params["info_hash"]); p.info_hash = extract<sha1_hash>(params["info_hash"]);
@ -795,13 +787,6 @@ void bind_session()
.def("settings", &get_feed_settings) .def("settings", &get_feed_settings)
; ;
#ifndef TORRENT_NO_DEPRECATE
def("create_ut_pex_plugin", dummy_plugin_wrapper);
def("create_metadata_plugin", dummy_plugin_wrapper);
def("create_ut_metadata_plugin", dummy_plugin_wrapper);
def("create_smart_ban_plugin", dummy_plugin_wrapper);
#endif
register_ptr_to_python<std::auto_ptr<alert> >(); register_ptr_to_python<std::auto_ptr<alert> >();
def("high_performance_seed", high_performance_seed); def("high_performance_seed", high_performance_seed);

View File

@ -1,15 +0,0 @@
// Copyright Daniel Wallin 2007. Use, modification and distribution is
// subject to the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/python.hpp>
#include <libtorrent/torrent.hpp>
using namespace boost::python;
using namespace libtorrent;
void bind_torrent()
{
class_<torrent, boost::noncopyable>("torrent", no_init);
}