fix get_atr
git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@248 f711b948-2313-0410-aaa9-d29f33439f0b
This commit is contained in:
parent
c92a60fb10
commit
fa0e0c888c
|
@ -250,15 +250,20 @@ class Card:
|
||||||
if purpose is None: purpose = Card.PURPOSE_SUCCESS
|
if purpose is None: purpose = Card.PURPOSE_SUCCESS
|
||||||
return self.match_statusword(self.STATUS_MAP[purpose], sw)
|
return self.match_statusword(self.STATUS_MAP[purpose], sw)
|
||||||
|
|
||||||
def get_atr(self):
|
def _get_atr(card):
|
||||||
return self.card.status().get("ATR","")
|
|
||||||
|
|
||||||
def can_handle(cls, card):
|
|
||||||
"""Determine whether this class can handle a given card/connection object."""
|
|
||||||
if hasattr(card, "connection"):
|
if hasattr(card, "connection"):
|
||||||
ATR = smartcard.util.toASCIIString(card.connection.getATR())
|
ATR = smartcard.util.toASCIIString(card.connection.getATR())
|
||||||
else:
|
else:
|
||||||
ATR = smartcard.util.toASCIIString(card.getATR())
|
ATR = smartcard.util.toASCIIString(card.getATR())
|
||||||
|
return ATR
|
||||||
|
_get_atr = staticmethod(_get_atr)
|
||||||
|
|
||||||
|
def get_atr(self):
|
||||||
|
return self._get_atr(self.card)
|
||||||
|
|
||||||
|
def can_handle(cls, card):
|
||||||
|
"""Determine whether this class can handle a given card/connection object."""
|
||||||
|
ATR = cls._get_atr(card)
|
||||||
def match_list(atr, list):
|
def match_list(atr, list):
|
||||||
for (knownatr, mask) in list:
|
for (knownatr, mask) in list:
|
||||||
if mask is None:
|
if mask is None:
|
||||||
|
|
Loading…
Reference in New Issue