From 0a0666f5b447b813323d4326e05298ed249b4804 Mon Sep 17 00:00:00 2001 From: Moritz Venn Date: Wed, 13 Jul 2011 14:00:56 +0200 Subject: [PATCH] autotimer: fix crash caused by weird e2 error(?) notifier was called for unchanged value, resulting in our housekeeping getting confused. still a problem as the same problem could occur with "add", but you just end up with multiple entries in the extensionsmenu until your next reboot, so let's ignore that for now. --- autotimer/src/plugin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autotimer/src/plugin.py b/autotimer/src/plugin.py index ed50d864..c71ce3e4 100644 --- a/autotimer/src/plugin.py +++ b/autotimer/src/plugin.py @@ -167,7 +167,10 @@ def housekeepingExtensionsmenu(el): if el.value: plugins.addPlugin(extDescriptor) else: - plugins.removePlugin(extDescriptor) + try: + plugins.removePlugin(extDescriptor) + except ValueError, ve: + print "[AutoTimer] housekeepingExtensionsmenu got confused, tried to remove non-existant plugin entry... ignoring." config.plugins.autotimer.show_in_extensionsmenu.addNotifier(housekeepingExtensionsmenu, initial_call = False, immediate_feedback = True) extDescriptor = PluginDescriptor(name="AutoTimer", description = _("Edit Timers and scan for new Events"), where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc = extensionsmenu, needsRestart = False) -- 2.20.1