Skip to content

Commit

Permalink
Merge pull request #6 from moreati/import-cleanups
Browse files Browse the repository at this point in the history
Fix import errors and warnings detected by pylint
  • Loading branch information
LudovicRousseau committed Jul 7, 2015
2 parents dac66dc + bd7000d commit 0d7f94c
Show file tree
Hide file tree
Showing 18 changed files with 9 additions and 36 deletions.
1 change: 0 additions & 1 deletion smartcard/Card.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
along with pyscard; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""
from smartcard.Exceptions import CardConnectionException, NoCardException
from smartcard.reader.Reader import Reader
from smartcard.System import readers
from smartcard.util import toHexString
Expand Down
2 changes: 0 additions & 2 deletions smartcard/CardConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
"""

from smartcard.CardConnectionEvent import CardConnectionEvent
from smartcard.Exceptions import SmartcardException
from smartcard.Observer import Observer
from smartcard.Observer import Observable


Expand Down
4 changes: 0 additions & 4 deletions smartcard/CardMonitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@
from time import sleep
import traceback

from smartcard.System import readers
from smartcard.Exceptions import CardRequestTimeoutException
from smartcard.Observer import Observer
from smartcard.Observer import Observable

from smartcard.CardType import AnyCardType
from smartcard.CardRequest import CardRequest

_START_ON_DEMAND_ = False
Expand Down Expand Up @@ -219,7 +216,6 @@ def __getattr__(self, name):


if __name__ == "__main__":
from smartcard.CardMonitoring import CardMonitor
print('insert or remove cards in the next 10 seconds')

# a simple card observer that prints added/removed cards
Expand Down
1 change: 0 additions & 1 deletion smartcard/CardService.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"""

from __future__ import print_function
from smartcard.Exceptions import SmartcardException
from smartcard.scard import *


Expand Down
1 change: 1 addition & 0 deletions smartcard/CardType.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""
from __future__ import print_function
from smartcard.Exceptions import InvalidATRMaskLengthException
from smartcard.System import readers
from smartcard.util import toHexString

Expand Down
4 changes: 0 additions & 4 deletions smartcard/ClassLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
License: PSF license (http:https://docs.python.org/license.html).
"""

import sys
import types


def get_mod(modulePath):
"""Import a module."""
return __import__(modulePath, globals(), locals(), [''])
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 @@ -35,7 +35,7 @@
# wxPython GUI modules (http:https://www.wxpython.org)
try:
import wx
except:
except ImportError:
print('You need wxpython (http:https://www.wxpython.org) ' + \
'to run this sample from the source code!')
print('press a key to continue')
Expand Down
1 change: 0 additions & 1 deletion smartcard/ExclusiveConnectCardConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""
from __future__ import print_function
from smartcard.CardConnection import CardConnection
from smartcard.CardConnectionDecorator import CardConnectionDecorator
from smartcard.Exceptions import CardConnectionException
from smartcard.scard import SCardConnect, SCardDisconnect
Expand Down
2 changes: 0 additions & 2 deletions smartcard/ExclusiveTransmitCardConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""
from __future__ import print_function
from smartcard.CardConnection import CardConnection
from smartcard.CardConnectionDecorator import CardConnectionDecorator
from smartcard.Exceptions import CardConnectionException
from smartcard.scard import SCardBeginTransaction, SCardEndTransaction
from smartcard.scard import SCARD_LEAVE_CARD
from smartcard.scard import SCardGetErrorMessage
from smartcard.pcsc import PCSCCardConnection
import smartcard.pcsc


Expand Down
1 change: 0 additions & 1 deletion smartcard/PassThruCardService.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def supports(cardname):
SELECT = [0xA0, 0xA4, 0x00, 0x00, 0x02]
DF_TELECOM = [0x7F, 0x10]
from smartcard.System import readers
from smartcard.CardConnection import CardConnection
cc = readers()[0].createConnection()
cs = PassThruCardService(cc)
cs.connection.connect()
Expand Down
4 changes: 1 addition & 3 deletions smartcard/ReaderMonitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@
"""

from __future__ import print_function
from threading import Thread, Event, enumerate
from threading import Thread, Event
from time import sleep
import traceback

import smartcard.System
from smartcard.Exceptions import ListReadersException
from smartcard.Observer import Observer
from smartcard.Observer import Observable
from smartcard.Synchronization import *
Expand Down Expand Up @@ -204,7 +203,6 @@ def stop(self):
self.join()

if __name__ == "__main__":
from smartcard.ReaderMonitoring import ReaderMonitor
print('insert or remove readers in the next 20 seconds')

# a simple reader observer that prints added/removed readers
Expand Down
1 change: 0 additions & 1 deletion smartcard/Session.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

from __future__ import print_function
from smartcard.Exceptions import InvalidReaderException, NoReadersException
from smartcard.CardConnection import CardConnection
from smartcard.PassThruCardService import PassThruCardService
from smartcard.System import readers

Expand Down
1 change: 0 additions & 1 deletion smartcard/pcsc/PCSCCardConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from smartcard.CardConnection import CardConnection
from smartcard.Exceptions import (CardConnectionException,
NoCardException, SmartcardException)
from smartcard.Observer import Observable

from smartcard.scard import *

Expand Down
3 changes: 1 addition & 2 deletions smartcard/pyro/PyroReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
import Pyro.core
import Pyro.naming

from smartcard.Exceptions import CardConnectionException, NoCardException
from smartcard.Exceptions import NoCardException
from smartcard.reader.Reader import Reader
from smartcard.reader.ReaderFactory import ReaderFactory


class PyroReader(Reader):
Expand Down
1 change: 0 additions & 1 deletion smartcard/pyro/server/PyroEventServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ def __call__(self, signame, sf):


if __name__ == '__main__':
import sys
from smartcard.pyro.server.PyroNameServer import PyroNameServer
pn = PyroNameServer(sys.argv[1:])
pn.start()
Expand Down
3 changes: 0 additions & 3 deletions smartcard/pyro/server/RemoteCardConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
import Pyro.core
import Pyro.naming

from smartcard.CardConnection import CardConnection
from smartcard.CardConnectionDecorator import CardConnectionDecorator
from smartcard.Exceptions import CardConnectionException, NoCardException
from smartcard.Observer import Observable


class RemoteCardConnection(CardConnectionDecorator, Pyro.core.ObjBase):
Expand Down
6 changes: 1 addition & 5 deletions smartcard/pyro/server/RemoteReaderServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,12 @@
try:
import Pyro.core
import Pyro.naming
except:
except ImportError:
print('You need pyro (python remote objects) ' + \
'at http:https://www.xs4all.nl/~irmen/pyro3/')
import sys
sys.exit()

import signal
import time

import smartcard.System
from smartcard.reader.Reader import Reader
from smartcard.ReaderMonitoring import ReaderMonitor, ReaderObserver
from smartcard.pyro.server.RemoteCardConnection import RemoteCardConnection
Expand Down
7 changes: 4 additions & 3 deletions smartcard/wx/SimpleSCardAppFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@

import os.path
import wx

import smartcard.wx
import APDUTracerPanel
import CardAndReaderTreePanel
import ReaderToolbar
from smartcard.wx import APDUTracerPanel
from smartcard.wx import CardAndReaderTreePanel
from smartcard.wx import ReaderToolbar

import smartcard
from smartcard.wx.SimpleSCardAppEventObserver import \
Expand Down

0 comments on commit 0d7f94c

Please sign in to comment.