[pyzo] 45/68: Missed some spots to make work on PyQt5

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Sep 28 09:47:13 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/master
in repository pyzo.

commit 864712c356c5965779e3b205f3790d14c25d1443
Author: Almar Klein <almar.klein at gmail.com>
Date:   Mon Sep 19 14:06:52 2016 +0200

    Missed some spots to make work on PyQt5
---
 pyzo/codeeditor/manager.py            |  2 +-
 pyzo/core/about.py                    | 14 +++++---------
 pyzo/core/main.py                     |  2 +-
 pyzo/tools/pyzoFileBrowser/browser.py |  2 +-
 pyzo/util/bootstrapconda.py           |  2 +-
 5 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/pyzo/codeeditor/manager.py b/pyzo/codeeditor/manager.py
index ee8a50d..3385ad2 100644
--- a/pyzo/codeeditor/manager.py
+++ b/pyzo/codeeditor/manager.py
@@ -245,7 +245,7 @@ class Manager:
         
         """
         db = QtGui.QFontDatabase()
-        QFont, QFontInfo = QtWidgets.QFont, QtGui.QFontInfo
+        QFont, QFontInfo = QtGui.QFont, QtGui.QFontInfo
         # fn = font_name (str)
         return [fn for fn in db.families() if QFontInfo(QFont(fn)).fixedPitch()]
     
diff --git a/pyzo/core/about.py b/pyzo/core/about.py
index 0aa0ddc..afac84e 100644
--- a/pyzo/core/about.py
+++ b/pyzo/core/about.py
@@ -3,11 +3,13 @@ import os
 import sys
 
 from pyzo.util.qt import QtCore, QtGui, QtWidgets
+from pyzo.util import qt
 
 import pyzo
 from pyzo.util import paths
 
 
+
 class AboutDialog(QtWidgets.QDialog):
     def __init__(self, parent):
         QtWidgets.QDialog.__init__(self, parent)
@@ -92,15 +94,9 @@ class AboutDialog(QtWidgets.QDialog):
         by Mark James (http://www.famfamfam.com/lab/icons/silk/).
         """
         # Determine if this is PyQt4 or Pyside
-        if hasattr(QtCore, 'PYQT_VERSION_STR'):
-            qtWrapper = 'PyQt4'
-            qtVersion = QtCore.QT_VERSION_STR
-            qtWrapperVersion = QtCore.PYQT_VERSION_STR
-        else:
-            import PySide
-            qtWrapper = 'PySide'
-            qtVersion = QtCore.__version__
-            qtWrapperVersion = PySide.__version__
+        qtWrapper = qt.API_NAME
+        qtVersion = qt.QT_VERSION
+        qtWrapperVersion = qt.PYSIDE_VERSION or qt.PYQT_VERSION
         # Insert information texts
         if paths.is_frozen():
             versionText = pyzo.__version__ + ' (binary)'
diff --git a/pyzo/core/main.py b/pyzo/core/main.py
index f4f423b..c5ddc0b 100644
--- a/pyzo/core/main.py
+++ b/pyzo/core/main.py
@@ -337,7 +337,7 @@ class MainWindow(QtWidgets.QMainWindow):
         # Set palette
         if qstyle:
             if useStandardStyle:
-                QtWidgets.qApp.setPalette(QtGui.QStyle.standardPalette(qstyle))
+                QtWidgets.qApp.setPalette(QtWidgets.QStyle.standardPalette(qstyle))
             else:
                 QtWidgets.qApp.setPalette(QtWidgets.qApp.nativePalette)
         
diff --git a/pyzo/tools/pyzoFileBrowser/browser.py b/pyzo/tools/pyzoFileBrowser/browser.py
index 1a67ee1..4926868 100644
--- a/pyzo/tools/pyzoFileBrowser/browser.py
+++ b/pyzo/tools/pyzoFileBrowser/browser.py
@@ -268,7 +268,7 @@ class LineEditWithToolButtons(QtWidgets.QLineEdit):
         
         # Set minimum size
         if not light:
-            fw = QtWidgets.qApp.style().pixelMetric(QtGui.QStyle.PM_DefaultFrameWidth)
+            fw = QtWidgets.qApp.style().pixelMetric(QtWidgets.QStyle.PM_DefaultFrameWidth)
             msz = self.minimumSizeHint()
             w = max(msz.width(), paddingLeft + paddingRight + 10)
             h = max(msz.height(), height + fw*2 + 2)
diff --git a/pyzo/util/bootstrapconda.py b/pyzo/util/bootstrapconda.py
index 0c39bb3..befe300 100644
--- a/pyzo/util/bootstrapconda.py
+++ b/pyzo/util/bootstrapconda.py
@@ -117,7 +117,7 @@ class Installer(QtWidgets.QDialog):
         
         self._label = QtWidgets.QLabel(text, self)
         
-        self._scipystack = QtWidgets.QCheckBox(translate('bootstrapconda', 'Also install scientific packages', self))
+        self._scipystack = QtWidgets.QCheckBox(translate('bootstrapconda', 'Also install scientific packages'), self)
         self._scipystack.setChecked(True)
         self._path = QtWidgets.QLineEdit(default_conda_dir, self)
         self._progress = QtWidgets.QProgressBar(self)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pyzo.git



More information about the debian-science-commits mailing list