From 90635dd2c1445c6d0b134b7577ef35f12b3054b9 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Wed, 4 Apr 2018 18:23:10 -0400 Subject: [PATCH] Reverse sort previous elections output Our current list appears to be unsorted at best, leading to an out of order history of the previous elections. Reverse the list displaying recent (first) to latest (last) results. Change-Id: I8228aeaac205c35633f3c6e5279497c6b7177125 Signed-off-by: Paul Belanger --- doc/source/_exts/candidates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/_exts/candidates.py b/doc/source/_exts/candidates.py index 9983bb40..8e008420 100644 --- a/doc/source/_exts/candidates.py +++ b/doc/source/_exts/candidates.py @@ -98,7 +98,7 @@ def build_lists(app): "" ] archived_dir = os.path.join(".", "doc", "source", "results") - for previous in os.listdir(archived_dir): + for previous in sorted(os.listdir(archived_dir), reverse=True): if build_archive(previous, "ptl"): previous_toc.append(" results/%s/ptl.rst" % previous) if build_archive(previous, "tc"):