Skip to content

Commit

Permalink
add groupdict function to triggers (#1061)
Browse files Browse the repository at this point in the history
  • Loading branch information
pilate authored and maxpowa committed Apr 12, 2016
1 parent 1d383a4 commit d260d70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sopel/trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ class Trigger(unicode):
groups = property(lambda self: self._match.groups)
"""The ``groups`` function of the ``match`` attribute.
See Python :mod:`re` documentation for details."""
groupdict = property(lambda self: self._match.groupdict)
"""The ``groupdict`` function of the ``match`` attribute.
See Python :mod:`re` documentation for details."""
args = property(lambda self: self._pretrigger.args)
"""
Expand Down
1 change: 1 addition & 0 deletions test/test_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def test_intents_trigger(nick):
assert trigger.match == fakematch
assert trigger.group == fakematch.group
assert trigger.groups == fakematch.groups
assert trigger.groupdict == fakematch.groupdict
assert trigger.args == ['#Sopel', 'Hello, world']
assert trigger.tags == {'intent': 'ACTION'}
assert trigger.admin is True
Expand Down

0 comments on commit d260d70

Please sign in to comment.