B
    Wf¹_„  ã               @   s€   d Z ddlT ddlZejZe ejd¡e_e d¡e	dfdd	„ƒZ
ejfd
d„Zdd„ Zdd„ ZG dd„ deƒZe eƒ ¡ dS )zH
The classes in this module enable loading widgets and layout from XML.
é   )Ú*é    NzUse LoadFromBuffer insteadz$Use :class:`xrc.XmlResource` insteadÚ c             C   s
   t | |ƒS )zP
    A compatibility wrapper for the XmlResource(flags, domain) constructor
    )ÚXmlResource)ÚflagsZdomain© r   ú%lib/python3.7/site-packages/wx/xrc.pyÚEmptyXmlResource   s    r	   c             C   s   t  | |¡S )z[
    Returns a numeric ID that is equivalent to the string ID used in an XML resource.
    )r   ZGetXRCID)Ústr_idZvalue_if_not_foundr   r   r   ÚXRCID   s    r   c             G   s   |   t|ƒ¡S )zT
    Returns the child window associated with the string ID in an XML resource.
    )Z
FindWindowr   )Zwindowr
   Z
ignoreargsr   r   r   ÚXRCCTRL   s    r   c             C   sf   yt | ƒ}W n* tk
r6   dd l}t| ¡ ƒ ‚ Y nX |  d¡}x|dd … D ]}t||ƒ}qPW |S )Nr   Ú.r   )Ú
__import__ÚImportErrorÚ	tracebackÚprintÚ
format_excÚsplitÚgetattr)ÚnameÚmodr   Z
componentsÚcompr   r   r   Ú
_my_import*   s    
r   c               @   s   e Zd Zdd„ Zdd„ ZdS )ÚXmlSubclassFactory_Pythonc             C   s   t  | ¡ d S )N)ÚXmlSubclassFactoryÚ__init__)Úselfr   r   r   r   7   s    z"XmlSubclassFactory_Python.__init__c             C   sZ   |  d¡dkstdƒ‚|d | d¡… }|| d¡d d … }t|ƒ}t||ƒ}|ƒ }|S )Nr   éÿÿÿÿzModule name must be specified!r   )ÚfindÚAssertionErrorÚrfindr   r   )r   Z	classNameZmnameZcnameÚmoduleÚklassÚinstr   r   r   ÚCreate:   s    
z XmlSubclassFactory_Python.CreateN)Ú__name__Ú
__module__Ú__qualname__r   r$   r   r   r   r   r   6   s   r   )Ú__doc__Z_xrcZwxZID_NONEZ
deprecatedr   ZLoadFromBufferZLoadFromStringZdeprecatedMsgZXRC_USE_LOCALEr	   r   r   r   r   r   ZAddSubclassFactoryr   r   r   r   Ú<module>   s   