aboutsummaryrefslogtreecommitdiffstats
path: root/cyberflex-shell.py
diff options
context:
space:
mode:
authorhploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b>2006-09-26 13:05:18 +0000
committerhploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b>2006-09-26 13:05:18 +0000
commitace0e9947783f402509e710eae9c795fa54f5c83 (patch)
treef3e4dc28fda6805c2a37da21a66fb02b9c1759db /cyberflex-shell.py
parenta29922f84c212fea127f6c038f3842cc2f7867f7 (diff)
Make it possible to ignore errors of a certain type when running a script
git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@115 f711b948-2313-0410-aaa9-d29f33439f0b
Diffstat (limited to 'cyberflex-shell.py')
-rwxr-xr-xcyberflex-shell.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/cyberflex-shell.py b/cyberflex-shell.py
index cc41460..0927d57 100755
--- a/cyberflex-shell.py
+++ b/cyberflex-shell.py
@@ -20,6 +20,7 @@ class Cyberflex_Shell(Shell):
fh = file(filename)
doit = False
+ ignored_SWs = []
for line in fh:
if line[:2] == "//" or line[:1] == "#":
@@ -42,13 +43,18 @@ class Cyberflex_Shell(Shell):
self.parse_and_execute(line)
- if self.card.sw_changed and self.card.last_sw != self.card.SW_OK:
+ if self.card.sw_changed and self.card.last_sw != self.card.SW_OK \
+ and self.card.last_sw not in ignored_SWs:
+
print "SW was not %s. Ignore (i) or Abort (a)? " % binascii.hexlify(self.card.SW_OK),
answer = sys.stdin.readline()
if answer[0].lower() in ('i', "\n"):
pass
elif answer[0].lower() == 'a':
return
+ elif answer[0] == 'S':
+ ignored_SWs.append(self.card.last_sw)
+ pass
else:
return