View unanswered posts | View active topics It is currently Tue Sep 07, 2010 1:59 am



Reply to topic  [ 3 posts ] 
 [script, bug] KTorrent.queue() 
Author Message

Joined: Thu Jul 03, 2008 5:48 pm
Posts: 97
Post [script, bug] KTorrent.queue()
KT ver. 3.3.4

KTorrent.queue(tor.infoHash()) spits out an "PythonInterpreter::extracException"

Also, this might not be a bug, but KTorrent.start(tor.infoHash()) does not start a torrent that's in a "Seeding Complete" state. I was manually dropping the Ratio limit below it's Share ratio for testing. Since I can't change the ratio limit in self.changePriority(tor) prior to issuing a start, the torrent not starting may be the expected behaviour, but figured I'd bring it up in case. (I was expecting it to start, e.g. be place in a Queued for Seeding state, and when entering the Seeding state be kicked back to Seeding complete.)

Latest scratch code :
Code:
#!/usr/bin/env kross
# -*- coding: utf-8 -*-
import KTorrent
import KTScriptingPlugin
import Kross

class StatusChanged:
   def __init__(self):
      KTorrent.log("===========>     Starting StatusChanged Script")
      KTorrent.connect("torrentAdded(const QString &)",self.torrentAdded)
      tors = KTorrent.torrents()
      # bind to signals for each torrent
      for t in tors:
         self.torrentAdded(t)

   def changePriority(self,tor):
      tor.setPriority(1)
      KTorrent.orderQueue()
      KTorrent.log("===========>     We are finished with: %s, %s  Priority has been changed to: %i, and it's been re-queued." % (tor.name(),tor.infoHash(),tor.priority()))
      KTorrent.start(tor.infoHash())
      KTorrent.queue(tor.infoHash())

   def torrentFinished(self,tor):
      self.changePriority(tor)

   def seedingAutoStopped(self,tor,reason):
      self.changePriority(tor)

   def connectSignals(self,tor):
      KTorrent.log("connectSignals " + tor.name())
      tor.connect("finished(QObject* )",self.torrentFinished)
      tor.connect("seedingAutoStopped(QObject* ,const QString & )",self.seedingAutoStopped)

   def torrentAdded(self,ih):
      tor = KTorrent.torrent(ih)
      self.connectSignals(tor)

statchange = StatusChanged()

def unload():
   global statchange
   del statchange


Wed Mar 10, 2010 11:06 pm
Profile
Site Admin

Joined: Mon Sep 19, 2005 7:19 pm
Posts: 4965
Post Re: [script, bug] KTorrent.queue()
The KTorrent.queue call has been removed some time ago, need to remove that from the wiki.

As for KTorrent.start(tor.infoHash()) does not start a torrent that's in a "Seeding Complete", this is normal, I'm busy adding the setMaxShareRatio and setMaxSeedTime calls (and a few others), they should allow you to deal with the situation.


Fri Mar 12, 2010 5:39 pm
Profile

Joined: Thu Jul 03, 2008 5:48 pm
Posts: 97
Post Re: [script, bug] KTorrent.queue()
k,

I'll stop until I get the latest svn to compile :)

working through the compiling a KDE app on gnome oddities,
Sam
PS: If you're in the wiki, there's a non-documented (KTorrent.removeDelayed) API I found in Auto Remove, that I added, but it could use a definition.


Fri Mar 12, 2010 7:45 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.