fix python binding for torrent_status::error_file

This commit is contained in:
arvidn 2017-10-18 13:47:37 +02:00 committed by Arvid Norberg
parent 244d18dcf8
commit ee9e0abb1a
2 changed files with 5 additions and 2 deletions

View File

@ -105,7 +105,7 @@ void bind_torrent_status()
.def_readonly("time_since_download", &torrent_status::time_since_download)
#endif
.def_readonly("errc", &torrent_status::errc)
.def_readonly("error_file", &torrent_status::error_file)
.add_property("error_file", make_getter(&torrent_status::error_file, by_value()))
.def_readonly("name", &torrent_status::name)
.def_readonly("save_path", &torrent_status::save_path)
.def_readonly("added_time", &torrent_status::added_time)
@ -129,7 +129,7 @@ void bind_torrent_status()
.add_property("active_duration", make_getter(&torrent_status::active_duration, by_value()))
.add_property("finished_duration", make_getter(&torrent_status::finished_duration, by_value()))
.add_property("seeding_duration", make_getter(&torrent_status::seeding_duration, by_value()))
.def_readonly("flags", &torrent_status::flags)
.add_property("flags", make_getter(&torrent_status::flags, by_value()))
;
enum_<torrent_status::state_t>("states")

View File

@ -76,6 +76,7 @@ class test_torrent_handle(unittest.TestCase):
# also test the overload that takes a list of piece->priority mappings
self.h.prioritize_pieces([(0, 1)])
self.assertEqual(self.h.piece_priorities(), [1])
def test_torrent_handle_in_set(self):
self.setup()
torrents = set()
@ -181,6 +182,8 @@ class test_torrent_handle(unittest.TestCase):
# make sure we can compare torrent_status objects
st2 = self.h.status()
self.assertEqual(st2, st)
print(st2.error_file)
print(st2.flags)
def test_read_resume_data(self):