Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Commit

Permalink
Fixed issues in the examples
Browse files Browse the repository at this point in the history
  • Loading branch information
monofox committed Dec 6, 2018
1 parent e8a6215 commit b1fd568
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions examples/getbalance.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def passwordStatus_cb(token, pin, status):
if status == 2 or status == 1:
try:
del(cachedPasswords[token])
except:
except KeyError:
pass
elif status == 0:
cachedPasswords[token] = pin
Expand All @@ -30,7 +30,7 @@ def password_cb(flags, token, title, text, minLen, maxLen):
# Ask only, if we didn't asked already for a PIN.
try:
return cachedPasswords[token]
except:
except KeyError:
plainText = text if '<html>' not in text else text[:text.find('<html>')].replace('\r', '').replace('\n', '')
pin = getpass.getpass('%s: ' % (plainText,))
return pin
Expand Down
4 changes: 2 additions & 2 deletions examples/getjobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def passwordStatus_cb(token, pin, status):
if status == 2 or status == 1:
try:
del(cachedPasswords[token])
except:
except KeyError:
pass
elif status == 0:
cachedPasswords[token] = pin
Expand All @@ -30,7 +30,7 @@ def password_cb(flags, token, title, text, minLen, maxLen):
# Ask only, if we didn't asked already for a PIN.
try:
return cachedPasswords[token]
except:
except KeyError:
plainText = text if '<html>' not in text else text[:text.find('<html>')].replace('\r', '').replace('\n', '')
pin = getpass.getpass('%s: ' % (plainText,))
return pin
Expand Down
4 changes: 2 additions & 2 deletions examples/listaccs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def passwordStatus_cb(token, pin, status):
if status == 2 or status == 1:
try:
del(cachedPasswords[token])
except:
except KeyError:
pass
elif status == 0:
cachedPasswords[token] = pin
Expand All @@ -30,7 +30,7 @@ def password_cb(flags, token, title, text, minLen, maxLen):
# Ask only, if we didn't asked already for a PIN.
try:
return cachedPasswords[token]
except:
except KeyError:
plainText = text if '<html>' not in text else text[:text.find('<html>')].replace('\r', '').replace('\n', '')
pin = getpass.getpass('%s: ' % (plainText,))
return pin
Expand Down
4 changes: 2 additions & 2 deletions examples/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def passwordStatus_cb(token, pin, status):
if status == 2 or status == 1:
try:
del(cachedPasswords[token])
except:
except KeyError:
pass
elif status == 0:
cachedPasswords[token] = pin
Expand All @@ -31,7 +31,7 @@ def password_cb(flags, token, title, text, minLen, maxLen):
# Ask only, if we didn't asked already for a PIN.
try:
return cachedPasswords[token]
except:
except KeyError:
plainText = text if '<html>' not in text else text[:text.find('<html>')].replace('\r', '').replace('\n', '')
pin = getpass.getpass('%s: ' % (plainText,))
return pin
Expand Down
4 changes: 2 additions & 2 deletions examples/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def passwordStatus_cb(token, pin, status):
if status == 2 or status == 1:
try:
del(cachedPasswords[token])
except:
except KeyError:
pass
elif status == 0:
cachedPasswords[token] = pin
Expand All @@ -30,7 +30,7 @@ def password_cb(flags, token, title, text, minLen, maxLen):
# Ask only, if we didn't asked already for a PIN.
try:
return cachedPasswords[token]
except:
except KeyError:
plainText = text if '<html>' not in text else text[:text.find('<html>')].replace('\r', '').replace('\n', '')
pin = getpass.getpass('%s: ' % (plainText,))
return pin
Expand Down

0 comments on commit b1fd568

Please sign in to comment.