diff --git a/smartcard/pyro/server/PyroDaemon.py b/smartcard/pyro/server/PyroDaemon.py index 89b5d1ae..90eac204 100644 --- a/smartcard/pyro/server/PyroDaemon.py +++ b/smartcard/pyro/server/PyroDaemon.py @@ -85,8 +85,8 @@ def __init__(self): Thread.__init__(self) self.setDaemon(True) self.setName('smartcard.pyro.server.PyroDaemonThread') - self.daemon = PyroDaemon() + self._daemon = PyroDaemon() def run(self): """Starts Pyro daemon.""" - self.daemon.start() + self._daemon.start() diff --git a/smartcard/util/__init__.py b/smartcard/util/__init__.py index 873a9ceb..463563a1 100644 --- a/smartcard/util/__init__.py +++ b/smartcard/util/__init__.py @@ -99,7 +99,7 @@ def toBytes(bytestring): """ from struct import unpack import re - packedstring = ''.join(re.split('\W+', bytestring)) + packedstring = ''.join(re.split(r'\W+', bytestring)) try: return reduce(lambda x, y: x + [int(y, 16)], unpack('2s' * (len(packedstring) / 2), @@ -204,9 +204,6 @@ def toHexString(bytes=[], format=0): from string import rstrip - for byte in tuple(bytes): - pass - if type(bytes) is not list: raise TypeError('not a list of bytes') diff --git a/smartcard/wx/APDUHexValidator.py b/smartcard/wx/APDUHexValidator.py index dd090ddf..4e16ceb6 100644 --- a/smartcard/wx/APDUHexValidator.py +++ b/smartcard/wx/APDUHexValidator.py @@ -48,7 +48,7 @@ def Clone(self): def Validate(self, win): tc = self.GetWindow() - val = tc.GetValue() + value = tc.GetValue() if not apduregexp.match(value): return False diff --git a/smartcard/wx/CardAndReaderTreePanel.py b/smartcard/wx/CardAndReaderTreePanel.py index 0841ec1d..8106ef9f 100644 --- a/smartcard/wx/CardAndReaderTreePanel.py +++ b/smartcard/wx/CardAndReaderTreePanel.py @@ -408,9 +408,9 @@ def __init__(self, parent, appstyle, clientpanel): def OnDestroy(self, event): """Called on panel destruction.""" # deregister observers - if hasattr(self, cardmonitor): + if hasattr(self, 'cardmonitor'): self.cardmonitor.deleteObserver(self.cardtreecardobserver) - if hasattr(self, readermonitor): + if hasattr(self, 'readermonitor'): self.readermonitor.deleteObserver(self.readertreereaderobserver) self.cardmonitor.deleteObserver(self.readertreecardobserver) event.Skip() diff --git a/smartcard/wx/ReaderToolbar.py b/smartcard/wx/ReaderToolbar.py index 946dfab0..fd353be8 100644 --- a/smartcard/wx/ReaderToolbar.py +++ b/smartcard/wx/ReaderToolbar.py @@ -77,12 +77,12 @@ def __init__(self, parent): bmpReader = wx.Bitmap(ICO_READER, wx.BITMAP_TYPE_ICO) else: bmpReader = wx.ArtProvider_GetBitmap( - wx.ART_HELP_BOOK, wx.ART_OTHER, isz) + wx.ART_HELP_BOOK, wx.ART_OTHER, tsize) if None != ICO_SMARTCARD: bmpCard = wx.Bitmap(ICO_SMARTCARD, wx.BITMAP_TYPE_ICO) else: bmpCard = wx.ArtProvider_GetBitmap( - wx.ART_HELP_BOOK, wx.ART_OTHER, isz) + wx.ART_HELP_BOOK, wx.ART_OTHER, tsize) self.readercombobox = ReaderComboBox(self) # create and add controls