Helper function to retrieve devices real names

Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
This commit is contained in:
Domenico Iezzi 2017-10-10 19:18:20 +02:00
parent b8412dd68a
commit 2a5be42203

View File

@ -31,9 +31,22 @@ device = {}
def getDevicesCodenames(): def getDevicesCodenames():
"""Returns a list containing devices codenames"""
return config.sections() return config.sections()
def getDevicesReadableNames():
"""Returns a list of tuples (codename, userReadableName)
for each device"""
sections = getDevicesCodenames()
output = []
for s in sections:
device = config[s]['userreadablename']
output.append({'codename': s,
'readableName': config[s]['userreadablename']})
return output
def getDeviceConfig(): def getDeviceConfig():
libList = device['sharedlibraries'].split(",") libList = device['sharedlibraries'].split(",")
featureList = device['features'].split(",") featureList = device['features'].split(",")