basic get_status()
This commit is contained in:
parent
0469d46717
commit
080ff5974d
|
@ -507,6 +507,17 @@ class Core(
|
||||||
status.update(self.plugins.get_status(torrent_id, leftover_fields))
|
status.update(self.plugins.get_status(torrent_id, leftover_fields))
|
||||||
return status
|
return status
|
||||||
|
|
||||||
|
|
||||||
|
def export_get_status(self, keys, filter_dict = None):
|
||||||
|
"""
|
||||||
|
returns all torrents , optionally filtered by filter_dict.
|
||||||
|
"""
|
||||||
|
if filter_dict:
|
||||||
|
raise NotImplementedError("not yet")
|
||||||
|
|
||||||
|
torrent_ids = self.torrents.get_torrent_list()
|
||||||
|
return self.export_get_torrents_status(torrent_ids, keys)
|
||||||
|
|
||||||
def export_get_torrents_status(self, torrent_ids, keys):
|
def export_get_torrents_status(self, torrent_ids, keys):
|
||||||
status_dict = {}.fromkeys(torrent_ids)
|
status_dict = {}.fromkeys(torrent_ids)
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,10 @@ print sorted(sclient.get_torrent_status(torrent_id,[]).keys())
|
||||||
print sorted(sclient.get_status_keys())
|
print sorted(sclient.get_status_keys())
|
||||||
|
|
||||||
|
|
||||||
|
#default, no filter argument.
|
||||||
|
print sclient.get_status(["name","state"])
|
||||||
|
|
||||||
|
print "HI! , after this the errors start"
|
||||||
#filters on default state fields
|
#filters on default state fields
|
||||||
print sclient.get_status(["name","state"], {"state":"Paused"})
|
print sclient.get_status(["name","state"], {"state":"Paused"})
|
||||||
print sclient.get_status(["name","state"], {"tracker_host":"aelitis.com"})
|
print sclient.get_status(["name","state"], {"tracker_host":"aelitis.com"})
|
||||||
|
|
Loading…
Reference in New Issue