jenkins-bot has submitted this change and it was merged. Change subject: license: trim #.* in links ......................................................................
license: trim #.* in links Otherwise GPL#v2 won't be found when trying to match against the GPL page name using string comparison. Change-Id: I9571fd24d32396e492783d6038f6b7f31be00431 Signed-off-by: Loic Dachary <l...@dachary.org> --- M FLOSSbot/license.py M tests/test_license.py 2 files changed, 2 insertions(+), 1 deletion(-) Approvals: Dachary: Looks good to me, approved jenkins-bot: Verified diff --git a/FLOSSbot/license.py b/FLOSSbot/license.py index 8f881b7..7784847 100644 --- a/FLOSSbot/license.py +++ b/FLOSSbot/license.py @@ -230,6 +230,7 @@ results = set() for name in (re.findall('\[\[([^|\]]+?)\]\]', license) + re.findall('\[\[([^|\]]+?)\|[^\]]*\]\]', license)): + name = re.sub('#.*', '', name) log.debug("template_parse_license: " + name) if name in free_software_licenses: results.add(self.get_item(name, lang)) diff --git a/tests/test_license.py b/tests/test_license.py index 54c6d64..f6f2b76 100644 --- a/tests/test_license.py +++ b/tests/test_license.py @@ -69,7 +69,7 @@ bot = Bot.factory(['--verbose'] + self.args) license = License(bot, bot.args) found = license.template_parse_license( - '[[GNU GPL]] [[MIT/X11 license|]]', 'en') + '[[GNU GPL#v2]] [[MIT/X11 license|]]', 'en') assert 2 == len(found) for item in found: item.get() -- To view, visit https://gerrit.wikimedia.org/r/316351 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9571fd24d32396e492783d6038f6b7f31be00431 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/FLOSSbot Gerrit-Branch: master Gerrit-Owner: Dachary <l...@dachary.org> Gerrit-Reviewer: Dachary <l...@dachary.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits