sre is deprecated in python 2.5
git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@238 f711b948-2313-0410-aaa9-d29f33439f0b
This commit is contained in:
parent
fd7bcf04a1
commit
9a1a0ccdce
|
@ -1,4 +1,4 @@
|
|||
import binascii, utils, sre, sys
|
||||
import binascii, utils, re, sys
|
||||
|
||||
class identifier:
|
||||
"""An identifier, because I'm too lazy to use quotes all over the place.
|
||||
|
@ -174,7 +174,7 @@ def decode_oid(value):
|
|||
loadOids()
|
||||
return " %s (%s)" % (str_rep, oidCache.get(str_rep, ("No description available",))[0])
|
||||
|
||||
_gtimere = sre.compile(r'(\d{4})(\d\d)(\d\d)(\d\d)(?:(\d\d)(\d\d(?:[.,]\d+)?)?)?(|Z|(?:[+-]\d\d(?:\d\d)?))$')
|
||||
_gtimere = re.compile(r'(\d{4})(\d\d)(\d\d)(\d\d)(?:(\d\d)(\d\d(?:[.,]\d+)?)?)?(|Z|(?:[+-]\d\d(?:\d\d)?))$')
|
||||
def decode_generalized_time(value):
|
||||
matches = _gtimere.match(value)
|
||||
if not matches:
|
||||
|
@ -201,7 +201,7 @@ def decode_generalized_time(value):
|
|||
|
||||
return "".join(result)
|
||||
|
||||
_utimere = sre.compile(r'(\d\d)(\d\d)(\d\d)(\d\d)(?:(\d\d))?(Z|(?:[+-]\d\d(?:\d\d)?))$')
|
||||
_utimere = re.compile(r'(\d\d)(\d\d)(\d\d)(\d\d)(?:(\d\d))?(Z|(?:[+-]\d\d(?:\d\d)?))$')
|
||||
def decode_utc_time(value):
|
||||
matches = _utimere.match(value)
|
||||
if not matches:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from utils import pycsc
|
||||
import TLV_utils, crypto_utils, utils, binascii, fnmatch, sre
|
||||
import TLV_utils, crypto_utils, utils, binascii, fnmatch, re
|
||||
from utils import C_APDU, R_APDU
|
||||
|
||||
DEBUG = True
|
||||
|
@ -254,7 +254,7 @@ class Card:
|
|||
def match_list(atr, list):
|
||||
for (knownatr, mask) in list:
|
||||
if mask is None:
|
||||
if sre.match(knownatr, binascii.hexlify(atr), sre.I):
|
||||
if re.match(knownatr, binascii.hexlify(atr), re.I):
|
||||
return True
|
||||
else:
|
||||
if len(knownatr) != len(atr):
|
||||
|
|
Loading…
Reference in New Issue