From: Christian Heller Date: Thu, 4 Feb 2016 07:53:22 +0000 (+0100) Subject: Instead of removing names of present users, malkovich them. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/static/processes?a=commitdiff_plain;h=d937e8a8fd459058147747d896e8db18db609a3e;p=plomlombot-irc.git Instead of removing names of present users, malkovich them. --- diff --git a/plomlombot.py b/plomlombot.py index 82f96a2..64e46f8 100755 --- a/plomlombot.py +++ b/plomlombot.py @@ -185,14 +185,14 @@ def handle_command(command, argument, notice, target, session): shuffle(usable_selections) return usable_selections[0][select_length] - def purge_undesired(tokens): - for token in tokens: - if None != re.match("^" + URLREGEX, token): - del(tokens[tokens.index(token)]) + def malkovich_undesired(tokens): + #for token in tokens: + # if None != re.match("^" + URLREGEX, token): + # del(tokens[tokens.index(token)]) for name in session.uses_in_chan: while True: try: - del(tokens[tokens.index(name.lower())]) + tokens[tokens.index(name.lower())] = "malkovich" except ValueError: break return tokens @@ -209,7 +209,7 @@ def handle_command(command, argument, notice, target, session): for line in lines: line = line.replace("\n", "").lower() tokens += line.split() - tokens = purge_undesired(tokens) + tokens = malkovich_undesired(tokens) if len(tokens) <= select_length: notice("NOT ENOUGH TEXT TO MARKOV.") return