From fa6818e757ed12725620051d7a499ce7a18fe9f2 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 17 Jan 2014 05:35:58 +0000 Subject: [PATCH] merged python binding fix from RC_0_16 --- ChangeLog | 1 + bindings/python/src/torrent_handle.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 969cc1ed7..ffa3434e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -38,6 +38,7 @@ * fix uTP edge case where udp socket buffer fills up * fix nagle implementation in uTP + * expose file_granularity flag to python bindings * fix DHT memory error * change semantics of storage allocation to allocate on first write rather than on startup (behaves better with changing file priorities) diff --git a/bindings/python/src/torrent_handle.cpp b/bindings/python/src/torrent_handle.cpp index 61bbccb59..c79655d15 100644 --- a/bindings/python/src/torrent_handle.cpp +++ b/bindings/python/src/torrent_handle.cpp @@ -77,14 +77,14 @@ namespace } // namespace unnamed -list file_progress(torrent_handle& handle) +list file_progress(torrent_handle& handle, int flags) { std::vector p; { allow_threading_guard guard; p.reserve(handle.torrent_file()->num_files()); - handle.file_progress(p); + handle.file_progress(p, flags); } list result; @@ -376,7 +376,7 @@ void bind_torrent_handle() .def("get_peer_info", get_peer_info) .def("status", _(&torrent_handle::status), arg("flags") = 0xffffffff) .def("get_download_queue", get_download_queue) - .def("file_progress", file_progress) + .def("file_progress", file_progress, arg("flags") = 0) .def("trackers", trackers) .def("replace_trackers", replace_trackers) .def("add_tracker", add_tracker) @@ -476,6 +476,10 @@ void bind_torrent_handle() #endif ; + enum_("file_progress_flags") + .value("piece_granularity", torrent_handle::piece_granularity) + ; + enum_("pause_flags_t") .value("graceful_pause", torrent_handle::graceful_pause) ;