Skip to content

Commit d8ae68b

Browse files
committed
No longer sorting settable during initialization since the show method already sorts it results
1 parent 174cd13 commit d8ae68b

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

cmd2/cmd2.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
# setting is True
3232
import argparse
3333
import cmd
34-
import collections
3534
import glob
3635
import inspect
3736
import os
@@ -351,7 +350,6 @@ class Cmd(cmd.Cmd):
351350
timing = False # Prints elapsed time for each command
352351

353352
# To make an attribute settable with the "do_set" command, add it to this ...
354-
# This starts out as a dictionary but gets converted to an OrderedDict sorted alphabetically by key
355353
settable = {'colors': 'Allow colorized output (valid values: Terminal, Always, Never)',
356354
'continuation_prompt': 'On 2nd+ line of input',
357355
'debug': 'Show full error stack on error',
@@ -562,13 +560,10 @@ def visible_prompt(self) -> str:
562560
return utils.strip_ansi(self.prompt)
563561

564562
def _finalize_app_parameters(self) -> None:
565-
"""Finalize the shortcuts and settable parameters."""
563+
"""Finalize the shortcuts"""
566564
# noinspection PyUnresolvedReferences
567565
self.shortcuts = sorted(self.shortcuts.items(), reverse=True)
568566

569-
# Make sure settable parameters are sorted alphabetically by key
570-
self.settable = collections.OrderedDict(sorted(self.settable.items(), key=lambda t: t[0]))
571-
572567
def decolorized_write(self, fileobj: IO, msg: str) -> None:
573568
"""Write a string to a fileobject, stripping ANSI escape sequences if necessary
574569

0 commit comments

Comments
 (0)