X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?p=living-lab-site.git;a=blobdiff_plain;f=cis%2Fbt.py;h=894ea947692ec4b7fd3bee1d18e75482fa60027e;hp=74d43abe11eec04148a9f293bb33ff68cbd4674a;hb=080b37a97e93691b3ba1c4aa3982a143167115a7;hpb=9d5e17576e133645963b8e41083baf235c5cceba diff --git a/cis/bt.py b/cis/bt.py index 74d43ab..894ea94 100644 --- a/cis/bt.py +++ b/cis/bt.py @@ -101,3 +101,17 @@ class BitTorrent: self.session.remove_download(dl, remove_content) logger.log_msg('torrent "%s" stopped' % torrent) break + + def get_torrent_list(self): + """ + Returns a list of all torrents started. + """ + + downloads = self.session.get_downloads() + torrent_list = [] + + for dl in downloads: + tdef = dl.get_def() + torrent_list.append(tdef.get_name() + '.tstream') + + return torrent_list