Skip to content

Commit

Permalink
Merge pull request #610 from warddr/issue609-RemindToLower
Browse files Browse the repository at this point in the history
Make time units case insensitive
  • Loading branch information
embolalia committed Aug 31, 2014
2 parents 1362afc + 80fc9f2 commit c2b130b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions willie/modules/remind.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ 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
for piece in message:
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
Expand Down

0 comments on commit c2b130b

Please sign in to comment.