skip channels with +s

This commit is contained in:
Ben Harris 2019-03-16 15:26:15 -04:00
parent c2fc0237fe
commit e489171e37
Signed by untrusted user: ben
GPG Key ID: 4E0AF802FFF7960C

View File

@ -12,6 +12,7 @@ assert d.tag == "inspircdstats"
with open(f"{WORK_DIR}/blacklist", "r") as f:
def define(name, xps, vfilter=lambda x: x):
global out
out[name] = vfilter(d.findall(xps)[0].text)
@ -32,15 +33,14 @@ for schannel in schannels:
if schannel.findall("./channeltopic/topictext")[0].text is not None
else "No topic set"
# bugfix: if mode s is set and there's a topic, hide the topic
if (
# skip channels in the blacklist or with mode +s
"s" in schannel.findall("./channelmodes")[0].text.split()[0]
and channel["topic"] != "No topic set"
or channel["name"] in BLACKLIST
channel["topic"] = "Topic hidden"
if channel["name"] in BLACKLIST:
# skip channels in the blacklist
channel["webchatlink"] = "" + channel["name"].lstrip(