mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-09-03 03:42:35 +01:00
Add support for Python 3
Add support for running under Python 3, while maintaining compatibility with Python 2. See http://python-future.org/compatible_idioms.html for more details behind these changes.
This commit is contained in:
committed by
Marc Bonnici
parent
c3ddb31d4d
commit
b3de85455a
@@ -90,7 +90,7 @@ def convert_wa2_agenda(filepath, output_path):
|
||||
default=True),
|
||||
])
|
||||
|
||||
for param in orig_agenda.keys():
|
||||
for param in list(orig_agenda.keys()):
|
||||
for cfg_point in config_points:
|
||||
if param == cfg_point.name or param in cfg_point.aliases:
|
||||
if cfg_point.name == 'augmentations':
|
||||
@@ -105,7 +105,7 @@ def convert_wa2_agenda(filepath, output_path):
|
||||
|
||||
# Convert plugin configuration
|
||||
output.write("# Plugin Configuration\n")
|
||||
for param in orig_agenda.keys():
|
||||
for param in list(orig_agenda.keys()):
|
||||
if pluginloader.has_plugin(param):
|
||||
entry = {param: orig_agenda.pop(param)}
|
||||
yaml.dump(format_parameter(entry), output, default_flow_style=False)
|
||||
@@ -114,7 +114,7 @@ def convert_wa2_agenda(filepath, output_path):
|
||||
# Write any additional aliased parameters into new config
|
||||
plugin_cache = PluginCache()
|
||||
output.write("# Additional global aliases\n")
|
||||
for param in orig_agenda.keys():
|
||||
for param in list(orig_agenda.keys()):
|
||||
if plugin_cache.is_global_alias(param):
|
||||
entry = {param: orig_agenda.pop(param)}
|
||||
yaml.dump(format_parameter(entry), output, default_flow_style=False)
|
||||
@@ -123,7 +123,7 @@ def convert_wa2_agenda(filepath, output_path):
|
||||
|
||||
def format_parameter(param):
|
||||
if isinstance(param, dict):
|
||||
return {identifier(k) : v for k, v in param.iteritems()}
|
||||
return {identifier(k) : v for k, v in param.items()}
|
||||
else:
|
||||
return param
|
||||
|
||||
|
Reference in New Issue
Block a user