Extend the url_handler plugins to include apt: support
This commit is contained in:
parent
df317bd2cd
commit
0a67d73592
|
@ -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']
|
available = ['LaunchpadURLHandler', 'APTURLHandler']
|
||||||
|
|
||||||
class URLHandler(plugin.Plugin):
|
class URLHandler(plugin.Plugin):
|
||||||
"""Base class for URL handlers"""
|
"""Base class for URL handlers"""
|
||||||
|
@ -31,3 +31,14 @@ class LaunchpadURLHandler(URLHandler):
|
||||||
url = 'https://bugs.launchpad.net/bugs/%s' % item
|
url = 'https://bugs.launchpad.net/bugs/%s' % item
|
||||||
return(url)
|
return(url)
|
||||||
|
|
||||||
|
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'
|
||||||
|
match = '\\bapt:.*\\b'
|
||||||
|
|
||||||
|
def callback(self, url):
|
||||||
|
"""Actually we don't need to do anything for this to work"""
|
||||||
|
return(url)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue