From: <lu...@us...> - 2009-06-12 09:55:54
|
Revision: 289 http://pyscard.svn.sourceforge.net/pyscard/?rev=289&view=rev Author: ludov Date: 2009-06-12 09:55:47 +0000 (Fri, 12 Jun 2009) Log Message: ----------- stress test parseATR with the ilist of known ATRs Added Paths: ----------- trunk/contrib/parseATR/stress_test.py Added: trunk/contrib/parseATR/stress_test.py =================================================================== --- trunk/contrib/parseATR/stress_test.py (rev 0) +++ trunk/contrib/parseATR/stress_test.py 2009-06-12 09:55:47 UTC (rev 289) @@ -0,0 +1,40 @@ +#! /usr/bin/env python +""" + stress_test.py + Copyright (C) 2009 Ludovic Rousseau + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +""" + +import sys, string +import parseATR + +List = "/usr/local/share/pcsc/smartcard_list.txt" + +if __name__ == "__main__": + if len(sys.argv) > 1: + List = sys.argv[1] + + for atr in open(List): + if atr[0] != "3": + continue + if "[" in atr: + continue + if "." in atr: + continue + if "?" in atr: + continue + print atr + parseATR.atr_display_txt(parseATR.parseATR(atr)) Property changes on: trunk/contrib/parseATR/stress_test.py ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-07-29 21:22:54
|
Revision: 312 http://pyscard.svn.sourceforge.net/pyscard/?rev=312&view=rev Author: ludov Date: 2009-07-29 21:22:44 +0000 (Wed, 29 Jul 2009) Log Message: ----------- catch exception Modified Paths: -------------- trunk/contrib/parseATR/stress_test.py Modified: trunk/contrib/parseATR/stress_test.py =================================================================== --- trunk/contrib/parseATR/stress_test.py 2009-07-29 21:21:49 UTC (rev 311) +++ trunk/contrib/parseATR/stress_test.py 2009-07-29 21:22:44 UTC (rev 312) @@ -36,5 +36,16 @@ continue if "?" in atr: continue - print atr - parseATR.atr_display_txt(parseATR.parseATR(atr)) + + # remove traling newline + atr = atr.rstrip() + print "ATR:", atr + + try: + txt = parseATR.atr_display_txt(parseATR.parseATR(atr)) + except parseATR.ParseAtrException, e: + print e + else: + print txt + + print This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-03-17 19:32:23
|
Revision: 385 http://pyscard.svn.sourceforge.net/pyscard/?rev=385&view=rev Author: ludov Date: 2010-03-17 19:32:16 +0000 (Wed, 17 Mar 2010) Log Message: ----------- Do not ignore '.' in ATR and replace it by '0' Modified Paths: -------------- trunk/contrib/parseATR/stress_test.py Modified: trunk/contrib/parseATR/stress_test.py =================================================================== --- trunk/contrib/parseATR/stress_test.py 2010-03-17 17:29:34 UTC (rev 384) +++ trunk/contrib/parseATR/stress_test.py 2010-03-17 19:32:16 UTC (rev 385) @@ -1,7 +1,7 @@ #! /usr/bin/env python """ stress_test.py - Copyright (C) 2009 Ludovic Rousseau + Copyright (C) 2009-2010 Ludovic Rousseau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,15 +29,13 @@ List = sys.argv[1] for atr in open(List): - if atr[0] != "3": + if not atr.startswith("3"): continue if "[" in atr: continue - if "." in atr: - continue - if "?" in atr: - continue + atr = atr.replace('.', '0') + # remove traling newline atr = atr.rstrip() print "ATR:", atr This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-03-17 19:34:43
|
Revision: 386 http://pyscard.svn.sourceforge.net/pyscard/?rev=386&view=rev Author: ludov Date: 2010-03-17 19:34:37 +0000 (Wed, 17 Mar 2010) Log Message: ----------- also use parseATR.match_atr() to find a card description Modified Paths: -------------- trunk/contrib/parseATR/stress_test.py Modified: trunk/contrib/parseATR/stress_test.py =================================================================== --- trunk/contrib/parseATR/stress_test.py 2010-03-17 19:32:16 UTC (rev 385) +++ trunk/contrib/parseATR/stress_test.py 2010-03-17 19:34:37 UTC (rev 386) @@ -46,5 +46,10 @@ print e else: print txt + card = parseATR.match_atr(atr) + if card: + print "Possibly identified card:", "\n\t".join(card) + else: + print "Unknown card" print This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-05-15 11:53:00
|
Revision: 407 http://pyscard.svn.sourceforge.net/pyscard/?rev=407&view=rev Author: ludov Date: 2010-05-15 11:52:54 +0000 (Sat, 15 May 2010) Log Message: ----------- create a function Modified Paths: -------------- trunk/contrib/parseATR/stress_test.py Modified: trunk/contrib/parseATR/stress_test.py =================================================================== --- trunk/contrib/parseATR/stress_test.py 2010-05-07 16:17:12 UTC (rev 406) +++ trunk/contrib/parseATR/stress_test.py 2010-05-15 11:52:54 UTC (rev 407) @@ -24,11 +24,9 @@ List = "/usr/local/share/pcsc/smartcard_list.txt" -if __name__ == "__main__": - if len(sys.argv) > 1: - List = sys.argv[1] - for atr in open(List): +def stress(atr_list): + for atr in open(atr_list): if not atr.startswith("3"): continue if "[" in atr: @@ -53,3 +51,9 @@ print "Unknown card" print + +if __name__ == "__main__": + if len(sys.argv) > 1: + List = sys.argv[1] + + stress(List) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-05-15 11:53:27
|
Revision: 408 http://pyscard.svn.sourceforge.net/pyscard/?rev=408&view=rev Author: ludov Date: 2010-05-15 11:53:21 +0000 (Sat, 15 May 2010) Log Message: ----------- remove useless import string Modified Paths: -------------- trunk/contrib/parseATR/stress_test.py Modified: trunk/contrib/parseATR/stress_test.py =================================================================== --- trunk/contrib/parseATR/stress_test.py 2010-05-15 11:52:54 UTC (rev 407) +++ trunk/contrib/parseATR/stress_test.py 2010-05-15 11:53:21 UTC (rev 408) @@ -19,7 +19,6 @@ """ import sys -import string import parseATR List = "/usr/local/share/pcsc/smartcard_list.txt" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-05-15 12:02:12
|
Revision: 409 http://pyscard.svn.sourceforge.net/pyscard/?rev=409&view=rev Author: ludov Date: 2010-05-15 12:02:06 +0000 (Sat, 15 May 2010) Log Message: ----------- replace '*' by '0' in the ATR regular expression Modified Paths: -------------- trunk/contrib/parseATR/stress_test.py Modified: trunk/contrib/parseATR/stress_test.py =================================================================== --- trunk/contrib/parseATR/stress_test.py 2010-05-15 11:53:21 UTC (rev 408) +++ trunk/contrib/parseATR/stress_test.py 2010-05-15 12:02:06 UTC (rev 409) @@ -32,6 +32,7 @@ continue atr = atr.replace('.', '0') + atr = atr.replace('*', '0') # remove traling newline atr = atr.rstrip() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-05-15 12:15:17
|
Revision: 410 http://pyscard.svn.sourceforge.net/pyscard/?rev=410&view=rev Author: ludov Date: 2010-05-15 12:15:08 +0000 (Sat, 15 May 2010) Log Message: ----------- Do not try to match the card ATR with a name. The regular expression code is too slow. Modified Paths: -------------- trunk/contrib/parseATR/stress_test.py Modified: trunk/contrib/parseATR/stress_test.py =================================================================== --- trunk/contrib/parseATR/stress_test.py 2010-05-15 12:02:06 UTC (rev 409) +++ trunk/contrib/parseATR/stress_test.py 2010-05-15 12:15:08 UTC (rev 410) @@ -22,6 +22,7 @@ import parseATR List = "/usr/local/share/pcsc/smartcard_list.txt" +Match = 0 def stress(atr_list): @@ -44,11 +45,12 @@ print e else: print txt - card = parseATR.match_atr(atr) - if card: - print "Possibly identified card:", "\n\t".join(card) - else: - print "Unknown card" + if Match: + card = parseATR.match_atr(atr) + if card: + print "Possibly identified card:", "\n\t".join(card) + else: + print "Unknown card" print This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2010-05-15 12:56:07
|
Revision: 412 http://pyscard.svn.sourceforge.net/pyscard/?rev=412&view=rev Author: ludov Date: 2010-05-15 12:55:59 +0000 (Sat, 15 May 2010) Log Message: ----------- Revert change from revision 410 now that the card name matching is fast enough Revision Links: -------------- http://pyscard.svn.sourceforge.net/pyscard/?rev=410&view=rev Modified Paths: -------------- trunk/contrib/parseATR/stress_test.py Modified: trunk/contrib/parseATR/stress_test.py =================================================================== --- trunk/contrib/parseATR/stress_test.py 2010-05-15 12:53:38 UTC (rev 411) +++ trunk/contrib/parseATR/stress_test.py 2010-05-15 12:55:59 UTC (rev 412) @@ -22,7 +22,6 @@ import parseATR List = "/usr/local/share/pcsc/smartcard_list.txt" -Match = 0 def stress(atr_list): @@ -45,12 +44,11 @@ print e else: print txt - if Match: - card = parseATR.match_atr(atr) - if card: - print "Possibly identified card:", "\n\t".join(card) - else: - print "Unknown card" + card = parseATR.match_atr(atr) + if card: + print "Possibly identified card:", "\n\t".join(card) + else: + print "Unknown card" print This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |