Skip to content

Commit

Permalink
Tools: param AlphabeticalZeroAtTop handles -1
Browse files Browse the repository at this point in the history
  • Loading branch information
rmackay9 committed Jan 14, 2025
1 parent c2e4006 commit d9e05e9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Tools/autotest/param_metadata/xmlemit.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,12 @@ def sorted_Values_keys(self, nv_pairs, zero_at_top=False):
keys = nv_pairs.keys()
def sort_key(value):
description = nv_pairs[value]
if zero_at_top and value == "0":
# make sure this item goes at the top of the list:
return "AAAAAAA"
if zero_at_top:
# make sure -1 and 0 appear at the top of the list
if value == "-1":
return "AAAAAAA"
if value == "0":
return "AAAAAAB"
return description
return sorted(keys, key=sort_key)

Expand Down

0 comments on commit d9e05e9

Please sign in to comment.