From 51fe811b8573fddf21ce84223bdf2b1bb14c5412 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sun, 20 Jun 2010 23:56:11 +0100 Subject: [PATCH] Add a method for determining if a plugin is permanent - i.e. if it cannot be unloaded --- terminatorlib/plugin.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/terminatorlib/plugin.py b/terminatorlib/plugin.py index c0bb95ea..fd86f0c1 100755 --- a/terminatorlib/plugin.py +++ b/terminatorlib/plugin.py @@ -128,6 +128,16 @@ for %s' % (len(self.instances), capability)) not""" return(self.instances.has_key(plugin)) + def is_permanent(self, plugin): + """Return a boolean value indicating whether a plugin is believed to be + permanent. This is impossible to determine for plugins that haven't + been loaded, so they will report as not being permanent until they are + loaded""" + if plugin not in self.instances: + return(False) + else: + return(self.instances[plugin].is_permanent) + def enable(self, plugin): """Enable a plugin""" dbg("Enabling %s" % plugin)