+
     h  c                   sl    R t ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIH	t	H
t
HtHtHtHt  ! R R]4      tR# )a  CardConnectionDecorator that provides exclusive use of a card.

__author__ = "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
N)CardConnectionDecorator)CardConnectionException)PCSCCardConnection)SCARD_LEAVE_CARDSCARD_S_SUCCESSSCARD_SHARE_EXCLUSIVESCardConnectSCardDisconnectSCardGetErrorMessagec                   s4   a  ] tR t^'t o RtR tRR ltRtV tR# )ExclusiveConnectCardConnectionzvThis decorator uses exclusive access to the card during
connection to prevent other processes to connect to this card.c                s2    \         P                  ! W4       R # )N)r    __init__)selfZcardconnections   &&O/usr/lib64/python3.14/site-packages/smartcard/ExclusiveConnectCardConnection.pyr
   Z'ExclusiveConnectCardConnection.__init__+   s    ((>    Nc                s   \         P                  ! WW#4       V P                  p \        V\        P
                  P                  P                  4      '       d   \        P                  ! V4      p^ V8X  d   VP                  4       pVP                  eA   \        VP                  \        4      pV\        8w  d   \        R\        V4      ,           4      h\        VP                   \#        VP$                  4      \&        V4      w  qdn	        pV\        8w  d   \        R\        V4      ,           4      hR# \)        VR4      '       d   VP                  pEK0  R# )z?Disconnect and reconnect in exclusive mode PCSCCardconnections.NzFailed to disconnect: z,Failed to connect with SCARD_SHARE_EXCLUSIVE	component)r    connectr   Z
isinstance	smartcardZpcscr   ZtranslateprotocolmaskZgetProtocolZhcardr   r   r   r   r   r   ZhcontextZstrZreaderr   Zhasattr)r   ZprotocolZmodeZdispositionr   ZpcscprotocolZhresultZdwActiveProtocols   &&&&    r   r   Z&ExclusiveConnectCardConnection.connect.   s   ''JNN	9>><<OO   2GGQ$#,#8#8#:L??.-ioo?OPG/1547KG7TT  >J&&	(()) 	>:*: o-1F.w78 
 y+..%//	r    )NNN)	Z__name__Z
__module__Z__qualname__Z__firstlineno____doc__r
   r   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r	   r	   '   s     F?" "r   r	   )r   Zsmartcard.pcscr   Z!smartcard.CardConnectionDecoratorr    Zsmartcard.Exceptionsr   r   Zsmartcard.scardr   r   r   r   r   r   r	   r   r   r   <module>r      s/   0  E 8 - )%< )r   