From 0ed87e4c592ac7f5fc0f037c89d228ab0d0f0497 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 15 May 2008 07:37:34 +0000 Subject: [PATCH] updated python binding to match the recently changed torrent_info. reintroduced add_node --- bindings/python/src/torrent_info.cpp | 7 ------- docs/manual.rst | 10 ++++++++++ include/libtorrent/torrent_info.hpp | 6 +++--- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/bindings/python/src/torrent_info.cpp b/bindings/python/src/torrent_info.cpp index 716ecfdee..802a6a6c7 100755 --- a/bindings/python/src/torrent_info.cpp +++ b/bindings/python/src/torrent_info.cpp @@ -74,13 +74,7 @@ void bind_torrent_info() .def(init()) .def(init()) - .def("create_torrent", &torrent_info::create_torrent) - .def("set_comment", &torrent_info::set_comment) - .def("set_piece_size", &torrent_info::set_piece_size) - .def("set_creator", &torrent_info::set_creator) - .def("set_hash", &torrent_info::set_hash) .def("add_tracker", &torrent_info::add_tracker, (arg("url"), arg("tier")=0)) - .def("add_file", &torrent_info::add_file) .def("add_url_seed", &torrent_info::add_url_seed) .def("name", &torrent_info::name, copy) @@ -99,7 +93,6 @@ void bind_torrent_info() .def("files", &files, (arg("storage")=false)) .def("priv", &torrent_info::priv) - .def("set_priv", &torrent_info::set_priv) .def("trackers", range(begin_trackers, end_trackers)) .def("creation_date", &torrent_info::creation_date) diff --git a/docs/manual.rst b/docs/manual.rst index 6674f887a..508407c98 100644 --- a/docs/manual.rst +++ b/docs/manual.rst @@ -1487,6 +1487,16 @@ nodes() If this torrent contains any DHT nodes, they are put in this vector in their original form (host name and port number). +add_node() +---------- + + :: + + void add_node(std::pair const& node); + +This is used when creating torrent. Use this to add a known DHT node. It may +be used, by the client, to bootstrap into the DHT network. + metadata() metadata_size() -------------------------- diff --git a/include/libtorrent/torrent_info.hpp b/include/libtorrent/torrent_info.hpp index f7ae8e777..f6baa476c 100755 --- a/include/libtorrent/torrent_info.hpp +++ b/include/libtorrent/torrent_info.hpp @@ -237,9 +237,9 @@ namespace libtorrent typedef std::vector > nodes_t; nodes_t const& nodes() const - { - return m_nodes; - } + { return m_nodes; } + void add_node(std::pair const& node) + { m_nodes.push_back(node); } bool parse_info_section(lazy_entry const& e, std::string& error);