diff options
Diffstat (limited to 'src/lib/Client/Frame.py')
-rw-r--r-- | src/lib/Client/Frame.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/Client/Frame.py b/src/lib/Client/Frame.py index d6424b603..63770760c 100644 --- a/src/lib/Client/Frame.py +++ b/src/lib/Client/Frame.py @@ -4,10 +4,18 @@ __revision__ = '$Revision$' import logging, time import Bcfg2.Client.Tools +def cmpent(ent1, ent2): + '''Sort entries''' + if ent1.tag != ent2.tag: + return cmp(ent1.tag, ent2.tag) + else: + return cmd(ent1.get('name'), ent2.get('name')) + def promptFilter(prompt, entries): '''Filter a supplied list based on user input''' ret = [] - for entry in [entry for entry in entries]: + entries.sort(cmpent) + for entry in entries[:]: try: if raw_input(prompt % (entry.tag, entry.get('name'))) in ['y', 'Y']: ret.append(entry) |