
    	hu                         S r SSKrSSKJr  \R                  \R
                     rSS jr " S S5      r " S S\5      r	 " S	 S
5      r
g)zGeneral client side utilities.

This module contains utility functions, used primarily by advanced COM
programmers, or other COM modules.
    N)_get_good_object_c                     [        U [        R                  [        R                     5      (       d  U R	                  [        R                  5      n [        X5      $ )zWrap an object in a VARIANT enumerator.

All VT_DISPATCHs returned by the enumerator are converted to wrapper objects
(which may be either a class instance, or a dynamic.Dispatch type object).

)
isinstance	pythoncomTypeIIDsIID_IEnumVARIANTQueryInterfaceEnumVARIANT)obresultCLSIDs     gC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\win32com/client/util.pyWrapEnumr      sC     b),,Y-G-GHIIy99:r''    c                   L    \ rS rSrSrS rS rS rS rSS jr	S r
S	 rS
 rSrg)
Enumerator   a  A class that provides indexed access into an Enumerator

By wrapping a PyIEnum* object in this class, you can perform
natural looping and indexing into the Enumerator.

Looping is very efficient, but it should be noted that although random
access is supported, the underlying object is still an enumerator, so
this will force many reset-and-seek operations to find the requested index.

c                     Xl         SU l        g )N_oleobj_index)selfenums     r   __init__Enumerator.__init__%   s    
r   c                 $    U R                  U5      $ N_Enumerator__GetIndexr   r   s     r   __getitem__Enumerator.__getitem__)       u%%r   c                 $    U R                  U5      $ r   r   r    s     r   __call__Enumerator.__call__,   r#   r   c                 ~   [        U[        5      (       d  [        S5      eXR                  S-   :w  a<  U R                  R                  5         U(       a  U R                  R                  U5        Xl        U R                  R                  S5      n[        U5      (       a  U R                  US   5      $ [        S5      e)Nz2Only integer indexes are supported for enumerators   r   zlist index out of range)r   int	TypeErrorr   r   ResetSkipNextlen_make_retval_
IndexError)r   r   results      r   
__GetIndexEnumerator.__GetIndex/   s    %%%PQQ JJN"MM!"" 
##A&v;;%%fQi00233r   c                     U R                   R                  U5      n/ nU H#  nUR                  U R                  U5      5        M%     [	        U5      $ r   )r   r-   appendr/   tuple)r   countretrealRetsrs        r   r-   Enumerator.NextD   sF    mm  'AOOD..q12 Xr   c                 6    U R                   R                  5       $ r   )r   r+   r   s    r   r+   Enumerator.ResetK   s    }}""$$r   c                 j    U R                  U R                  R                  5       U R                  5      $ r   )	__class__r   Cloner   r=   s    r   rA   Enumerator.CloneN   s&    ~~dmm113T5E5EFFr   c                     U$ r    r   r1   s     r   r/   Enumerator._make_retval_Q   s    r   r   N)r(   )__name__
__module____qualname____firstlineno____doc__r   r!   r%   r   r-   r+   rA   r/   __static_attributes__rD   r   r   r   r      s0    	&&4*%Gr   r   c                   $    \ rS rSrSS jrS rSrg)r
   U   Nc                 :    X l         [        R                  X5        g r   )r   r   r   r   r   r   s      r   r   EnumVARIANT.__init__V   s    &D'r   c                 (    [        XR                  S9$ Nr   )r   r   rE   s     r   r/   EnumVARIANT._make_retval_Z   s     5E5EFFr   rT   r   )rG   rH   rI   rJ   r   r/   rL   rD   r   r   r
   r
   U   s    (Gr   r
   c                   *    \ rS rSrSS jrS rS rSrg)Iterator^   Nc                 j    X l         [        UR                  [        R                  5      5      U l        g r   )r   iterr	   r   r   _iter_rP   s      r   r   Iterator.__init___   s%    &4..y/I/IJKr   c                     U $ r   rD   r=   s    r   __iter__Iterator.__iter__c   s    r   c                 P    [        [        U R                  5      U R                  S9$ rS   )r   nextr[   r   r=   s    r   __next__Iterator.__next__f   s     dkk!2@P@PQQr   )r[   r   r   )rG   rH   rI   rJ   r   r^   rb   rL   rD   r   r   rW   rW   ^   s    LRr   rW   r   )rK   r   win32com.clientr   r   IID_IDispatchPyIDispatchTyper   r   r
   rW   rD   r   r   <module>rg      sR     -$$Y%<%<=	(9 9xG* G	R 	Rr   