+
     h!  c                   s    R t ^ RI5 ^ RIHtHt ^ RI5  ! R R]4      t ! R R]4      t]R8X  d   ]	! ]! 4       P                  4       4       R# R# )	a  PCSCReaderGroups organizes smartcard readers as 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
)Z*)innerreadergroupsreadergroupsc                   s@   a  ] tR t^t o RtRR ltR tR tR tRt	V t
R# )	pcscinnerreadergroupszSmartcard PCSC readers groups inner class.

The PCSCReaderGroups singleton manages the creation of the unique
instance of this class.
Nc                sB    \         P                  ! W4       R.V n        R# )zConstructor.zSCard$DefaultReadersN)r    __init__unremovablegroupsselfZinitlist   &&F/usr/lib64/python3.14/site-packages/smartcard/pcsc/PCSCReaderGroups.pyr   Zpcscinnerreadergroups.__init__%   s    ""42"8!9    c                s   \         P                  ! V 4       \        \        4      w  rV\        8w  d   \        V4      h\        V4      w  rV\        8w  d   \        V4      h\        V4      pV\        8w  d   \        V4      hV# )z,Returns the list of smartcard reader groups.)
r    getreadergroupsSCardEstablishContextSCARD_SCOPE_USERSCARD_S_SUCCESSZEstablishContextExceptionZSCardListReaderGroupsZListReadersExceptionSCardReleaseContextZReleaseContextException)r   hresulthcontextZreaderss   &   r   r
   Z%pcscinnerreadergroups.getreadergroups*   ss    ))$/12BCo%+G440:o%&w//%h/o%)'22r	   c                s   \        \        4      w  r#\        V8w  d   \        R\	        V4      ,           4      h \        W14      p\        V8w  d   \        R\	        V4      ,           4      h\        P                  ! W4        \        V4      p\        V8w  d   \        R\	        V4      ,           4      hR#   \        T4      p\        T8w  d   \        R\	        T4      ,           4      hi ; i)zAdd a reader groupFailed to establish context: z"Unable to introduce reader group: Failed to release context: N)	r   r   r   errorSCardGetErrorMessageZSCardIntroduceReaderGroupr    addreadergroupr   )r   Znewgroupr   r      &&  r   r   Z$pcscinnerreadergroups.addreadergroup9   s     22BCg%7:Nw:WWXX	/CG')8;OPW;XX  "00@ *(3G')14H4QQ  * *(3G')14H4QQ  *   AB4 43C'c                s   \        \        4      w  r#\        V8w  d   \        R\	        V4      ,           4      h \        W14      pV\        8w  d   \        R\	        V4      ,           4      h\        P                  ! W4        \        V4      p\        V8w  d   \        R\	        V4      ,           4      hR#   \        T4      p\        T8w  d   \        R\	        T4      ,           4      hi ; i)zRemove a reader groupr   zUnable to forget reader group: r   N)	r   r   r   r   r   ZSCardForgetReaderGroupr    removereadergroupr   )r   Zgroupr   r   r   r   r   Z'pcscinnerreadergroups.removereadergroupO   s     22BCg%7:Nw:WWXX	,X=G/)58LW8UU  "33D@ *(3G')14H4QQ  * *(3G')14H4QQ  *r   )r   N)__name__
__module____qualname____firstlineno____doc__r   r
   r   r   __static_attributes____classdictcell__Z__classdict__   @r   r   r      s#     :
, r	   r   c                   s.   a  ] tR t^ft o RtRR ltRtV tR# )PCSCReaderGroupszPCSC readers groups.Nc                sH    \         V n        \        P                  ! W4       R# )z?Create a single instance of pcscinnerreadergroups on first callN)r   
innerclazzr   r   r   r   r   r   ZPCSCReaderGroups.__init__i   s    /d-r	   )r$   r   )r   r   r   r   r   r   r   r    r!   r"   r   r#   r#   f   s     . .r	   r#   Z__main__N)r   Zsmartcard.pcsc.PCSCExceptionsZsmartcard.reader.ReaderGroupsr    r   Zsmartcard.scardr   r#   r   Zprintr
   ) r	   r   <module>r%      sU   0 , I E- EP.| . z	


,
,
./ r	   