Some plugins can't ever be disabled. Detect and obey
This commit is contained in:
parent
c649da9949
commit
80289911f1
|
@ -32,6 +32,7 @@ from util import dbg, err, get_config_dir
|
||||||
class Plugin(object):
|
class Plugin(object):
|
||||||
"""Definition of our base plugin class"""
|
"""Definition of our base plugin class"""
|
||||||
capabilities = None
|
capabilities = None
|
||||||
|
is_permanent = None
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
"""Class initialiser."""
|
"""Class initialiser."""
|
||||||
|
@ -135,6 +136,9 @@ for %s' % (len(self.instances), capability))
|
||||||
|
|
||||||
def disable(self, plugin):
|
def disable(self, plugin):
|
||||||
"""Disable a plugin"""
|
"""Disable a plugin"""
|
||||||
|
if self.instances[plugin].is_permanent:
|
||||||
|
dbg("Refusing to disable permanent plugin %s" % plugin)
|
||||||
|
else:
|
||||||
dbg("Disabling %s" % plugin)
|
dbg("Disabling %s" % plugin)
|
||||||
del(self.instances[plugin])
|
del(self.instances[plugin])
|
||||||
|
|
||||||
|
@ -148,6 +152,7 @@ class URLHandler(Plugin):
|
||||||
capabilities = ['url_handler']
|
capabilities = ['url_handler']
|
||||||
handler_name = None
|
handler_name = None
|
||||||
match = None
|
match = None
|
||||||
|
is_permanent = True
|
||||||
|
|
||||||
def callback(self, url):
|
def callback(self, url):
|
||||||
"""Callback to transform the enclosed URL"""
|
"""Callback to transform the enclosed URL"""
|
||||||
|
|
Loading…
Reference in New Issue