Skip to content

Commit 8d0803c

Browse files
author
stonebig
committed
qt5 fix
1 parent 197a5f5 commit 8d0803c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

winpython/wppm.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,22 +449,24 @@ def install(self, package, install_options=None):
449449

450450
def handle_specific_packages(self, package):
451451
"""Packages requiring additional configuration"""
452-
if package.name in ('PyQt', 'PyQt4'):
452+
if package.name.lower() in ('pyqt4', 'pyqt5'):
453453
# Qt configuration file (where to find Qt)
454454
name = 'qt.conf'
455455
contents = """[Paths]
456456
Prefix = .
457457
Binaries = ."""
458458
self.create_file(package, name,
459-
osp.join('Lib', 'site-packages', 'PyQt4'),
459+
osp.join('Lib', 'site-packages', package.name),
460460
contents)
461461
self.create_file(package, name, '.',
462-
contents.replace('.', './Lib/site-packages/PyQt4'))
462+
contents.replace('.', './Lib/site-packages/%s' % package.name))
463463
# pyuic script
464-
self.create_file(package, 'pyuic4.bat', 'Scripts', r'''@echo off
465-
python "%WINPYDIR%\Lib\site-packages\PyQt4\uic\pyuic.py" %1 %2 %3 %4 %5 %6 %7 %8 %9''')
464+
self.create_file(package, 'pyuic%s.bat' % package.name[-1],
465+
'Scripts', r'''@echo off
466+
python "%WINPYDIR%\Lib\site-packages\%s\uic\pyuic.py" %1 %2 %3 %4 %5 %6 %7 %8 %9'''
467+
% package.name)
466468
# Adding missing __init__.py files (fixes Issue 8)
467-
uic_path = osp.join('Lib', 'site-packages', 'PyQt4', 'uic')
469+
uic_path = osp.join('Lib', 'site-packages', package.name, 'uic')
468470
for dirname in ('Loader', 'port_v2', 'port_v3'):
469471
self.create_file(package, '__init__.py',
470472
osp.join(uic_path, dirname), '')

0 commit comments

Comments
 (0)