o
    ¹¼tf®  ã                   @   s8   d Z ddlmZ erddlZddlmZ dd„ ZdS dS )z>
Compatibility functions for scoped and unscoped enum access.
é   )ÚPYQT6é    N)Úsipc           	      C   sŒ   dd„ t | ƒD ƒ}|D ]8}t| |ƒ}t|tjƒsqdd„ t |ƒD ƒ}|D ]}t||ƒ}t|tjƒs2q$|j ¡ D ]
\}}t	|||ƒ q7q$qdS )a  
        Search enums in the given module and allow unscoped access.

        Taken from:
        https://github.com/pyqtgraph/pyqtgraph/blob/pyqtgraph-0.12.1/pyqtgraph/Qt.py#L331-L377
        and adapted to also copy enum values aliased under different names.

        c                 S   s   g | ]	}|  d ¡r|‘qS )ÚQ)Ú
startswith©Ú.0Úname© r
   úZ/var/www/html/software/conda/envs/catlas/lib/python3.10/site-packages/qtpy/enums_compat.pyÚ
<listcomp>   s    z!promote_enums.<locals>.<listcomp>c                 S   s   g | ]
}|d    ¡ r|‘qS )r   )Úisupperr   r
   r
   r   r   !   s    N)
ÚdirÚgetattrÚ
isinstancer   ZwrappertypeÚenumÚEnumMetaÚ__members__ÚitemsÚsetattr)	ÚmoduleZclass_namesÚ
class_nameÚklassZattrib_namesÚattrib_nameÚattribr	   Úvaluer
   r
   r   Úpromote_enums   s   	

ÿüûr   )Ú__doc__Ú r   r   r   r   r
   r
   r
   r   Ú<module>   s   û