Don't redefine the 'dict' builtin. (Caught by pylint)
Also improve variable name consistency.
This commit is contained in:
@ -295,8 +295,8 @@ class InstConfigData:
|
||||
self.__get_options()
|
||||
self.__get_implementations()
|
||||
self.__get_configurations()
|
||||
for opt, dict in self.opt_dict.iteritems():
|
||||
self.optypelist.append((opt, dict['imptype']))
|
||||
for opt, opt_desc in self.opt_dict.iteritems():
|
||||
self.optypelist.append((opt, opt_desc['imptype']))
|
||||
|
||||
def backup_files(self):
|
||||
""" Backup configuration files """
|
||||
@ -310,19 +310,19 @@ class InstConfigData:
|
||||
|
||||
def write_config_file(self):
|
||||
""" Write out InstConfigData values to the configuration file."""
|
||||
for item, dict in self.opt_dict.iteritems():
|
||||
if 'permanent' in dict and dict['permanent'] == True:
|
||||
for opt, opt_desc in self.opt_dict.iteritems():
|
||||
if 'permanent' in opt_desc and opt_desc['permanent'] == True:
|
||||
enabled = 'Always'
|
||||
else:
|
||||
enabled = dict['enabled'].__str__()
|
||||
enabled = opt_desc['enabled'].__str__()
|
||||
|
||||
self.file_parser.set(item, 'enabled', enabled)
|
||||
self.file_parser.set(item, 'implementation', dict['selected_imp'])
|
||||
self.file_parser.set(item, 'optype', dict['imptype'])
|
||||
self.file_parser.set(opt, 'enabled', enabled)
|
||||
self.file_parser.set(opt, 'implementation', opt_desc['selected_imp'])
|
||||
self.file_parser.set(opt, 'optype', opt_desc['imptype'])
|
||||
|
||||
for item, dict in self.configuration_dict.iteritems():
|
||||
enabled = dict['enabled'].__str__()
|
||||
self.file_parser.set(item, 'enabled', enabled)
|
||||
for config, config_desc in self.configuration_dict.iteritems():
|
||||
enabled = config_desc['enabled'].__str__()
|
||||
self.file_parser.set(config, 'enabled', enabled)
|
||||
|
||||
for imp, opt in self.imp2opt_dict.iteritems():
|
||||
if imp != 'none' and opt != 'none' and 'id' in self.opt_dict[opt]:
|
||||
@ -352,8 +352,8 @@ class InstConfigData:
|
||||
|
||||
def iter_implementations(self, opt):
|
||||
"""Iterate over implementation names for the given option."""
|
||||
dict = self.opt_dict[opt]
|
||||
for imp in self.imp_dict[dict['imptype']]:
|
||||
opt_desc = self.opt_dict[opt]
|
||||
for imp in self.imp_dict[opt_desc['imptype']]:
|
||||
yield imp
|
||||
|
||||
def cf_statechange(self, cfg_id, new_state, udat=None):
|
||||
|
Reference in New Issue
Block a user