[pyzo] 62/68: Fix freezing on Win with PyQt5
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Wed Sep 28 09:47:16 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 14375f1c12ba47a35e337fdf9dba4f199b66a8ec
Author: Almar Klein <almar.klein at gmail.com>
Date: Tue Sep 27 11:21:49 2016 +0200
Fix freezing on Win with PyQt5
---
freezeScript.py | 8 ++++++++
pyzo/__init__.py | 3 +++
2 files changed, 11 insertions(+)
diff --git a/freezeScript.py b/freezeScript.py
index 7ea574e..e356d70 100755
--- a/freezeScript.py
+++ b/freezeScript.py
@@ -253,6 +253,14 @@ with open(os.path.join(distDir, '_settings', 'README.txt'), 'wb') as file:
## Post processing
+# Copy Qt platform plugins
+if sys.platform.startswith('win') and QT_API == 'PyQt5':
+ src_dir = os.path.join(sys.prefix, 'Library', 'plugins', 'platforms')
+ for fname in os.listdir(src_dir):
+ if fname.endswith('.dll'):
+ shutil.copy2(os.path.join(src_dir, fname),
+ os.path.join(distDir, fname))
+
# Set search path of dynamic libraries
import dllutils
if sys.platform.startswith('linux'):
diff --git a/pyzo/__init__.py b/pyzo/__init__.py
index cde5bc5..841c438 100644
--- a/pyzo/__init__.py
+++ b/pyzo/__init__.py
@@ -84,6 +84,9 @@ os.environ['PYZO_PREFIX'] = sys.prefix
_is_pyqt4 = hasattr(QtCore, 'PYQT_VERSION_STR')
os.environ['PYZO_QTLIB'] = 'PyQt4' if _is_pyqt4 else 'PySide'
+# Let Windows find platform plugins
+if sys.platform.startswith('win'):
+ os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = sys.prefix
class MyApp(QtWidgets.QApplication):
""" So we an open .py files on OSX.
--
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