This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Kross scripting API

Tags: None
(comma "," separated)
non7top
Registered Member
Posts
54
Karma
0
OS

Kross scripting API

Sat Mar 14, 2009 12:03 pm
I can see three existing scripts, but may be there is a way to get at least a list of ktorrent signals to create hooks. This will be very helpfull.

For now I will try to implement the feature I requested for notifying about not registered torrents.
George
Moderator
Posts
5421
Karma
1

Re: Kross scripting API

Sun Mar 15, 2009 10:20 am
prizident wrote:I can see three existing scripts, but may be there is a way to get at least a list of ktorrent signals to create hooks. This will be very helpfull.


Use qdbusviewer, the DBus interface, is also used in the scripting plugin.

Gonna, make a wiki page for scripting.
George
Moderator
Posts
5421
Karma
1

Sun Mar 15, 2009 4:59 pm
OK, I have started the wiki page :

http://ktorrent.org/wiki/index.php/Writing_Scripts

Still a work in progress though.
non7top
Registered Member
Posts
54
Karma
0
OS

Mon Mar 16, 2009 12:20 pm
Thanks, I've now almost written my first plugin for KTorrent :) And this leads me to another feature request - GetHotNewStaff2 just as it is done with Amarok2. Hope this will give differenet people a motivation to create more scripts ;)

And another thing about that. I've looked through the interfaces and the source and cannot find signal which is emited when warnings are shown at torrent name. I wanted to use this create hook to catch "torrent not registered" messages.
non7top
Registered Member
Posts
54
Karma
0
OS

Mon Mar 16, 2009 12:29 pm
And one more thing. Logs from scripts are going to General channel in Log Viewer. It make it bit hard to debug scripts as the logs are overloaded with lots of other messages. May be there is some way to only show output from scripts?
non7top
Registered Member
Posts
54
Karma
0
OS

Mon Mar 16, 2009 2:08 pm
The following code made ktorrent crash, but torrent was removed

KTorrent.remove(tor.infoHash(), False)
George
Moderator
Posts
5421
Karma
1

Mon Mar 16, 2009 6:04 pm
Expanding the interface is on my todo list. (which seems to be growing continuously)

Can you post a backtrace of that crash?
non7top
Registered Member
Posts
54
Karma
0
OS

Mon Mar 23, 2009 9:43 pm
George
Moderator
Posts
5421
Karma
1

Wed Mar 25, 2009 9:55 am


The most likely cause of the crash is that you are deleting a torrent in a function which handles a signal of that torrent.
George
Moderator
Posts
5421
Karma
1

Wed Mar 25, 2009 5:33 pm
I have now added a removeDelayed function, this should be used instead of remove, when you are handling a signal.
non7top
Registered Member
Posts
54
Karma
0
OS

Sat Mar 28, 2009 6:16 pm
Another thing is that script execution blocks the main thread. It is notable with mail notification script
George
Moderator
Posts
5421
Karma
1

Sun Mar 29, 2009 11:07 am
prizident wrote:Another thing is that script execution blocks the main thread. It is notable with mail notification script


You are right, need to fix this


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], q.ignora, watchstar