From e489171e3765c517ce3d642b94a2b0018af8692b Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 16 Mar 2019 15:26:15 -0400 Subject: [PATCH] skip channels with +s --- gen_stats | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gen_stats b/gen_stats index 00b3cf0..0f6ecbc 100755 --- a/gen_stats +++ b/gen_stats @@ -12,6 +12,7 @@ assert d.tag == "inspircdstats" with open(f"{WORK_DIR}/blacklist", "r") as f: BLACKLIST = f.read().splitlines() + 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 continue + channel["webchatlink"] = "https://web.tilde.chat/?join=" + channel["name"].lstrip( "#" )