B @` @sdZdZddlZeeZGdddeZGdddeZGdd d eZ d Z gZ ydd l m Z Wne d ydd lm Z Wne d YnXy|ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z ddl!m"Z"m#Z#m$Z$ddl!m Z ddlm%Z%dZ Wne dYnXYnXyddl&mZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z ddl'mZddl(m"Z"m#Z#m$Z$ddl(m Z ddl m%Z%dZ Wne dYnXe seZ"e Z#eZ dS)a Import PyQt5 if available, then try PyQt4, then, if all else fails, use some dummy classes to allow some testing. If anything fails to import, the excpetion is logged. That should make it clear exacly what's missing, but it could be a little annoying it you are using PyQt4 or don't need jupyter qtconsole. In the future, will probably cut PyQt4 support, so it will be less of an issue. z John EslickNc@s0eZdZdZGdddeZGdddeZdS) DummyQtCorezA A dummy QtCore class to allow some testing without PyQt c@s eZdZdS)zDummyQtCore.QModelIndexN)__name__ __module__ __qualname__rr;/tmp/pip-unpacked-wheel-bi3529v6/pyomo/contrib/viewer/qt.py QModelIndexsrc@s,eZdZGdddeZGdddeZdS)zDummyQtCore.Qtc@s eZdZdS)zDummyQtCore.Qt.DisplayRoleN)rrrrrrr DisplayRolesr c@s eZdZdS)zDummyQtCore.Qt.EditRoleN)rrrrrrrEditRole!sr N)rrrobjectr r rrrrQtsr N)rrr__doc__r rr rrrrrsrc@seZdZdZddZdS)DummyQAbstractItemModelzM A dummy QAbstractItemModel class to allow some testing without PyQt cOsdS)Nr)argskwargsrrr__init__(sz DummyQAbstractItemModel.__init__N)rrrr rrrrrr$src@seZdZdZddZdS)DummyQAbstractTableModelzN A dummy QAbstractTableModel class to allow some testing without PyQt cOsdS)Nr)rrrrrr/sz!DummyQAbstractTableModel.__init__N)rrrr rrrrrr+srF)QtCorezCannot import PyQt5.QtCorezCannot import PyQt4.QtCore)QAbstractItemView QFileDialog QMainWindow QMessageBoxQMdiArea QApplicationQTableWidgetItemQColorQAction QStatusBar QLineEditQItemEditorFactoryQItemEditorCreatorBaseQStyledItemDelegate QItemDelegate QComboBox)QAbstractItemModelQAbstractTableModelQVariant)uicTzCannot import PyQt4)rrrrrrrrrrrr r!r"r#)rzCannot import PyQt5))r __author__logging getLoggerr_logr rrrZ qt_availableZqt_import_errorsZPyQt5rappendZPyQt4Z PyQt4.QtGuirrrrrrrrrrrrr r!r"r#Z PyQt4.QtCorer$r%r&r'ZPyQt5.QtWidgetsZ PyQt5.QtGuiZ PyQt5.QtCorerrrrsJ   H  D