get_status -> get_dev_torrents_state
This commit is contained in:
parent
080ff5974d
commit
ad11029780
|
@ -507,8 +507,7 @@ class Core(
|
|||
status.update(self.plugins.get_status(torrent_id, leftover_fields))
|
||||
return status
|
||||
|
||||
|
||||
def export_get_status(self, keys, filter_dict = None):
|
||||
def export_get_dev_torrents_status(self, filter_dict, keys ):
|
||||
"""
|
||||
returns all torrents , optionally filtered by filter_dict.
|
||||
"""
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
from deluge.ui.client import sclient
|
||||
sclient.set_core_uri()
|
||||
torrent_id = sclient.get_session_state()[0]
|
||||
torrent_id2 = sclient.get_session_state()[1]
|
||||
print torrent_id
|
||||
#/init
|
||||
|
||||
|
@ -16,20 +17,27 @@ print torrent_id
|
|||
print sorted(sclient.get_torrent_status(torrent_id,[]).keys())
|
||||
print sorted(sclient.get_status_keys())
|
||||
|
||||
|
||||
#default, no filter argument.
|
||||
print sclient.get_status(["name","state"])
|
||||
print sclient.get_dev_torrents_status(None, ["name","state"])
|
||||
|
||||
print "HI! , after this the errors start"
|
||||
|
||||
#torrent_id filters and list-arguments:
|
||||
print sclient.get_dev_torrents_status({"id":torrent_id}, ["name","state"])
|
||||
print sclient.get_dev_torrents_status({"id":[torrent_id, torrent_id2]}, ["name","state"])
|
||||
|
||||
#filters on default state fields
|
||||
print sclient.get_status(["name","state"], {"state":"Paused"})
|
||||
print sclient.get_status(["name","state"], {"tracker_host":"aelitis.com"})
|
||||
print sclient.get_dev_torrents_status({"state":"Paused"}, ["name","state"])
|
||||
print sclient.get_dev_torrents_status({"state":["Paused","Downloading"]}, ["name","state"])
|
||||
print sclient.get_dev_torrents_status({"tracker_host":"aelitis.com"}, ["name","state"])
|
||||
|
||||
|
||||
#plugin status fields:
|
||||
print sclient.get_status(["name","state"], {"label":"test"})
|
||||
print sclient.get_dev_torrents_status({"label":"test"}, ["name","state"])
|
||||
print sclient.get_dev_torrents_status({"label":["test","tpb"]}, ["name","state"])
|
||||
|
||||
#special filters:
|
||||
print sclient.get_status(["name","state"], {"keyword":"az"})
|
||||
print sclient.get_dev_torrents_status({"keyword":"az"}, ["name","state"])
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue