From e468d51daea09fa49d2e4c3a1c47318636ec434c Mon Sep 17 00:00:00 2001 From: Martijn Braam Date: Wed, 9 Jan 2019 01:48:25 +0100 Subject: [PATCH] Fix/add helpers.devices.list_{apkbuilds,deviceinfos}() (!1737) This fixes list_apkbuilds which is dead code currently but is useful for external software using pmbootstrap. It also adds list_deviceinfos which does the same thing but for the deviceinfo data. The plan is to add an API later, where both functions can be used. --- pmb/helpers/devices.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pmb/helpers/devices.py b/pmb/helpers/devices.py index 79c2f6f3..ab4877b5 100644 --- a/pmb/helpers/devices.py +++ b/pmb/helpers/devices.py @@ -39,6 +39,16 @@ def list_apkbuilds(args): """ ret = {} for device in list(args): - apkbuild_path = args.aports + "/device-" + device + "/APKBUILD" + apkbuild_path = args.aports + "/device/device-" + device + "/APKBUILD" ret[device] = pmb.parse.apkbuild(args, apkbuild_path) return ret + + +def list_deviceinfos(args): + """ + :returns: { "first-device": {"name": ..., "screen_width": ...}, ... } + """ + ret = {} + for device in list(args): + ret[device] = pmb.parse.deviceinfo(args, device) + return ret