From efcd0f0cfd9ef92711d8d74ebe1f4e451dfd931d Mon Sep 17 00:00:00 2001 From: hploetz Date: Thu, 25 May 2006 13:36:25 +0000 Subject: sorting git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@76 f711b948-2313-0410-aaa9-d29f33439f0b --- cards/tcos_card.py | 4 +++- shell.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cards/tcos_card.py b/cards/tcos_card.py index 0145e82..7b6497b 100644 --- a/cards/tcos_card.py +++ b/cards/tcos_card.py @@ -50,7 +50,7 @@ class TCOS_Card(ISO_7816_4_Card): return None _find_recursive = staticmethod(_find_recursive) - _ls_l_template = "%(name)10s\t%(type)s\t%(size)4s" + _ls_l_template = "%(name)-12s\t%(type)3s\t%(size)4s" def cmd_list(self, *options): """List all EFs and DFs in current DF. Call with -l for verbose information (caution: deselects current file)""" dirs = self.list_x(1) @@ -69,6 +69,8 @@ class TCOS_Card(ISO_7816_4_Card): if "-l" in options: print self._ls_l_template % {"name": "Name", "type": "Type", "size": "Size"} + dirs.sort() + files.sort() for FID in dirs: name = "[" + utils.hexdump(FID, short=True) + "]" type = "DF" diff --git a/shell.py b/shell.py index b72408f..482c189 100644 --- a/shell.py +++ b/shell.py @@ -341,6 +341,7 @@ class Shell: "Print help, either for all commands or for a specific one." if command is None: command_list = self.get_command_mapping().keys() + command_list.sort() for command in command_list: print self.SHORT_HELP_FORMATSTRING % self.help(command) else: -- cgit v1.2.3