From 0ee1f1a34cb529d9e2c5182ab44c4371fda1a0ad Mon Sep 17 00:00:00 2001 From: William McBrine Date: Sun, 7 Jul 2013 19:08:42 -0400 Subject: [PATCH] Iterating over the dictionary while removing keys from it was causing some settings to go missing -- notably, consistently, tivo_mak. --- plugins/settings/settings.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/settings/settings.py b/plugins/settings/settings.py index 0cf7b4e..beec9c8 100644 --- a/plugins/settings/settings.py +++ b/plugins/settings/settings.py @@ -97,14 +97,15 @@ class Settings(Plugin): def UpdateSettings(self, handler, query): config.reset() + for key in query.keys(): + if key.startswith('opts.'): + data = query[key] + del query[key] + key = key[5:] + query[key] = data for section in ['Server', '_tivo_SD', '_tivo_HD']: new_setting = new_value = ' ' for key in query: - if key.startswith('opts.'): - data = query[key] - del query[key] - key = key[5:] - query[key] = data if key.startswith(section + '.'): _, option = key.split('.') if not config.config.has_section(section): -- 2.11.4.GIT