Don't redefine the 'dict' builtin. (Caught by pylint)

Also improve variable name consistency.
This commit is contained in:
Ferdi Franceschini
2014-07-06 11:47:23 +10:00
parent 8a6004e12d
commit a5ea730343

View File

@ -295,8 +295,8 @@ class InstConfigData:
self.__get_options() self.__get_options()
self.__get_implementations() self.__get_implementations()
self.__get_configurations() self.__get_configurations()
for opt, dict in self.opt_dict.iteritems(): for opt, opt_desc in self.opt_dict.iteritems():
self.optypelist.append((opt, dict['imptype'])) self.optypelist.append((opt, opt_desc['imptype']))
def backup_files(self): def backup_files(self):
""" Backup configuration files """ """ Backup configuration files """
@ -310,19 +310,19 @@ class InstConfigData:
def write_config_file(self): def write_config_file(self):
""" Write out InstConfigData values to the configuration file.""" """ Write out InstConfigData values to the configuration file."""
for item, dict in self.opt_dict.iteritems(): for opt, opt_desc in self.opt_dict.iteritems():
if 'permanent' in dict and dict['permanent'] == True: if 'permanent' in opt_desc and opt_desc['permanent'] == True:
enabled = 'Always' enabled = 'Always'
else: else:
enabled = dict['enabled'].__str__() enabled = opt_desc['enabled'].__str__()
self.file_parser.set(item, 'enabled', enabled) self.file_parser.set(opt, 'enabled', enabled)
self.file_parser.set(item, 'implementation', dict['selected_imp']) self.file_parser.set(opt, 'implementation', opt_desc['selected_imp'])
self.file_parser.set(item, 'optype', dict['imptype']) self.file_parser.set(opt, 'optype', opt_desc['imptype'])
for item, dict in self.configuration_dict.iteritems(): for config, config_desc in self.configuration_dict.iteritems():
enabled = dict['enabled'].__str__() enabled = config_desc['enabled'].__str__()
self.file_parser.set(item, 'enabled', enabled) self.file_parser.set(config, 'enabled', enabled)
for imp, opt in self.imp2opt_dict.iteritems(): for imp, opt in self.imp2opt_dict.iteritems():
if imp != 'none' and opt != 'none' and 'id' in self.opt_dict[opt]: if imp != 'none' and opt != 'none' and 'id' in self.opt_dict[opt]:
@ -352,8 +352,8 @@ class InstConfigData:
def iter_implementations(self, opt): def iter_implementations(self, opt):
"""Iterate over implementation names for the given option.""" """Iterate over implementation names for the given option."""
dict = self.opt_dict[opt] opt_desc = self.opt_dict[opt]
for imp in self.imp_dict[dict['imptype']]: for imp in self.imp_dict[opt_desc['imptype']]:
yield imp yield imp
def cf_statechange(self, cfg_id, new_state, udat=None): def cf_statechange(self, cfg_id, new_state, udat=None):