+
     h  c                   sb    R t ^ RIHt ^ RIHt  ! R R]4      t ! R R]4      t ! R R4      tR	# )
a  ReaderGroups manages smart card reader in groups.

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

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

This file is part of pyscard.

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

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

You should have received a copy of the GNU Lesser General Public License
along with pyscard; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
)SmartcardException)ulistc                   s*   a  ] tR t^t o RtR tRtV tR# )BadReaderGroupExceptionz2Raised when trying to add an invalid reader group.c                s4    \         P                  ! V R 4       R# )zInvalid reader groupN)r    __init__self   &D/usr/lib64/python3.14/site-packages/smartcard/reader/ReaderGroups.pyr   Z BadReaderGroupException.__init__    s    ##D*@A     N)__name__
__module____qualname____firstlineno____doc__r   __static_attributes____classdictcell__Z__classdict__   @r   r   r      s     <B Br   r   c                   s^   a  ] tR t^$t o RtRR ltR tR tR tR t	R t
R	 tR
 tR tRtV tR# )innerreadergroupszSmartcard readers groups private class.

The readergroups singleton manages the creation of the unique
instance of this class.
Nc                s|    Vf   V P                  4       ;'       g    . p\        P                  ! W4       . V n        R# )z(Retrieve and store list of reader groupsN)getreadergroupsr   r   unremovablegroupsr   Zinitlist   &&r   r   Zinnerreadergroups.__init__+   s2    ++-33Ht&!#r   c                (    V P                  V4       R# z$Called when a reader group is added.N)addreadergroupr   Zitemr   r   __onadditem__Zinnerreadergroups.__onadditem__2   s    D!r   c                r   r   )removereadergroupr   r   r   __onremoveitem__Z"innerreadergroups.__onremoveitem__6   s    t$r   c                s.    \         P                  ! V 4      # N)r   __iter__r   r   r   r    Zinnerreadergroups.__iter__:   s    ~~d##r   c                s    . # )z,Returns the list of smartcard reader groups.r	   r   r   r   r   Z!innerreadergroups.getreadergroupsA   s    	r   c                sN    \        V\        4      '       g   \        hW,          p R# )zAdd a reader groupN)
isinstancestrr   )r   Znewgroupr   r   r   Z innerreadergroups.addreadergroupE   s    (C(())r   c                s`    \        V\        4      '       g   \        hV P                  V4       R# )zRemove a reader groupN)r!   r"   r   Zremove)r   Zgroupr   r   r   Z#innerreadergroups.removereadergroupK   s!    %%%))Er   c                    R# )zAdd a reader to a reader groupNr	   r   Z
readernameZ	groupname   &&&r   addreadertogroupZ"innerreadergroups.addreadertogroupQ       r   c                r#   )z#Remove a reader from a reader groupNr	   r$   r%   r   removereaderfromgroupZ'innerreadergroups.removereaderfromgroupU   r'   r   )r   r   )r
   r   r   r   r   r   r   r   r    r   r   r   r&   r(   r   r   r   r   r   r   r   $   s<     $"%$ r   r   c                   s@   a  ] tR t^Zt o Rt Rt]tRR lt R t	Rt
V tR# )readergroupsz4ReadersGroups organizes smart card reader as groups.Nc                sb    \         P                  f   V P                  V4      \         n        R# R# )z;Create a single instance of innerreadergroups on first callN)r)   instance
innerclazzr   r   r   r   Zreadergroups.__init__a   s$      ($(OOH$=L! )r   c                s.    \        V P                  V4      # r   )Zgetattrr*   )r   Znamer   r   __getattr__Zreadergroups.__getattr__h   s    t}}d++r   r	   r   )r
   r   r   r   r   r*   r   r+   r   r,   r   r   r   r   r   r)   r)   Z   s)     >/H"J>
 3, ,r   r)   N)r   Zsmartcard.Exceptionsr    Zsmartcard.ulistr   r   r   r)   r	   r   r   <module>r-      s8   0 4 !B0 B3 3l, ,r   