Changeset 2774
- Timestamp:
- 03/06/18 14:39:36 (6 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/support/mixer-qt4/ffado/import_pyqt.py
r2696 r2774 21 21 # 22 22 23 ffado_pyqt_version = 4 24 25 # This module handles the importing of PyQt modules for both PyQt4 and PyQt5.26 # The idea is to first try importing PyQt4. If there's an import error it's27 # assumed PyQt5 is present instead and that is tried.23 # This module handles the importing of PyQt modules for both PyQt4 and PyQt5 24 # under Python2 or Python3. If Python3 is installed it is assumed that 25 # PyQt5 is in use (this is reasonable because PyQt5 is what everyone wants 26 # to use under Python3). Otherwise (that is, under Python2), an import of 27 # PyQt4 is tried first; if an import error occurs then PyQt5 is assumed. 28 28 # 29 29 # All modules used by any part of ffado-mixer are imported. This greatly … … 31 31 # by string variables, and there isn't a supported way to do this across 32 32 # Python2 and Python3. 33 try: 33 34 import sys 35 ffado_python3 = sys.version_info >= (3,) 36 37 if ffado_python3: 38 ffado_pyqt_version = 5 39 else: 40 try: 41 from PyQt4 import QtGui 42 ffado_pyqt_version = 4 43 except ImportError: 44 ffado_pyqt_version = 5 45 46 if ffado_pyqt_version == 4: 34 47 from PyQt4 import QtGui, QtCore, Qt, uic 35 48 from PyQt4.QtCore import QByteArray, QObject, QTimer, Qt, pyqtSignal, QString, pyqtSlot 36 49 from PyQt4.QtGui import * 37 ffado_pyqt_version = 4 38 except ImportError: 50 else: 39 51 from PyQt5 import QtGui, Qt, QtCore, Qt, QtWidgets, uic 40 52 from PyQt5.QtCore import QByteArray, QObject, pyqtSignal, pyqtSlot, QTimer, Qt 41 53 from PyQt5.QtGui import * 42 54 from PyQt5.QtWidgets import * 43 ffado_pyqt_version = 544 45 import sys46 ffado_python3 = sys.version_info >= (3,)