+
     h>  c                   s     R t  ! R R]4      tR# )a  ulist is a subclass of list where items cannot appear twice in the list.

[1,2,2,3,3,4] is a valid list, whereas in ulist we can only have [1,2,3,4].

__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
c                   st   a  ] tR t^t o RtRR ltR tR tR tR t	R t
RR	 ltR
 tR tR tR tR tRtV tR# )ulistzrulist ensures that all items are unique and provides an __onadditem__
hook to perform custom action in subclasses.Nc                s   Vei   V. 8w  db   \         P                  W^ ,          .4       VR,           F5  p\         P                  W4      '       d   K   \         P                  W4       K7  	  R # \         P                  W4       R # )N:i   NN)list__init____contains__append)selfZinitlistitem   && 6/usr/lib64/python3.14/site-packages/smartcard/ulist.pyr   Zulist.__init__$   s[    HNMM$!. ((44KK+ % MM$)    c                s    V P                  V4      pV P                  V4       V P                  \        V 4      \        V4      ,           4      # N)_ulist__remove_duplicates__appendother__Z	__class__r   r   othernewotherr   r   __add__Zulist.__add__-   s<    ++E2X&~~d4j4>9::r	   c                st    V P                  V4      pV P                  V4       \        P                  W4       V # r
   )r   r   r   __iadd__r   r   r   r   Zulist.__iadd__2   s1    ++E2X&d%r	   c                sN    V P                  V4      p\        P                  W4      # r
   )r   r   r   r   r   r   __radd__Zulist.__radd__8   s!    ++E2||D++r	   c                s    \         P                  W4      '       g)   \         P                  W4       V P                  V4       R # R # r
   )r   r   r   __onadditem__r   r      &&r   r   Zulist.append<   s2      ,,KK#t$ -r	   c                s    \         P                  W4      '       g*   \         P                  WV4       V P                  V4       R # R # r
   )r   r   insertr   r   ir   s   &&&r   r   Zulist.insertA   s4      ,,KK&t$ -r	   c                sR    \         P                  W4      pV P                  V4       V# r
   )r   pop__onremoveitem__r   r   r   r   Z	ulist.popF   s#    xx d#r	   c                sR    \         P                  W4       V P                  V4       R # r
   )r   remover   r   r   r   r   Zulist.removeK   s    Dd#r	   c                sl   \        V\        V 4      4      '       g:   \        V\        \        4      4      '       g   \        V\        4      '       g   V.pM\        V4      p. p\        ^ \	        V4      4       FB  pVP                  ^ 4      p\        P                  W4      '       d   K1  VP                  V4       KD  	  . pV. 8w  do   VP                  V^ ,          4       \        ^\	        V4      4       F=  pVP                  4       pVP                  V4      '       d   K,  VP                  V4       K?  	  V# )z(Remove from other items already in list.)Z
isinstanceZtyper   ZrangeZlenr   r   r   )r   Z_otherr   r   r   r   s   &&    r   Z__remove_duplicatesZulist.__remove_duplicatesS   s     64:..vtDz22vt,,HELE q#e*%A99Q<D$$T00% & r>LL!%1c(m,||~))$//LL& - r	   c                s:    V F  pV P                  V4       K  	  R# )zAppend other to object.N)r   )r   r   r   r   r   r   Zulist.__appendother__o   s    Dt$ r	   c                    R# )zLCalled for each item added. Override in subclasses for adding
custom action.N r   r   r   r   Zulist.__onadditem__t        	r	   c                r   )zNCalled for each item removed. Override in subclasses for
adding custom action.Nr   r   r   r   r   Zulist.__onremoveitem__y   r   r	   r   r
   )i)Z__name__Z
__module__Z__qualname__Z__firstlineno____doc__r   r   r   r   r   r   r   r   r   r   r   r   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r    r       sK     4*;
,%
%

$8%

 r	   r    N)r   r   r    r   r	   r   <module>r       s   6`D `r	   