From 714425dfbecb60d51879089d619507552614126d Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Wed, 30 Dec 2009 01:50:18 +0000 Subject: [PATCH] Fix apturl handler name and rename LaunchpadURLHandler to LaunchpadBugURLHandler since we are likely to grow a handler for code URLs --- terminatorlib/plugins/url_handlers.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/terminatorlib/plugins/url_handlers.py b/terminatorlib/plugins/url_handlers.py index 9cc39806..b6f6bc2e 100644 --- a/terminatorlib/plugins/url_handlers.py +++ b/terminatorlib/plugins/url_handlers.py @@ -5,7 +5,7 @@ import re import plugin # Every plugin you want Terminator to load *must* be listed in 'available' -available = ['LaunchpadURLHandler', 'APTURLHandler'] +available = ['LaunchpadBugURLHandler', 'APTURLHandler'] class URLHandler(plugin.Plugin): """Base class for URL handlers""" @@ -17,13 +17,13 @@ class URLHandler(plugin.Plugin): """Callback to transform the enclosed URL""" raise NotImplementedError -class LaunchpadURLHandler(URLHandler): - """Launchpad URL handler. If the URL looks like a Launchpad changelog +class LaunchpadBugURLHandler(URLHandler): + """Launchpad Bug URL handler. If the URL looks like a Launchpad changelog closure entry... 'LP: #12345' then it should be transformed into a - Launchpad URL""" + Launchpad Bug URL""" capabilities = ['url_handler'] - handler_name = 'launchpad' - match = '\\bLP:? #?[0-9]+\\b' + handler_name = 'launchpad_bug' + match = '\\b(lp|LP):?\s?#?[0-9]+(,\s*#?[0-9]+)*\\b' def callback(self, url): """Look for the number in the supplied string and return it as a URL""" @@ -35,7 +35,7 @@ class APTURLHandler(URLHandler): """APT URL handler. If there is a URL that looks like an apturl, handle it appropriately""" capabilities = ['url_handler'] - handler_hane = 'apturl' + handler_name = 'apturl' match = '\\bapt:.*\\b' def callback(self, url):