aboutsummaryrefslogtreecommitdiffstats
path: root/cards
diff options
context:
space:
mode:
authorhploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b>2006-05-20 03:53:11 +0000
committerhploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b>2006-05-20 03:53:11 +0000
commitac02f8445b47ff13ef5bde08929ae69610d179ff (patch)
treee0705810f4fc8d68ccb2a8a04a37bf2185cef325 /cards
parentba185c175ac37a71fe61ab44133627314a051f65 (diff)
ls and cd commands for tcos
git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@62 f711b948-2313-0410-aaa9-d29f33439f0b
Diffstat (limited to 'cards')
-rw-r--r--cards/tcos_card.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/cards/tcos_card.py b/cards/tcos_card.py
index cc6cce7..dd1b5a2 100644
--- a/cards/tcos_card.py
+++ b/cards/tcos_card.py
@@ -26,6 +26,21 @@ class TCOS_Card(ISO_7816_4_Card):
result = self.list_x(2)
print "EFs: " + ", ".join([utils.hexdump(a, short=True) for a in result])
+ def cmd_list(self):
+ "List all EFs and DFs in current DF"
+ dirs = self.list_x(1)
+ files = self.list_x(2)
+ self.sw_changed = False
+ print "\n".join( ["[%s]" % utils.hexdump(a, short=True) for a in dirs]
+ + [" %s " % utils.hexdump(a, short=True) for a in files] )
+
+ def cmd_cd(self, dir = None):
+ "Change into a DF, or into the MF if no dir is given"
+ if dir is None:
+ return self.cmd_selectfile("00", "00", "")
+ else:
+ return self.cmd_selectfile("01", "00", dir)
+
ATRS = list(Card.ATRS)
ATRS.extend( [
("3bba96008131865d0064057b0203318090007d", None),
@@ -35,4 +50,6 @@ class TCOS_Card(ISO_7816_4_Card):
COMMANDS.update( {
"list_dirs": cmd_listdirs,
"list_files": cmd_listfiles,
+ "ls": cmd_list,
+ "cd": cmd_cd,
} )