• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LudovicRousseau / pyscard / 16621389771

30 Jul 2025 11:33AM UTC coverage: 66.181% (+0.1%) from 66.048%
16621389771

push

github

LudovicRousseau
Release 2.3.0

Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>

108 of 485 branches covered (22.27%)

4452 of 6727 relevant lines covered (66.18%)

4.77 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

56.25
/src/smartcard/reader/Reader.py
1
"""Smart card Reader abstract class.
2

3
__author__ = "gemalto https://www.gemalto.com/"
4

5
Copyright 2001-2012 gemalto
6
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com
7

8
This file is part of pyscard.
9

10
pyscard is free software; you can redistribute it and/or modify
11
it under the terms of the GNU Lesser General Public License as published by
12
the Free Software Foundation; either version 2.1 of the License, or
13
(at your option) any later version.
14

15
pyscard is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
GNU Lesser General Public License for more details.
19

20
You should have received a copy of the GNU Lesser General Public License
21
along with pyscard; if not, write to the Free Software
22
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
23
"""
24

25

26
class Reader:
20✔
27
    """Reader abstract class.
28

29
    The reader class is responsible for creating connections
30
    with a card.
31
    """
32

33
    def __init__(self, readername):
20✔
34
        """Constructs a new reader and store readername."""
35
        self.name = readername
×
36

37
    def addtoreadergroup(self, groupname):
20✔
38
        """Add reader to a reader group."""
39

40
    def removefromreadergroup(self, groupname):
20✔
41
        """Remove reader from a reader group."""
42

43
    def createConnection(self):
20✔
44
        """Returns a card connection thru reader."""
45

46
    def __eq__(self, other):
20✔
47
        """Returns True if self==other (same name)."""
48
        if isinstance(other, type(self)):
×
49
            return self.name == other.name
×
50

51
        return False
×
52

53
    def __hash__(self):
20✔
54
        """Returns a hash value for this object (self.name is unique)."""
55
        return hash(self.name)
×
56

57
    def __repr__(self):
20✔
58
        """Returns card reader name string for `object` calls."""
59
        return f"'{self.name}'"
×
60

61
    def __str__(self):
20✔
62
        """Returns card reader name string for str(object) calls."""
63
        return self.name
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc