§
    ÷¢±j”  ã                   óª   — d Z ddlZddlZddlZddlmZmZ ddlmZmZ ddl	m
Z
 ddlmZ  G d„ dej        ¦  «        Zd	„ Zed
k    r e¦   «          dS dS )a=  Python.Dictionary COM Server.

This module implements a simple COM server that acts much like a Python
dictionary or as a standard string-keyed VB Collection.  The keys of
the dictionary are strings and are case-insensitive.

It uses a highly customized policy to fine-tune the behavior exposed to
the COM client.

The object exposes the following properties:

    int Count                       (readonly)
    VARIANT Item(BSTR key)          (propget for Item)
    Item(BSTR key, VARIANT value)   (propput for Item)

    Note that 'Item' is the default property, so the following forms of
    VB code are acceptable:

        set ob = CreateObject("Python.Dictionary")
        ob("hello") = "there"
        ob.Item("hi") = ob("HELLO")

All keys are defined, returning VT_NULL (None) if a value has not been
stored.  To delete a key, simply assign VT_NULL to the key.

The object responds to the _NewEnum method by returning an enumerator over
the dictionary's keys. This allows for the following type of VB code:

    for each name in ob
        debug.print(name, ob(name))
    next
é    N)ÚDISPATCH_METHODÚDISPATCH_PROPERTYGET)ÚpolicyÚutil)ÚCOMException)ÚS_OKc                   ó^   — e Zd Zg Zej        ej        ddœZdZdZ	dZ
dZdZd„ Zd	„ Zd
„ Zd„ ZdS )ÚDictionaryPolicyé   )ÚitemÚ_newenumÚcountzPython Dictionaryz&{39b61048-c755-11d0-86fa-00c04fc2e03e}zPython.DictionaryzPython.Dictionary.1z,win32com.servers.dictionary.DictionaryPolicyc                 óV   — |                       i ¦  «         t          j        | |¦  «        S ©N)Ú_wrap_Ú	pythoncomÚ
WrapObject)ÚselfÚclsidÚreqIIDs      úgC:\Users\johnn\AppData\Local\Programs\Python\Python311\Lib\site-packages\win32com/servers/dictionary.pyÚ_CreateInstance_z!DictionaryPolicy._CreateInstance_=   s$   € Ø�Š�B‰ŒˆÝÔ# D¨&Ñ1Ô1Ð1ó    c                 ó   — || _         d S r   )Ú_obj_)r   Úobs     r   r   zDictionaryPolicy._wrap_A   s   € ØˆŒ
ˆ
ˆ
r   c                 óÈ  — |dk    �r!t          |¦  «        }|dk     rt          dt          j        ¬¦  «        ‚|d         }t	          |t
          ¦  «        st          dt          j        ¬¦  «        ‚|                     ¦   «         }|t          t          z  z  r:|dk    rt          t          j        ¬¦  «        ‚| j
                             |¦  «        S |dk    rt          t          j        ¬¦  «        ‚|d         €	 | j
        |= n # t          $ r Y nw xY w|d         | j
        |<   t          S |dk    re|t          z  st          t          j        ¬¦  «        ‚t          |¦  «        dk    rt          t          j        ¬¦  «        ‚t          | j
        ¦  «        S |t          j        k    r&t#          j        t'          | j
        ¦  «        ¦  «        S t          t          j        ¬¦  «        ‚)Nr   r   znot enough parameters)ÚdescÚscodezKey must be a string)r   é   )Úlenr   ÚwinerrorÚDISP_E_BADPARAMCOUNTÚ
isinstanceÚstrÚDISP_E_TYPEMISMATCHÚlowerr   r   r   ÚgetÚKeyErrorr   ÚDISP_E_MEMBERNOTFOUNDr   ÚDISPID_NEWENUMr   ÚNewEnumÚlist)	r   ÚdispidÚlcidÚwFlagsÚargsÚkwargsÚserviceProviderÚlÚkeys	            r   Ú
_invokeex_zDictionaryPolicy._invokeex_D   sÒ  € Ø�QŠ;‰;Ý�D‘	”	ˆAØ�1ŠuˆuÝ"Ø0½Ô8Uðñ ô ð ð �q”'ˆCÝ˜c¥3Ñ'Ô'ð å"Ø/µxÔ7Sðñ ô ð ð —)’)‘+”+ˆCà�Õ+?Ñ?Ñ@ð +Ø�q’5�5Ý&­XÔ-JÐKÑKÔKÐKØ”z—~’~ cÑ*Ô*Ð*à�AŠvˆvÝ"­Ô)FÐGÑGÔGÐGØ�AŒwˆðØœ
 3˜˜øÝð ð ð Ø�Dðøøøð #' q¤'�”
˜3‘ÝˆKà�QŠ;ˆ;ØÕ0Ñ0ð IÝ"­Ô)GÐHÑHÔHÐHÝ�4‰yŒy˜AŠ~ˆ~Ý"­Ô)FÐGÑGÔGÐGÝ�t”z‘?”?Ð"à•YÔ-Ò-Ð-Ý”<¥ T¤ZÑ 0Ô 0Ñ1Ô1Ð1å¥Ô!?Ð@Ñ@Ô@Ð@s   Ã9D Ä
DÄDc                 ó¦   — |d                               ¦   «         }	 | j        |         fS # t          $ r t          t          j        d¬¦  «        ‚w xY w)Nr   zMember not found)r   r   )r'   Ú_name_to_dispid_r)   r   r"   r*   )r   Únamesr/   Únames       r   Ú_getidsofnames_z DictionaryPolicy._getidsofnames_r   sh   € ð �QŒx�~Š~ÑÔˆð	ØÔ)¨$Ô/Ð1Ð1øÝð 	ð 	ð 	ÝÝÔ4Ð;Mðñ ô ð ð	øøøs	   œ* ª&AN)Ú__name__Ú
__module__Ú__qualname__Ú_com_interfaces_r   ÚDISPID_VALUEr+   r8   Ú
_reg_desc_Ú_reg_clsid_Ú_reg_progid_Ú_reg_verprogid_Ú_reg_policy_spec_r   r   r6   r;   © r   r   r
   r
   +   s”   € € € € € àÐð Ô&ØÔ,Øðð Ðð %€JØ:€KØ&€LØ+€OØFÐð2ð 2ð 2ðð ð ð,Að ,Að ,Að\	ð 	ð 	ð 	ð 	r   r
   c                  ó.   — ddl m}   | t          ¦  «        S )Nr   ©ÚUseCommandLine)Úwin32com.server.registerrI   r
   rH   s    r   ÚRegisterrK   ~   s%   € Ø7Ð7Ð7Ð7Ð7Ð7àˆ>Õ*Ñ+Ô+Ð+r   Ú__main__)Ú__doc__r   Ú
pywintypesr"   r   r   Úwin32com.serverr   r   Úwin32com.server.exceptionr   r   ÚBasicWrapPolicyr
   rK   r<   rF   r   r   ú<module>rR      sð   ððð ðB Ð Ð Ð Ø Ð Ð Ð Ø €€€Ø ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ø (Ð (Ð (Ð (Ð (Ð (Ð (Ð (Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø Ð Ð Ð Ð Ð ðPð Pð Pð Pð P�vÔ-ñ Pô Pð Pðf,ð ,ð ,ð ˆzÒÐØ€H�J„J€J€J€Jð Ðr   