Esempio n. 1
0
	def isMember(self,info_hash):
		if info_hash in self.cache:
			return self.cache[info_hash]
		else:
			tor = KTorrent.torrent(info_hash)
			ret = self.url in [fqdn(tracker) for tracker in tor.trackers()]
			self.cache[info_hash] = ret
			return ret
Esempio n. 2
0
	def isMember(self,info_hash):
		if info_hash in self.cache:
			return self.cache[info_hash]
		else:
			tor = KTorrent.torrent(info_hash)
			ret = self.url in [fqdn(tracker) for tracker in tor.trackers()]
			self.cache[info_hash] = ret
			return ret
Esempio n. 3
0
 def torrentAdded(self, info_hash):
     tor = KTorrent.torrent(info_hash)
     trackers = tor.trackers()
     for tracker in trackers:
         if not tracker in self.tracker_map:
             self.addTracker(tracker)
         else:
             self.tracker_map[tracker].ref()
Esempio n. 4
0
	def torrentAdded(self,info_hash):
		tor = KTorrent.torrent(info_hash)
		trackers = tor.trackers()
		for tracker in trackers:
			hostname = fqdn(tracker)
			if not hostname in self.tracker_map:
				self.addTracker(hostname)
			else:
				self.tracker_map[hostname].ref()
Esempio n. 5
0
	def torrentAdded(self,info_hash):
		tor = KTorrent.torrent(info_hash)
		trackers = tor.trackers()
		for tracker in trackers:
			hostname = fqdn(tracker)
			if not hostname in self.tracker_map:
				self.addTracker(hostname)
			else:
				self.tracker_map[hostname].ref()
Esempio n. 6
0
	def torrentRemoved(self,info_hash):
		tor = KTorrent.torrent(info_hash)
		trackers = tor.trackers()
		for tracker in trackers:
			if tracker in self.tracker_map:
				self.removeTracker(tracker)
Esempio n. 7
0
def torrentRemoved(ih):
	tor = KTorrent.torrent(ih)
	KTorrent.log("torrentRemoved=%s" % tor.name())
Esempio n. 8
0
#!/usr/bin/python
import KTorrent
import Kross

def torrentAdded(ih):
	tor = KTorrent.torrent(ih)
	KTorrent.log("torrentAdded=%s" % tor.name())

def torrentRemoved(ih):
	tor = KTorrent.torrent(ih)
	KTorrent.log("torrentRemoved=%s" % tor.name())

 
KTorrent.connect("torrentAdded(const QString &)",torrentAdded)
KTorrent.connect("torrentRemoved(const QString &)",torrentRemoved)

tors = KTorrent.torrents()

KTorrent.log("Num torrents : %i" % len(tors))
for t in tors:
	tor = KTorrent.torrent(t)
	KTorrent.log("Torrent %s = %s" % (t, tor.name()))
	for i in range(0,tor.numFiles()):
		KTorrent.log("File %i = %s" % (i,tor.filePath(i)))
Esempio n. 9
0
 def torrentAdded(self, ih):
     tor = KTorrent.torrent(ih)
     self.connectSignals(tor)
Esempio n. 10
0
	def torrentAdded(self,ih):
		tor = KTorrent.torrent(ih)
		self.connectSignals(tor)
Esempio n. 11
0
 def torrentAdded(self, ih):
     tor = KTorrent.torrent(ih)
     KTorrent.log("Torrent added %s" % tor.name())
     tor.connect("finished(QObject* )", self.torrentFinished)
Esempio n. 12
0
def torrentRemoved(ih):
	tor = KTorrent.torrent(ih)
	KTorrent.log("torrentRemoved=%s" % tor.name())
Esempio n. 13
0
#!/usr/bin/python
import KTorrent
import Kross

def torrentAdded(ih):
	tor = KTorrent.torrent(ih)
	KTorrent.log("torrentAdded=%s" % tor.name())

def torrentRemoved(ih):
	tor = KTorrent.torrent(ih)
	KTorrent.log("torrentRemoved=%s" % tor.name())

 
KTorrent.connect("torrentAdded(const QString &)",torrentAdded)
KTorrent.connect("torrentRemoved(const QString &)",torrentRemoved)

tors = KTorrent.torrents()

KTorrent.log("Num torrents : %i" % len(tors))
for t in tors:
	tor = KTorrent.torrent(t)
	KTorrent.log("Torrent %s = %s" % (t, tor.name()))
	for i in range(0,tor.numFiles()):
		KTorrent.log("File %i = %s" % (i,tor.filePath(i)))
Esempio n. 14
0
 def torrentAdded(self, ih):
     tor = KTorrent.torrent(ih)
     KTorrent.log("Torrent added %s" % tor.name())
     for tk in self.trackers:
         tor.addTracker(tk)
Esempio n. 15
0
	def torrentAdded(self,ih):
		tor = KTorrent.torrent(ih)
		KTorrent.log("Torrent added %s" % tor.name())
		tor.connect("finished(QObject* )",self.torrentFinished)
		tor.connect("seedingAutoStopped(QObject* ,const QString & )",self.seedingAutoStopped)
Esempio n. 16
0
	def torrentRemoved(self,info_hash):
		tor = KTorrent.torrent(info_hash)
		trackers = tor.trackers()
		for tracker in trackers:
			if tracker in self.tracker_map:
				self.removeTracker(tracker)
Esempio n. 17
0
	def torrentAdded(self,ih):
		tor = KTorrent.torrent(ih)
		KTorrent.log("Torrent added %s" % tor.name())
		tor.connect("finished(QObject* )",self.torrentFinished)
		tor.connect("seedingAutoStopped(QObject* ,const QString & )",self.seedingAutoStopped)