Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/IPython/external/__pycache__/qt_loaders.cpython-39.pyc
Ðазад
a o�h�, � @ s d Z ddlZddlZddlZddlZddlmZmZ ddl Z dZ dZdZdZ dZd Zd ZdZe ded ede dedededediZG dd� dejj�Ze� Zej�de� dd� Zdd� Zdd� Zdd� Zdd� Zd/dd �Zd!d"� Zd#d$� Z d%d&� Z!d'd(� Z"d)d*� Z#d+d,� Z$d-d.� Z%dS )0aD This module contains factory functions that attempt to return Qt submodules from the various python Qt bindings. It also protects against double-importing Qt with different bindings, which is unstable and likely to crash This is used primarily by qt and qt_for_kernel, and shouldn't be accessed directly from the outside � N)�partial� lru_cacheZpyqt6Zpyside6Zpyqt5Zpyside2ZpyqtZpyqtv1ZpysideZpyqtdefault�PyQt6�PySide6�PyQt5�PySide2�PySide�PyQt4c @ s* e Zd ZdZdd� Zdd� Zd dd�ZdS ) �ImportDenierzfImport Hook that will guard against bad Qt imports once IPython commits to a specific binding c C s t � | _d S �N)�set�_ImportDenier__forbidden)�self� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/IPython/external/qt_loaders.py�__init__8 s zImportDenier.__init__c C s t j�|d � | j�|� d S r )�sys�modules�popr �add)r �module_namer r r �forbid; s zImportDenier.forbidNc C s( |rd S || j v r$td|t� f ��d S )Nzi Importing %s disabled by IPython, which has already imported an Incompatible QT Binding: %s )r �ImportError� loaded_api)r �fullname�path�targetr r r � find_spec? s ��zImportDenier.find_spec)N)�__name__� __module__�__qualname__�__doc__r r r r r r r r 3 s r c C s2 t t�� �}|�t| � |D ]}t�|� qdS )zXCommit to a particular API, and trigger ImportErrors on subsequent dangerous importsN)r � api_to_module�values�remove�IDr )�apir �modr r r � commit_apiP s r( c C st t j�d�rtS t j�d�r tS t j�d�r0tS t j�d�r@tS t j�d�r`t� dkrZtS t S nt j�d�rpt S dS ) z�Return which API is loaded, if any If this returns anything besides None, importing any other Qt binding is unsafe. Returns ------- None, 'pyside6', 'pyqt6', 'pyside2', 'pyside', 'pyqt', 'pyqt5', 'pyqtv1' zPyQt6.QtCorezPySide6.QtCorezPyQt5.QtCorezPySide2.QtCorezPyQt4.QtCore� z PySide.QtCoreN)r r �get�QT_API_PYQT6�QT_API_PYSIDE6�QT_API_PYQT5�QT_API_PYSIDE2� qtapi_version�QT_API_PYQT� QT_API_PYQTv1� QT_API_PYSIDEr r r r r Z s r c C s� t | }ddlm} g d�}| ttttfv r6|�d� |D ]>}z|d||f �}W n tyh Y dS 0 |du r: dS q:| t kr�ddl }|jdkS d S ) a5 Safely check for PyQt4/5, PySide or PySide2, without importing submodules Parameters ---------- api : str [ 'pyqtv1' | 'pyqt' | 'pyqt5' | 'pyside' | 'pyside2' | 'pyqtdefault'] Which module to check for Returns ------- True if the relevant module appears to be importable r )r )�QtCore�QtGui�QtSvg� QtWidgetsz%s.%sFN)� r � T)r"