updated python binding to match the recently changed torrent_info. reintroduced add_node

This commit is contained in:
Arvid Norberg 2008-05-15 07:37:34 +00:00
parent 1b209ba29c
commit 0ed87e4c59
3 changed files with 13 additions and 10 deletions

View File

@ -74,13 +74,7 @@ void bind_torrent_info()
.def(init<entry const&>())
.def(init<sha1_hash const&>())
.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)

View File

@ -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<std::string, int> 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()
--------------------------

View File

@ -237,9 +237,9 @@ namespace libtorrent
typedef std::vector<std::pair<std::string, int> > nodes_t;
nodes_t const& nodes() const
{
return m_nodes;
}
{ return m_nodes; }
void add_node(std::pair<std::string, int> const& node)
{ m_nodes.push_back(node); }
bool parse_info_section(lazy_entry const& e, std::string& error);