fix python bindings for hash_for_piece

This commit is contained in:
Arvid Norberg 2012-03-11 06:57:35 +00:00
parent df2e891a2d
commit 74d8f5beb3
1 changed files with 6 additions and 1 deletions

View File

@ -63,6 +63,11 @@ namespace
return result;
}
std::string hash_for_piece(torrent_info const& ti, int i)
{
return ti.hash_for_piece(i).to_string();
}
std::string metadata(torrent_info const& ti) {
std::string result(ti.metadata().get(), ti.metadata_size());
return result;
@ -144,7 +149,7 @@ void bind_torrent_info()
#ifndef TORRENT_NO_DEPRECATE
.def("info_hash", &torrent_info::info_hash, copy)
#endif
.def("hash_for_piece", &torrent_info::hash_for_piece)
.def("hash_for_piece", &hash_for_piece)
.def("piece_size", &torrent_info::piece_size)
.def("num_files", &torrent_info::num_files, (arg("storage")=false))