Re: [libtorrent] Extension with python bindings
Brought to you by:
arvidn
From: <ar...@cs...> - 2011-03-31 17:02:37
|
Quoting Jérôme Champion <cha...@gm...>: > Hi, I try to develop an experimental extension (lt.torrent_plugin) for > libtorrent. > I have a working simple client written in python ( the one in the doc ) . > I can load extension with add_extension(lt.create_metadata_plugin) > > Now I try to make my own extension, here is a simple example: > > import libtorrent as lt > class DiffTorrent(lt.torrent_plugin): > def __init__(self): > self.testValue = 1 > def tick(self): > print "tick" > > And I try to register it with: > > ses.add_extension(DiffTorrent()) > > Apparently, it's not the way to do it. But I didn't find any example of an > extension written with the python binding. > ( the C++ plugins give some hints, but it's not enough ) > > Has someone a simple ( or not ) example to give ? unfortunately extensions created from python doesn't work very well. There are even reports suggesting that using the built-in extensions from python (using add_extension from python) causes them to leak. If you build libtorrent in debug mode and run it in gdb, you might be able to figure out why they don't work. Patches are always welcome! Hopefully I'll get to fix this at some point, but it's not very high up on my list right now unfortunately. -- Arvid Norberg |