diff --git a/ChangeLog b/ChangeLog index a8925e7c..655d6432 100644 --- a/ChangeLog +++ b/ChangeLog @@ -251,7 +251,7 @@ USB stick; changed the waitforcard() and waitforcardevent() to poll every 100ms for new readers and cards in these readers * following issue reported by Jarle Bauck Hamar, added samples on how to perform exclusive card connection or - protect transmit() from being interupted by another thread or process + protect transmit() from being interrupted by another thread or process * fixed ATR parsing error for optional interface bytes reported by Jarle Bauck Hamar 1.6.3 diff --git a/setup.py b/setup.py index 8db471fc..28455f55 100644 --- a/setup.py +++ b/setup.py @@ -70,7 +70,7 @@ class BuildPyBuildExtFirst(build_py): - """Workaround substitude `build_py` command for SWIG""" + """Workaround substitute `build_py` command for SWIG""" def run(self): if which("swig") is None: print("Install swig and try again") diff --git a/smartcard/ATR.py b/smartcard/ATR.py index 4b982085..d2806d80 100644 --- a/smartcard/ATR.py +++ b/smartcard/ATR.py @@ -238,7 +238,7 @@ def getGuardTime(self): return self.N def getSupportedProtocols(self): - """Returns a dictionnary of supported protocols.""" + """Returns a dictionary of supported protocols.""" protocols = {} for td in self.TD: if td is not None: @@ -297,7 +297,7 @@ def dump(self): print('nb of historical bytes: %d' % self.getHistoricalBytesCount()) def __str__(self): - """Returns a string representation of the ATR as a strem of bytes.""" + """Returns a string representation of the ATR as a stream of bytes.""" return toHexString(self.atr) diff --git a/smartcard/AbstractCardRequest.py b/smartcard/AbstractCardRequest.py index b9c6baf3..6a905d69 100644 --- a/smartcard/AbstractCardRequest.py +++ b/smartcard/AbstractCardRequest.py @@ -63,7 +63,7 @@ def __init__(self, newcardonly=False, readers=None, self.cardServiceClass = cardServiceClass self.timeout = timeout - # if no CardType requeted, use AnyCardType + # if no CardType requested, use AnyCardType if self.cardType is None: self.cardType = AnyCardType() diff --git a/smartcard/CardService.py b/smartcard/CardService.py index 7187835e..70272b08 100644 --- a/smartcard/CardService.py +++ b/smartcard/CardService.py @@ -5,7 +5,7 @@ abstract class from which concrete card services are derived. A concrete card service is almost always smart card operating system specific. -The card service performs its specific smart card functionnality by accessing +The card service performs its specific smart card functionality by accessing the smartcard with a CardConnection. __author__ = "http://www.gemalto.com" diff --git a/smartcard/CardType.py b/smartcard/CardType.py index 2c994c8c..bbb712c0 100644 --- a/smartcard/CardType.py +++ b/smartcard/CardType.py @@ -29,7 +29,7 @@ class CardType(object): """Abstract base class for CardTypes. - Known sub-classes: L{smartcard.CardType.AnyCardType} + Known subclasses: L{smartcard.CardType.AnyCardType} L{smartcard.CardType.ATRCardType}.""" def __init__(self): @@ -39,10 +39,10 @@ def __init__(self): def matches(self, atr, reader=None): """Returns true if atr and card connected match the L{CardType}. - @param atr: the atr to chek for matching + @param atr: the atr to check for matching @param reader: the reader (optional); default is None - The reader can be use in some sub-classes to do advanced + The reader can be used in some subclasses to do advanced matching that require connecting to the card.""" pass @@ -56,7 +56,7 @@ def __init__(self): def matches(self, atr, reader=None): """Always returns true, i.e. AnyCardType matches any card. - @param atr: the atr to chek for matching + @param atr: the atr to check for matching @param reader: the reader (optional); default is None""" return True @@ -83,7 +83,7 @@ def __init__(self, atr, mask=None): def matches(self, atr, reader=None): """Returns true if the atr matches the masked CardType atr. - @param atr: the atr to chek for matching + @param atr: the atr to check for matching @param reader: the reader (optional); default is None When atr is compared to the CardType ATR, matches returns true if diff --git a/smartcard/Examples/scard-api/sample_getATR.py b/smartcard/Examples/scard-api/sample_getATR.py index 41c4a630..7ca41040 100755 --- a/smartcard/Examples/scard-api/sample_getATR.py +++ b/smartcard/Examples/scard-api/sample_getATR.py @@ -49,7 +49,7 @@ print('PCSC Readers:', readers) for reader in readers: - print('Trying to retreive ATR of card in', reader) + print('Trying to retrieve ATR of card in', reader) hresult, hcard, dwActiveProtocol = SCardConnect( hcontext, diff --git a/smartcard/Examples/scard-api/sample_getAttrib.py b/smartcard/Examples/scard-api/sample_getAttrib.py index 0d2bae4b..21745d1b 100755 --- a/smartcard/Examples/scard-api/sample_getAttrib.py +++ b/smartcard/Examples/scard-api/sample_getAttrib.py @@ -111,7 +111,7 @@ def printAttribute(attrib, value): raise error('No smart card readers') for reader in readers: - print('Trying to retreive attributes of', reader) + print('Trying to retrieve attributes of', reader) hresult, hcard, dwActiveProtocol = SCardConnect( hcontext, reader, diff --git a/smartcard/Examples/scard-api/sample_listInterfaces.py b/smartcard/Examples/scard-api/sample_listInterfaces.py index 44cbb356..b7555de7 100755 --- a/smartcard/Examples/scard-api/sample_listInterfaces.py +++ b/smartcard/Examples/scard-api/sample_listInterfaces.py @@ -94,7 +94,7 @@ def main(): print('Interface for ' + znewcardName + ' :', smartcard.guid.GUIDToStr(i)) - print('Forgeting card ' + znewcardName) + print('Forgetting card ' + znewcardName) hresult = SCardForgetCardType(hcontext, znewcardName) if hresult != SCARD_S_SUCCESS: raise error( diff --git a/smartcard/Examples/wx/pcscdiag/pcscdiag.py b/smartcard/Examples/wx/pcscdiag/pcscdiag.py index 4cee8c04..7c5fa31f 100755 --- a/smartcard/Examples/wx/pcscdiag/pcscdiag.py +++ b/smartcard/Examples/wx/pcscdiag/pcscdiag.py @@ -97,7 +97,7 @@ def OnExpandAll(self): self.tree.Expand(root) def traverse(self, traverseroot, function, cookie=0): - """ recursivly walk tree control """ + """ recursively walk tree control """ if self.tree.ItemHasChildren(traverseroot): firstchild, cookie = self.tree.GetFirstChild(traverseroot) function(firstchild) diff --git a/smartcard/Exceptions.py b/smartcard/Exceptions.py index 5037ba42..1d972983 100644 --- a/smartcard/Exceptions.py +++ b/smartcard/Exceptions.py @@ -93,7 +93,7 @@ def __init__(self, mask): class InvalidReaderException(SmartcardException): - """Raised when trying to acces an invalid smartcard reader.""" + """Raised when trying to access an invalid smartcard reader.""" def __init__(self, readername): SmartcardException.__init__(self, 'Invalid reader: %s' % readername) diff --git a/smartcard/pcsc/PCSCCardConnection.py b/smartcard/pcsc/PCSCCardConnection.py index 23f5af72..2979f98e 100644 --- a/smartcard/pcsc/PCSCCardConnection.py +++ b/smartcard/pcsc/PCSCCardConnection.py @@ -128,8 +128,8 @@ def connect(self, protocol=None, mode=None, disposition=None): protocol = 0 if dwActiveProtocol == SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1: # special case for T0 | T1 - # this happen when mode=SCARD_SHARE_DIRECT and no protocol is - # then negociated with the card + # this happens when mode=SCARD_SHARE_DIRECT and no protocol is + # then negotiated with the card protocol = CardConnection.T0_protocol | CardConnection.T1_protocol else: for p in dictProtocol: @@ -178,8 +178,8 @@ def reconnect(self, protocol=None, mode=None, disposition=None): protocol = 0 if dwActiveProtocol == SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1: # special case for T0 | T1 - # this happen when mode=SCARD_SHARE_DIRECT and no protocol is - # then negociated with the card + # this happens when mode=SCARD_SHARE_DIRECT and no protocol is + # then negotiated with the card protocol = CardConnection.T0_protocol | CardConnection.T1_protocol else: for p in dictProtocol: diff --git a/smartcard/pcsc/PCSCPart10.py b/smartcard/pcsc/PCSCPart10.py index 1c1448f5..36282dc9 100644 --- a/smartcard/pcsc/PCSCPart10.py +++ b/smartcard/pcsc/PCSCPart10.py @@ -110,7 +110,7 @@ def parseFeatureRequest(response): """ Get the list of Part10 features supported by the reader. - @param response: result of L{CM_IOCTL_GET_FEATURE_REQUEST} commmand + @param response: result of L{CM_IOCTL_GET_FEATURE_REQUEST} command @rtype: list @return: a list of list C{[[tag1, value1], [tag2, value2]]} @@ -236,7 +236,7 @@ def parseTlvProperties(response): # 32 bits value data = ((data[3] * 256 + data[2]) * 256 + data[1]) * 256 + data[0] - # store the value in the dictionnary + # store the value in the dictionary try: d[Properties[tag]] = data except KeyError: diff --git a/smartcard/reader/ReaderFactory.py b/smartcard/reader/ReaderFactory.py index db74088e..39f55ac3 100644 --- a/smartcard/reader/ReaderFactory.py +++ b/smartcard/reader/ReaderFactory.py @@ -6,7 +6,7 @@ Thinking in Python, Bruce Eckel, http://mindview.net/Books/TIPython -The code to instanciate the reader Factory() has +The code to instantiate the reader Factory() has been updated to dynamically load the module with Robert Brewer ClassLoader.py. diff --git a/smartcard/scard/PcscTypemaps.i b/smartcard/scard/PcscTypemaps.i index faa081bd..101bb0df 100644 --- a/smartcard/scard/PcscTypemaps.i +++ b/smartcard/scard/PcscTypemaps.i @@ -292,7 +292,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA //%typemap(argout) READERSTATELIST *BOTH = READERSTATELIST *prsl; -// other names for READERSTATELIST as inpu/output parameter +// other names for READERSTATELIST as input/output parameter %apply READERSTATELIST *BOTH {READERSTATELIST* prsl}; diff --git a/smartcard/scard/gemalto.ver b/smartcard/scard/gemalto.ver index 9969407c..cfd31138 100644 --- a/smartcard/scard/gemalto.ver +++ b/smartcard/scard/gemalto.ver @@ -12,7 +12,7 @@ #endif #ifndef VER_PRODUCTNAME_STR -#define VER_PRODUCTNAME_STR "Smart Cards Sofware Development Tools" +#define VER_PRODUCTNAME_STR "Smart Cards Software Development Tools" #endif /* VER_PRODUCTVERSION and VER_PRODUCTVERSION_STR are provided by setup.py */ diff --git a/smartcard/scard/makefile b/smartcard/scard/makefile index b8efe7db..59548757 100644 --- a/smartcard/scard/makefile +++ b/smartcard/scard/makefile @@ -36,7 +36,7 @@ linker_flags = /DLL /nologo /INCREMENTAL:no /LIBPATH:$(pythondir)\libs /LIBPATH: # final target all: $(pythonpackagedir)\_scard.pyd $(pythonpackagedir)\_scard_d.pyd -# depedencies +# dependencies $(pythonpackagedir)\_scard.pyd : obj\_scard.pyd if exist obj\_scard.pyd copy obj\_scard.pyd $(pythonpackagedir)\_scard.pyd diff --git a/smartcard/scard/pyscard-reader.h b/smartcard/scard/pyscard-reader.h index e03a5b3a..f9a15837 100644 --- a/smartcard/scard/pyscard-reader.h +++ b/smartcard/scard/pyscard-reader.h @@ -2,7 +2,7 @@ This file contains SCARD_ATTR attributes definitions taken from reader.h, in MUSCLE SmartCard Development ( http://www.linuxnet.com ). It allows to build pyscard on Mac OS X without any dependency on the -muscle source code. Indeed, default Mac OS X does not containt reader.h +muscle source code. Indeed, default Mac OS X does not contain reader.h as part of the PCSC.framework. Copyright (C) 1999-2005 David Corcoran diff --git a/smartcard/scard/scard.i b/smartcard/scard/scard.i index 0ec200ac..23aab89f 100644 --- a/smartcard/scard/scard.i +++ b/smartcard/scard/scard.i @@ -1836,7 +1836,7 @@ SCARDRETCODE _Reconnect( /////////////////////////////////////////////////////////////////////////////// %define DOCSTRING_RELEASECONTEXT " -Release a PC/SC context estabished by L{SCardEstablishContext()}. +Release a PC/SC context established by L{SCardEstablishContext()}. >>> from smartcard.scard import * >>> from smartcard.pcsc import * diff --git a/smartcard/sw/ErrorCheckingChain.py b/smartcard/sw/ErrorCheckingChain.py index 90a5f876..edfc2b9d 100644 --- a/smartcard/sw/ErrorCheckingChain.py +++ b/smartcard/sw/ErrorCheckingChain.py @@ -59,7 +59,7 @@ def addFilterException(self, exClass): @param exClass: the exception to exclude, e.g. L{smartcard.sw.SWExceptions.WarningProcessingException} A filtered exception will not be raised when the sw1,sw2 conditions that - would raise the excption are met. + would raise the exception are met. """ self.excludes.append(exClass) @@ -77,7 +77,7 @@ def __call__(self, data, sw1, sw2): try: self.strategy(data, sw1, sw2) except tuple(self.excludes) as exc: - # The following addtional filter may look redundant, it isn't. + # The following additional filter may look redundant, it isn't. # It checks that type(exc) is *equal* to any of self.excludes, # rather than equal-or-subclass to any of self.excludes. # This maintains backward compatibility with the behaviour of diff --git a/smartcard/sw/ISO7816_4ErrorChecker.py b/smartcard/sw/ISO7816_4ErrorChecker.py index 16ea8254..0020a73e 100644 --- a/smartcard/sw/ISO7816_4ErrorChecker.py +++ b/smartcard/sw/ISO7816_4ErrorChecker.py @@ -67,7 +67,7 @@ 0x69: (smartcard.sw.SWExceptions.CheckingErrorException, {0x81: "Command incompatible with file structure.", 0x82: "Security status not satisfied", - 0x83: "Authentification method blocked", + 0x83: "Authentication method blocked", 0x84: "Referenced data invalid", 0x85: "Conditions of use not satisfied", 0x86: "Command not allowed (no current EF)", diff --git a/smartcard/sw/ISO7816_8ErrorChecker.py b/smartcard/sw/ISO7816_8ErrorChecker.py index 2cf9650c..f75a5d86 100644 --- a/smartcard/sw/ISO7816_8ErrorChecker.py +++ b/smartcard/sw/ISO7816_8ErrorChecker.py @@ -54,7 +54,7 @@ 0x88: "SM data objects incorrect"}), 0x67: (smartcard.sw.SWExceptions.CheckingErrorException, - {0x00: "Wrong length (emtpy Lc field)"}), + {0x00: "Wrong length (empty Lc field)"}), 0x68: (smartcard.sw.SWExceptions.CheckingErrorException, {0x83: "Final command expected", @@ -62,7 +62,7 @@ 0x69: (smartcard.sw.SWExceptions.CheckingErrorException, {0x82: "Security status not satisfied", - 0x83: "Authentification method blocked", + 0x83: "Authentication method blocked", 0x84: "Referenced data invalidated", 0x85: "Conditions of use not satisfied"}), diff --git a/smartcard/test/framework/testcase_Card.py b/smartcard/test/framework/testcase_Card.py index e329c1bb..d7d91d11 100755 --- a/smartcard/test/framework/testcase_Card.py +++ b/smartcard/test/framework/testcase_Card.py @@ -53,7 +53,7 @@ class testcase_Card(unittest.TestCase): """Test case for smartcard.Card.""" def testcase_CardDictionary(self): - """Create a dictionnary with Card keys""" + """Create a dictionary with Card keys""" mydict = {} for reader in readers(): card = Card(reader, expectedATRinReader[str(reader)]) diff --git a/smartcard/test/framework/testcase_ErrorChecking.py b/smartcard/test/framework/testcase_ErrorChecking.py index da493bca..325d9cdc 100755 --- a/smartcard/test/framework/testcase_ErrorChecking.py +++ b/smartcard/test/framework/testcase_ErrorChecking.py @@ -81,7 +81,7 @@ class testcase_ErrorChecking(unittest.TestCase): """Test case for smartcard.sw.* error checking.""" def failUnlessRaises(self, excClass, callableObj, *args, **kwargs): - """override of unittest.TestCase.failUnlesRaises so that we return the + """override of unittest.TestCase.failUnlessRaises so that we return the exception object for testing fields.""" try: callableObj(*args, **kwargs) diff --git a/smartcard/util/__init__.py b/smartcard/util/__init__.py index d6f3fcca..d9a7c956 100644 --- a/smartcard/util/__init__.py +++ b/smartcard/util/__init__.py @@ -145,8 +145,8 @@ def toBytes(bytestring): 'ä': 0x7B, # ä minuscule a trema 'Ö': 0x5C, # Ö majuscule O trema 'ö': 0x7C, # ö minuscule o trema - 'Ñ': 0x5D, # Ñ majuscule N tilda espagnol - 'ñ': 0x7D, # ñ minuscule n tilda espagnol + 'Ñ': 0x5D, # Ñ majuscule N tilde espagnol + 'ñ': 0x7D, # ñ minuscule n tilde espagnol 'Ü': 0x5E, # Ü majuscule U trema 'ü': 0x7E, # ü minuscule u trema '§': 0x5F, # § signe paragraphe diff --git a/smartcard/wx/SimpleSCardApp.py b/smartcard/wx/SimpleSCardApp.py index 12f340d2..839a99e6 100644 --- a/smartcard/wx/SimpleSCardApp.py +++ b/smartcard/wx/SimpleSCardApp.py @@ -57,7 +57,7 @@ def __init__(self, - TB_SMARTCARD: display a reader toolbar - PANEL_APDUTRACER: display an APDU tracer panel - default is TR_DEFAULT = TR_SMARTCARD - @param pos: the application position as a (x,y) tupple; default is (-1,-1) + @param pos: the application position as a (x,y) tuple; default is (-1,-1) @param size: the application window size as a (x,y) tuple; default is (-1,-1) Example: diff --git a/smartcard/wx/SimpleSCardAppFrame.py b/smartcard/wx/SimpleSCardAppFrame.py index eab26204..f91003c3 100644 --- a/smartcard/wx/SimpleSCardAppFrame.py +++ b/smartcard/wx/SimpleSCardAppFrame.py @@ -274,7 +274,7 @@ def __init__(self, - TB_SMARTCARD: display a reader toolbar - PANEL_APDUTRACER: display an APDU tracer panel - default is TR_DEFAULT = TR_SMARTCARD - @param pos: the application position as a (x,y) tupple; default is (-1,-1) + @param pos: the application position as a (x,y) tuple; default is (-1,-1) @param size: the application window size as a (x,y) tuple; default is (-1,-1) """ wx.Frame.__init__(self, diff --git a/smartcard/wx/__init__.py b/smartcard/wx/__init__.py index 5c57f466..b4e2c93d 100644 --- a/smartcard/wx/__init__.py +++ b/smartcard/wx/__init__.py @@ -45,7 +45,7 @@ def main_is_frozen(): 'resources', 'reader.ico') -# runing from a standalone exe built with py2exe +# running from a standalone exe built with py2exe # resources expected images directory else: if os.path.exists(os.path.join("images", 'smartcard.ico')):