forked from premiere/premiere-libtorrent
fix python binding of create_torrent
This commit is contained in:
parent
116802fcdf
commit
799cd8163b
|
@ -196,7 +196,7 @@ void bind_create_torrent()
|
||||||
|
|
||||||
class_<create_torrent>("create_torrent", no_init)
|
class_<create_torrent>("create_torrent", no_init)
|
||||||
.def(init<file_storage&>())
|
.def(init<file_storage&>())
|
||||||
.def(init<torrent_info const&, int>((arg("ti"), arg("version") = LIBTORRENT_VERSION_NUM)))
|
.def(init<torrent_info const&, bool>((arg("ti"), arg("use_preformatted") = false)))
|
||||||
.def(init<file_storage&, int, int, int>((arg("storage"), arg("piece_size") = 0
|
.def(init<file_storage&, int, int, int>((arg("storage"), arg("piece_size") = 0
|
||||||
, arg("pad_file_limit") = -1, arg("flags") = int(libtorrent::create_torrent::optimize_alignment))))
|
, arg("pad_file_limit") = -1, arg("flags") = int(libtorrent::create_torrent::optimize_alignment))))
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ class test_create_torrent(unittest.TestCase):
|
||||||
|
|
||||||
def test_from_torrent_info(self):
|
def test_from_torrent_info(self):
|
||||||
ti = lt.torrent_info('unordered.torrent')
|
ti = lt.torrent_info('unordered.torrent')
|
||||||
ct = lt.create_torrent(ti)
|
ct = lt.create_torrent(ti, True)
|
||||||
entry = ct.generate()
|
entry = ct.generate()
|
||||||
content = lt.bencode(entry).strip()
|
content = lt.bencode(entry).strip()
|
||||||
with open('unordered.torrent', 'rb') as f:
|
with open('unordered.torrent', 'rb') as f:
|
||||||
|
|
Loading…
Reference in New Issue