Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos found by typos application #178

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions smartcard/ATR.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)


Expand Down
2 changes: 1 addition & 1 deletion smartcard/AbstractCardRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion smartcard/CardService.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions smartcard/CardType.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion smartcard/Examples/scard-api/sample_getATR.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion smartcard/Examples/scard-api/sample_getAttrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion smartcard/Examples/scard-api/sample_listInterfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion smartcard/Examples/wx/pcscdiag/pcscdiag.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion smartcard/Exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions smartcard/pcsc/PCSCCardConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions smartcard/pcsc/PCSCPart10.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]}
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion smartcard/reader/ReaderFactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion smartcard/scard/PcscTypemaps.i
Original file line number Diff line number Diff line change
Expand Up @@ -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};


Expand Down
2 changes: 1 addition & 1 deletion smartcard/scard/gemalto.ver
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion smartcard/scard/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion smartcard/scard/pyscard-reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion smartcard/scard/scard.i
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down
4 changes: 2 additions & 2 deletions smartcard/sw/ErrorCheckingChain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion smartcard/sw/ISO7816_4ErrorChecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down
4 changes: 2 additions & 2 deletions smartcard/sw/ISO7816_8ErrorChecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@
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",
0x84: "Command chaining not supported"}),

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"}),

Expand Down
2 changes: 1 addition & 1 deletion smartcard/test/framework/testcase_Card.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)])
Expand Down
2 changes: 1 addition & 1 deletion smartcard/test/framework/testcase_ErrorChecking.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions smartcard/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion smartcard/wx/SimpleSCardApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion smartcard/wx/SimpleSCardAppFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion smartcard/wx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')):
Expand Down