diff options
author | hploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b> | 2006-09-26 13:05:18 +0000 |
---|---|---|
committer | hploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b> | 2006-09-26 13:05:18 +0000 |
commit | ace0e9947783f402509e710eae9c795fa54f5c83 (patch) | |
tree | f3e4dc28fda6805c2a37da21a66fb02b9c1759db /cyberflex-shell.py | |
parent | a29922f84c212fea127f6c038f3842cc2f7867f7 (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-x | cyberflex-shell.py | 8 |
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 |