Bugtracker: Add 'tickets' type to SourceForge tracker.

This commit is contained in:
Krytarik Raido 2021-01-07 17:34:04 +01:00
parent 3596ab6692
commit 5d8e2c4edc
3 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ import supybot
import supybot.world as world import supybot.world as world
from importlib import reload from importlib import reload
__version__ = "4.7.1" __version__ = "4.8.0"
__author__ = supybot.Author("Krytarik Raido", "krytarik", "krytarik@gmail.com") __author__ = supybot.Author("Krytarik Raido", "krytarik", "krytarik@gmail.com")
__contributors__ = { __contributors__ = {
supybot.Author("Dennis Kaarsemaker", "Seveas", "dennis@kaarsemaker.net"): ['Original Author'], supybot.Author("Dennis Kaarsemaker", "Seveas", "dennis@kaarsemaker.net"): ['Original Author'],

View File

@ -407,7 +407,7 @@ class Bugtracker(callbacks.PluginRegexp):
irc.reply(report) irc.reply(report)
def bugUrlSnarfer(self, irc, msg, match): def bugUrlSnarfer(self, irc, msg, match):
r"(https?://)?((bugs\.debian\.org|pad\.lv)/|\S+/(show_bug\.cgi\?id=|bugreport\.cgi\?bug=|view\.php\?id=|bug=|bugs/|\+bug/|ticket/|feature-requests/|patches/|todo/|issues/|pulls?/|merge_requests/))(?P<bug>\d+)" r"(https?://)?((bugs\.debian\.org|pad\.lv)/|\S+/(show_bug\.cgi\?id=|bugreport\.cgi\?bug=|view\.php\?id=|bug=|bugs/|\+bug/|tickets?/|feature-requests/|patches/|todo/|issues/|pulls?/|merge_requests/))(?P<bug>\d+)"
self.urlSnarfer(irc, msg, match, 'bug') self.urlSnarfer(irc, msg, match, 'bug')
def commitUrlSnarfer(self, irc, msg, match): def commitUrlSnarfer(self, irc, msg, match):
@ -551,7 +551,7 @@ class Bugtracker(callbacks.PluginRegexp):
bugtype = re.match(r'\S+/(feature-)?(?P<type>request|patch|todo|issue|pull|merge|ticket|commit)(_requests)?(e?s)?/([^\s?]*\?([^\s?&]+&)?id=)?[a-f0-9]+$', url) bugtype = re.match(r'\S+/(feature-)?(?P<type>request|patch|todo|issue|pull|merge|ticket|commit)(_requests)?(e?s)?/([^\s?]*\?([^\s?&]+&)?id=)?[a-f0-9]+$', url)
if do_tracker and tracker.trackertype not in ('github', 'gitlab', 'gitea', 'cgit'): if do_tracker and tracker.trackertype not in ('github', 'gitlab', 'gitea', 'cgit'):
if re.match(r'\S+/(bugs|feature-requests|patches|todo|issues|pulls?|merge_requests|ticket|commits?)$', tracker.description): if re.match(r'\S+/(bugs|feature-requests|patches|todo|issues|pulls?|merge_requests|tickets?|commits?)$', tracker.description):
report = '%s %s' % (tracker.description, bugid) report = '%s %s' % (tracker.description, bugid)
else: else:
if bugtype: if bugtype:

View File

@ -389,7 +389,7 @@ class Debbugs(IBugtracker):
class SourceForge(IBugtracker): class SourceForge(IBugtracker):
def get_tracker(self, url): def get_tracker(self, url):
try: try:
match = re.match(r'sourceforge\.net/p/[^\s/]+/(bugs|feature-requests|patches|todo)', url) match = re.match(r'sourceforge\.net/p/[^\s/]+/(bugs|tickets|feature-requests|patches|todo)', url)
desc = match.group(0) desc = match.group(0)
name = desc.lower() name = desc.lower()
url = 'https://%s' % desc url = 'https://%s' % desc