1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-01 10:52:33 +01:00

Updating energy model instrument to be able to accumulate multiple power rails for each cluster.

This commit is contained in:
Sergei Trofimov
2015-04-13 15:07:14 +01:00
parent c52d562411
commit 47ce9db383
2 changed files with 44 additions and 38 deletions

View File

@@ -96,6 +96,21 @@ def list_or_string(value):
return str(value)
def list_or_caseless_string(value):
"""
If the value is a string, at will be kept as a string, otherwise it will be interpreted
as a list. If that is not possible, it will be interpreted as a string.
"""
if isinstance(value, basestring):
return caseless_string(value)
else:
try:
return map(caseless_string, value)
except ValueError:
return caseless_string(value)
def list_of_strs(value):
"""
Value must be iterable. All elements will be converted to strings.