Extend the url_handler plugins to include apt: support

This commit is contained in:
Chris Jones 2009-12-23 17:30:26 +00:00
parent df317bd2cd
commit 0a67d73592

View File

@ -5,7 +5,7 @@ import re
import plugin
# Every plugin you want Terminator to load *must* be listed in 'available'
available = ['LaunchpadURLHandler']
available = ['LaunchpadURLHandler', 'APTURLHandler']
class URLHandler(plugin.Plugin):
"""Base class for URL handlers"""
@ -31,3 +31,14 @@ class LaunchpadURLHandler(URLHandler):
url = 'https://bugs.launchpad.net/bugs/%s' % item
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)