1 """ReaderGroups manages smart card reader in groups.
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 from __future__ import print_function
26 from smartcard.Exceptions import SmartcardException
27 from smartcard.ulist import ulist
28
29
31 """Raised when trying to add an invalid reader group."""
32
35
36
38 """Raised when trying to delete SCard$DefaultReaders reader group."""
39
43
44
46 """Smartcard readers groups private class.
47
48 The readergroups singleton manages the creation of the unique
49 instance of this class.
50 """
51
53 """Retrieve and store list of reader groups"""
54 if None == initlist:
55 initlist = self.getreadergroups()
56 if None != initlist:
57 ulist.__init__(self, initlist)
58 self.unremovablegroups = []
59
61 """Called when a reader group is added."""
62 self.addreadergroup(item)
63
67
70
72 return ulist.__next__(self)
73
74
75
76
77
79 """Returns the list of smartcard reader groups."""
80 return []
81
83 """Add a reader group"""
84 if not isinstance(newgroup, type("")):
85 raise BadReaderGroupException
86 self += newgroup
87
93
95 """Add a reader to a reader group"""
96 pass
97
99 """Remove a reader from a reader group"""
100 pass
101
102
104 """ReadersGroups organizes smart card reader as groups."""
105
106 """The single instance of __readergroups"""
107 instance = None
108 innerclazz = innerreadergroups
109
114
115 """All operators redirected to inner class."""
116
119
120
121 if __name__ == '__main__':
122 print(readergroups())
123