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:
parent
4cfc1c6fd2
commit
714425dfbe
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user