aboutsummaryrefslogtreecommitdiffstats
path: root/cyberflex-shell.py
diff options
context:
space:
mode:
authorhploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b>2006-05-17 18:50:18 +0000
committerhploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b>2006-05-17 18:50:18 +0000
commit7d3953d48d92430aa503cb6758b04ddb9c7fe71b (patch)
tree83c8942fb34dabdc9088714eb903c38c5fa47e0f /cyberflex-shell.py
parenta2d6c6a624c0e02fd9cf1309c87b9dfae3640541 (diff)
nicer status word printing
git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@47 f711b948-2313-0410-aaa9-d29f33439f0b
Diffstat (limited to 'cyberflex-shell.py')
-rwxr-xr-xcyberflex-shell.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/cyberflex-shell.py b/cyberflex-shell.py
index f7a0baa..d328af1 100755
--- a/cyberflex-shell.py
+++ b/cyberflex-shell.py
@@ -92,13 +92,15 @@ if __name__ == "__main__":
apdu_binary = binascii.a2b_hex("".join(apdu_string.split()))
apdu = utils.APDU(apdu_binary)
response = card.send_apdu(apdu)
- print utils.hexdump(response)
+
+ if len(response) > 2: ## The SW is already printed by _print_sw as a post_hook
+ print utils.hexdump(response[:-2])
shell.fallback = do_raw_apdu
def _print_sw():
if card.sw_changed:
- print card.decode_statusword()
+ print "\n", card.decode_statusword()
shell.register_post_hook(_print_sw)
shell.run()