
    q'Ve                     8    d Z ddlmZ erddlZddlmZ d ZdS dS )z>
Compatibility functions for scoped and unscoped enum access.
   )PYQT6    N)sipc                    d t          |           D             }|D ]}t          | |          }t          |t          j                  s-d t          |          D             }|D ]]}t          ||          }t          |t
          j                  s-|j                                        D ]\  }}t          |||           ^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                 <    g | ]}|                     d           |S )Q)
startswith.0names     1lib/python3.11/site-packages/qtpy/enums_compat.py
<listcomp>z!promote_enums.<locals>.<listcomp>   s)    LLLts7K7KLtLLL    c                 F    g | ]}|d                                           |S )r   )isupperr
   s     r   r   z!promote_enums.<locals>.<listcomp>!   s+    MMMT47??;L;LMDMMMr   N)
dirgetattr
isinstancer   wrappertypeenumEnumMeta__members__itemssetattr)	moduleclass_names
class_nameklassattrib_namesattrib_nameattribr   values	            r   promote_enumsr#      s     MLFLLL% 
	0 
	0JFJ//EeS_55 MMSZZMMML+ 0 0 44!&$-88 #)#5#;#;#=#= 0 0KD%E4////0	0
	0 
	0r   )__doc__ r   r   r   r#    r   r   <module>r'      si           0KKK0 0 0 0 00 0r   