[networking] New function to get a list of watched URL

This commit is contained in:
nemunaire 2015-07-21 00:21:32 +02:00
commit d1c28fc4a3
2 changed files with 23 additions and 0 deletions

View file

@ -36,6 +36,20 @@ def load(datas):
#DATAS.delChild(site)
def watchedon(channel):
"""Get a list of currently watched URL on the given channel.
"""
res = list()
for site in DATAS.getNodes("watch"):
if site.hasNode("alert"):
for a in site.getNodes("alert"):
if a["channel"] == channel:
res.append("%s (%s)" % (site["url"], site["type"]))
break
return res
def del_site(url, nick, channel, frm_owner):
"""Remove a site from watching list