# -*- coding: utf-8 -*-
# Copyright (C) 2010, 2011 Anaƫl Verrier <elghinn@free.fr>
-# Copyright (C) 2015, 2020 kaliko <kaliko@azylum.org>
+# Copyright (C) 2015, 2021 kaliko <kaliko@azylum.org>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
.. note::
This plugin depends on external module: **python-debianbts**
"""
- re_bugs = re_compile(r'(?<=#)(\d{6,7})')
+ #: Bug id regexp, intercepts bug id in strings : "#629234", "bugs.debian.org/629234" and "bugreport.cgi?bug=629234"
+ re_bugs = re_compile(r'(?:(?<=#)|(?<=bugreport\.cgi\?bug=)|(?<=bugs\.debian\.org/))(\d{6,7})')
+ #: Package name regexp
re_pkg = re_compile(r'(?P<package>[0-9a-z.+-]+)$')
def __init__(self, bot):
# Does not reply to myself
if msg['mucnick'] == self.bot.nick:
return
- if '#' not in msg['body']:
- return
bugs = list()
for bug_id in set(Bugs.re_bugs.findall(msg['body'].strip())):
self.log.debug('got bug id: %s', bug_id)