From 06a5de2f7894a081cd5819a991aef017701a8a32 Mon Sep 17 00:00:00 2001 From: Toddelismyname <116207910+Toddelismyname@users.noreply.github.com> Date: Fri, 7 Feb 2025 17:30:48 +0100 Subject: [PATCH] Use operation for sorted participant children --- format.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/format.py b/format.py index bf8774c..3483e03 100644 --- a/format.py +++ b/format.py @@ -171,11 +171,7 @@ def printChildren(self, element, level): # Sort participant's children based on the defined order sorted_participant_children = sorted( group.getchildren(), - key=lambda child: next( - (rank for prefix, rank in PARTICIPANT_ORDER.items() - if str(child.tag).startswith(prefix)), - 6 # Unknown elements appear last - ) + key=lambda child: custom_sort_key(child, PARTICIPANT_ORDER) ) # Separate different types of elements