From 377cce170332b8d708750a01237bc3eb1022d6e3 Mon Sep 17 00:00:00 2001 From: Emalee Date: Sat, 7 Jul 2012 12:29:46 -0700 Subject: [PATCH 1/2] make trout command change target yourself to himself --- earwigbot/commands/trout.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/earwigbot/commands/trout.py b/earwigbot/commands/trout.py index 9ec9957..fbbef26 100644 --- a/earwigbot/commands/trout.py +++ b/earwigbot/commands/trout.py @@ -38,6 +38,8 @@ class Trout(Command): def process(self, data): animal = data.command target = " ".join(data.args) or data.nick + target = "himself" if target == "yourself" + normal = normalize("NFKD", target.decode("utf8")).lower() if normal in self.exceptions: self.reply(data, self.exceptions[normal]) From ad1ff720b4b7ee3d08044c4c1d7f862a9b878752 Mon Sep 17 00:00:00 2001 From: Emalee Date: Sat, 7 Jul 2012 12:40:09 -0700 Subject: [PATCH 2/2] apparently the one line if statement is really just a ternary operator? --- earwigbot/commands/trout.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/earwigbot/commands/trout.py b/earwigbot/commands/trout.py index fbbef26..eb05db8 100644 --- a/earwigbot/commands/trout.py +++ b/earwigbot/commands/trout.py @@ -38,7 +38,7 @@ class Trout(Command): def process(self, data): animal = data.command target = " ".join(data.args) or data.nick - target = "himself" if target == "yourself" + target = "himself" if target == "yourself" else target normal = normalize("NFKD", target.decode("utf8")).lower() if normal in self.exceptions: