From 0a67d73592331ef4d283aca4a61c56b1fd0fdcee Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Wed, 23 Dec 2009 17:30:26 +0000 Subject: [PATCH] Extend the url_handler plugins to include apt: support --- terminatorlib/plugins/url_handlers.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/terminatorlib/plugins/url_handlers.py b/terminatorlib/plugins/url_handlers.py index fbad40be..9cc39806 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'] +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) +