Fix apturl handler name and rename LaunchpadURLHandler to LaunchpadBugURLHandler since we are likely to grow a handler for code URLs

This commit is contained in:
Chris Jones 2009-12-30 01:50:18 +00:00
parent 4cfc1c6fd2
commit 714425dfbe
1 changed files with 7 additions and 7 deletions

View File

@ -5,7 +5,7 @@ import re
import plugin import plugin
# Every plugin you want Terminator to load *must* be listed in 'available' # Every plugin you want Terminator to load *must* be listed in 'available'
available = ['LaunchpadURLHandler', 'APTURLHandler'] available = ['LaunchpadBugURLHandler', 'APTURLHandler']
class URLHandler(plugin.Plugin): class URLHandler(plugin.Plugin):
"""Base class for URL handlers""" """Base class for URL handlers"""
@ -17,13 +17,13 @@ class URLHandler(plugin.Plugin):
"""Callback to transform the enclosed URL""" """Callback to transform the enclosed URL"""
raise NotImplementedError raise NotImplementedError
class LaunchpadURLHandler(URLHandler): class LaunchpadBugURLHandler(URLHandler):
"""Launchpad URL handler. If the URL looks like a Launchpad changelog """Launchpad Bug URL handler. If the URL looks like a Launchpad changelog
closure entry... 'LP: #12345' then it should be transformed into a closure entry... 'LP: #12345' then it should be transformed into a
Launchpad URL""" Launchpad Bug URL"""
capabilities = ['url_handler'] capabilities = ['url_handler']
handler_name = 'launchpad' handler_name = 'launchpad_bug'
match = '\\bLP:? #?[0-9]+\\b' match = '\\b(lp|LP):?\s?#?[0-9]+(,\s*#?[0-9]+)*\\b'
def callback(self, url): def callback(self, url):
"""Look for the number in the supplied string and return it as a 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 """APT URL handler. If there is a URL that looks like an apturl, handle
it appropriately""" it appropriately"""
capabilities = ['url_handler'] capabilities = ['url_handler']
handler_hane = 'apturl' handler_name = 'apturl'
match = '\\bapt:.*\\b' match = '\\bapt:.*\\b'
def callback(self, url): def callback(self, url):