← Back
Editing: qt_for_kernel.cpython-311.pyc
� �@�cu � � � d Z ddlZddlZddlmZmZmZmZmZm Z m Z mZmZm Z mZ eee e eee efZd� Zd� Z e� � Z ee� � \ ZZZZ eee� � ZdS )a� Import Qt in a manner suitable for an IPython kernel. This is the import used for the `gui=qt` or `matplotlib=qt` initialization. Import Priority: if Qt has been imported anywhere else: use that if matplotlib has been imported and doesn't support v2 (<= 1.0.1): use PyQt4 @v1 Next, ask QT_API env variable if QT_API not set: ask matplotlib what it's using. If Qt4Agg or Qt5Agg, then use the version matplotlib is configured with else: (matplotlib said nothing) # this is the default path - nobody told us anything try in this order: PyQt default version, PySide, PyQt5 else: use what QT_API says � N)�load_qt� loaded_api�enum_factory�QT_API_PYQT6�QT_API_PYSIDE6�QT_API_PYQT5�QT_API_PYSIDE2� QT_API_PYQTv1�QT_API_PYQT� QT_API_PYSIDE�QT_API_PYQT_DEFAULTc � � | �dS | j � dd� � }|dk r�| j � dd� � }|�dS |� � � dk rt gS |� � � dk rt gS |� � � dk rt gS t d|z � � �|d k rQ| j � d d� � }|�dS |� � � dk rt gS t d|z � � �dS ) z-Constraints placed on an imported matplotlib.N�backend�Qt4Aggzbackend.qt4�pyside�pyqt4�pyqt4v2z3unhandled value for backend.qt4 from matplotlib: %r�Qt5Aggzbackend.qt5�pyqt5z3unhandled value for backend.qt5 from matplotlib: %r)�rcParams�get�lowerr r r �ImportErrorr )�mplr �mpqts �@/usr/lib/python3/dist-packages/IPython/external/qt_for_kernel.py�matplotlib_optionsr D s* � � �{����l���y�$�/�/�G��(����|��� �t�4�4���<��4��:�:�<�<�8�#�#�!�?�"� �Z�Z�\�\�W� $� $�'�(�(� �Z�Z�\�\�Y� &� &��=� ��O��� � � � �H� � ��|��� �t�4�4���<��4��:�:�<�<�7�"�"� �>�!��O��� � � � � � c � � t � � } | �| gS t j � dd� � }|�3t |j � d� � � � dk rt gS t j � dd� � }|�;t |� � p+t t t t t t t gS |t"