From 80fc9f2c3e5a784b912049fe15c2934c034c49e2 Mon Sep 17 00:00:00 2001 From: warddr Date: Wed, 27 Aug 2014 07:38:59 +0200 Subject: [PATCH] Make time units case insensitive this fixes #609 --- willie/modules/remind.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/willie/modules/remind.py b/willie/modules/remind.py index 93265c2342..e4bcd5abae 100644 --- a/willie/modules/remind.py +++ b/willie/modules/remind.py @@ -125,7 +125,7 @@ def monitor(bot): def remind(bot, trigger): """Gives you a reminder in the given amount of time.""" duration = 0 - message = filter(None, re.split('(\d+(?:\.\d+)? ?(?:' + periods + ')) ?', + message = filter(None, re.split('(\d+(?:\.\d+)? ?(?:(?i)' + periods + ')) ?', trigger.group(2))[1:]) reminder = '' stop = False @@ -133,7 +133,7 @@ def remind(bot, trigger): grp = re.match('(\d+(?:\.\d+)?) ?(.*) ?', piece) if grp and not stop: length = float(grp.group(1)) - factor = scaling.get(grp.group(2), 60) + factor = scaling.get(grp.group(2).lower(), 60) duration += length * factor else: reminder = reminder + piece