1 """Smart card Reader abstract class.
2
3 __author__ = "gemalto http://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
27 """Reader abstract class.
28
29 The reader class is responsible for creating connections
30 with a card.
31
32 Known subclasses: PCSCReader
33 """
34
36 """Constructs a new reader and store readername."""
37 self.name = readername
38
40 """Add reader to a reader group."""
41 pass
42
44 """Remove reader from a reader group."""
45 pass
46
48 """Returns a card connection thru reader."""
49 pass
50
52 """Returns True if self==other (same name)."""
53 if type(other) == type(self):
54 return self.name == other.name
55 else:
56 return False
57
59 """Returns a hash value for this object (self.name is unique)."""
60 return hash(self.name)
61
63 """Returns card reader name string for `object` calls."""
64 return "'%s'" % self.name
65
67 """Returns card reader name string for str(object) calls."""
68 return self.name
69