forked from premiere/premiere-libtorrent
commit
c7e19ce667
|
@ -100,7 +100,7 @@ namespace
|
||||||
|
|
||||||
void make_settings_pack(lt::settings_pack& p, dict const& sett_dict)
|
void make_settings_pack(lt::settings_pack& p, dict const& sett_dict)
|
||||||
{
|
{
|
||||||
list iterkeys = (list)sett_dict.iterkeys();
|
list iterkeys = (list)sett_dict.keys();
|
||||||
for (int i = 0; i < boost::python::len(iterkeys); i++)
|
for (int i = 0; i < boost::python::len(iterkeys); i++)
|
||||||
{
|
{
|
||||||
std::string key = extract<std::string>(iterkeys[i]);
|
std::string key = extract<std::string>(iterkeys[i]);
|
||||||
|
@ -583,6 +583,7 @@ namespace
|
||||||
|
|
||||||
void bind_session()
|
void bind_session()
|
||||||
{
|
{
|
||||||
|
register_ptr_to_python<boost::shared_ptr<alert> >();
|
||||||
#ifndef TORRENT_DISABLE_DHT
|
#ifndef TORRENT_DISABLE_DHT
|
||||||
void (lt::session::*dht_get_immutable_item)(sha1_hash const&) = <::session::dht_get_item;
|
void (lt::session::*dht_get_immutable_item)(sha1_hash const&) = <::session::dht_get_item;
|
||||||
sha1_hash (lt::session::*dht_put_immutable_item)(entry data) = <::session::dht_put_item;
|
sha1_hash (lt::session::*dht_put_immutable_item)(entry data) = <::session::dht_put_item;
|
||||||
|
|
|
@ -57,13 +57,13 @@ class test_bencoder(unittest.TestCase):
|
||||||
def test_bencode(self):
|
def test_bencode(self):
|
||||||
|
|
||||||
encoded = lt.bencode({'a': 1, 'b': [1,2,3], 'c': 'foo'})
|
encoded = lt.bencode({'a': 1, 'b': [1,2,3], 'c': 'foo'})
|
||||||
self.assertEqual(encoded, 'd1:ai1e1:bli1ei2ei3ee1:c3:fooe')
|
self.assertEqual(encoded, b'd1:ai1e1:bli1ei2ei3ee1:c3:fooe')
|
||||||
|
|
||||||
def test_bdecode(self):
|
def test_bdecode(self):
|
||||||
|
|
||||||
encoded = 'd1:ai1e1:bli1ei2ei3ee1:c3:fooe'
|
encoded = b'd1:ai1e1:bli1ei2ei3ee1:c3:fooe'
|
||||||
decoded = lt.bdecode(encoded)
|
decoded = lt.bdecode(encoded)
|
||||||
self.assertEqual(decoded, {'a': 1, 'b': [1,2,3], 'c': 'foo'})
|
self.assertEqual(decoded, {b'a': 1, b'b': [1,2,3], b'c': b'foo'})
|
||||||
|
|
||||||
class test_sha1hash(unittest.TestCase):
|
class test_sha1hash(unittest.TestCase):
|
||||||
|
|
||||||
|
@ -74,6 +74,6 @@ class test_sha1hash(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print lt.__version__
|
print(lt.__version__)
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue