diff options
Diffstat (limited to 'src/acit/emailcommands.py')
| -rw-r--r-- | src/acit/emailcommands.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/acit/emailcommands.py b/src/acit/emailcommands.py new file mode 100644 index 0000000..ff1ff5f --- /dev/null +++ b/src/acit/emailcommands.py @@ -0,0 +1,16 @@ + +import re + +from typing import Iterable + +def findcommands(mailtext:str) -> Iterable[re.Match]: + return re.finditer(r'\n(' # match any of: + r'STATUS (OPEN|CLOSED|UNCONF|REJECT|UPSTRM)|' # a status change, STATUS <state> + r'TYPE (BUG|DISCUS|PATCH)|' # a type change, TYPE <type> + r'SUBJECT .*|' # a subject change, SUBJECT <any valid text without newlines> + r'DESCRIPTION( @[0-9]*(:[0-9]*)?)?\r?\n(.*|\r?\n)*\r?\nDESCRIPTION END|' # DESCRIPTION [@<startingline[:<endingline]]\n<any valid text including newlines>\nEND DESCRIPTION + r'(UN)?PERMIT .*)' # change command permission for an emailaddress, (UN)PERMIT <email> + ,mailtext) + + + |
