Format: application/x-python-code
⬇ Download File (2.6 KB)
   1  o
   2  
   3  ��hs
   4  �@s�dZddlZddlZddlmZmZmZmZmZm	Z	m
   5  Z
   6  mZmZm
   7  Z
   8  eee	e
   9  e
  10  fZdd�Zdd�Ze�Zee�\ZZZZeee�ZdS)a Import Qt in a manner suitable for an IPython kernel.
  11  
  12  This is the import used for the `gui=qt` or `matplotlib=qt` initialization.
  13  
  14  Import Priority:
  15  
  16  if Qt has been imported anywhere else:
  17     use that
  18  
  19  if matplotlib has been imported and doesn't support v2 (<= 1.0.1):
  20      use PyQt4 @v1
  21  
  22  Next, ask QT_API env variable
  23  
  24  if QT_API not set:
  25      ask matplotlib what it's using. If Qt4Agg or Qt5Agg, then use the
  26          version matplotlib is configured with
  27  
  28      else: (matplotlib said nothing)
  29          # this is the default path - nobody told us anything
  30          try in this order:
  31              PyQt default version, PySide, PyQt5
  32  else:
  33      use what QT_API says
  34  
  35      Note that %gui's implementation will always set a `QT_API`, see
  36      `IPython.terminal.pt_inputhooks.get_inputhook_name_and_func`
  37  
  38  �N)
  39  �load_qt�
  40  loaded_api�enum_factory�QT_API_PYQT6�QT_API_PYSIDE6�QT_API_PYQT5�QT_API_PYSIDE2�QT_API_PYQT�
  41  QT_API_PYSIDE�QT_API_PYQT_DEFAULTcCs�|durdS|j�dd�}|dkr?|j�dd�}|durdS|��dkr'tgS|��dkr0tgS|��dkr9tgStd|��|d	kr_|j�d
  42  d�}|durPdS|��dkrYtgStd|��dS)
  43  z-Constraints placed on an imported matplotlib.N�backendZQt4Aggzbackend.qt4ZpysideZpyqt4Zpyqt4v2z3unhandled value for backend.qt4 from matplotlib: %rZQt5Aggzbackend.qt5Zpyqt5z3unhandled value for backend.qt5 from matplotlib: %r)ZrcParams�get�lowerr
  44  rr	�ImportErrorr)�mplrZmpqt�r�Tc:\Users\shubh\Videos\agent\nova\Lib\site-packages\IPython/external/qt_for_kernel.py�matplotlib_optionsBs4���rcCs�t�}|dur
  45  |gStj�dd�}|dur"t|j�d��dkr"tgStj	�dd�}|dur8t
  46  |�p7tttt
  47  tgS|tvrGtd|d�t�f��|gS)zGReturn a list of acceptable QT APIs, in decreasing order of preference.NZ
  48  matplotlib�.)�1�0�2�QT_APIz'Invalid Qt API %r, valid values are: %rz, )r�sys�modulesr
  49  �tuple�__version__�splitr�os�environrrrrr�_qt_apis�RuntimeError�join)ZloadedrZqt_apirrr�get_options\s(��r#)�__doc__rrZIPython.external.qt_loadersrrrrrrrr	r
  50  rr rr#Zapi_optsZQtCoreZQtGuiZQtSvgrZenum_helperrrrr�<module>s!0�