Show UI selection ordered by name, none remains at the beginning (#1092)

Fixes random UI selection screen for Python <3.6.
This commit is contained in:
drebrez 2018-01-07 04:55:27 +01:00 committed by Oliver Smith
parent 2eed96201b
commit 748f2ce6b1
2 changed files with 6 additions and 6 deletions

View file

@ -25,11 +25,11 @@ def list(args):
"""
Get all UIs, for which aports are available with their description.
:returns: {"none": "No graphical...", "weston": "Wayland reference..."}
:returns: [("none", "No graphical..."), ("weston", "Wayland reference...")]
"""
ret = {"none": "No graphical environment"}
ret = [("none", "No graphical environment")]
for path in sorted(glob.glob(args.aports + "/main/postmarketos-ui-*")):
apkbuild = pmb.parse.apkbuild(args, path + "/APKBUILD")
ui = os.path.basename(path).split("-", 2)[2]
ret[ui] = apkbuild["pkgdesc"]
ret.append((ui, apkbuild["pkgdesc"]))
return ret