415
415
QtSql4.dll QtTest4.dll QtWebKit4.dll QtXml4.dll
416
416
qscintilla2.dll""".split())
417
417
# the qt binaries might not be on PATH...
418
qt_dir = os.path.join(sys.prefix, "PyQt4", "bin")
419
if os.path.isdir(qt_dir):
420
path = os.environ.get("PATH","")
421
if qt_dir.lower() not in [p.lower() for p in path.split(os.pathsep)]:
422
os.environ["PATH"] = path + os.pathsep + qt_dir
423
# add imageformats plugins to distribution
418
# They seem to install to a place like C:\Python25\PyQt4\*
419
# Which is not the same as C:\Python25\Lib\site-packages\PyQt4
420
pyqt_dir = os.path.join(sys.prefix, "PyQt4")
421
pyqt_bin_dir = os.path.join(pyqt_dir, "bin")
422
if os.path.isdir(pyqt_bin_dir):
423
path = os.environ.get("PATH", "")
424
if pyqt_bin_dir.lower() not in [p.lower() for p in path.split(os.pathsep)]:
425
os.environ["PATH"] = path + os.pathsep + pyqt_bin_dir
426
# also add all imageformat plugins to distribution
427
# We will look in 2 places, dirname(PyQt4.__file__) and pyqt_dir
428
base_dirs_to_check = []
429
if os.path.isdir(pyqt_dir):
430
base_dirs_to_check.append(pyqt_dir)
426
433
except ImportError:
427
log.warn("Can't find PyQt4 installation -> skip imageformats plugins")
429
imageformats = 'imageformats'
430
plug_dir = os.path.join(os.path.dirname(PyQt4.__file__),
431
'plugins', imageformats)
432
if os.path.isdir(plug_dir):
434
for i in os.listdir(plug_dir):
435
if i.endswith('.dll') and not i.endswith('d4.dll'):
436
files.append(os.path.join(plug_dir,i))
438
data_files.append((imageformats, files))
436
pyqt4_base_dir = os.path.dirname(PyQt4.__file__)
437
if pyqt4_base_dir != pyqt_dir:
438
base_dirs_to_check.append(pyqt4_base_dir)
439
if not base_dirs_to_check:
440
log.warn("Can't find PyQt4 installation -> not including imageformat"
444
for base_dir in base_dirs_to_check:
445
plug_dir = os.path.join(base_dir, 'plugins', 'imageformats')
446
if os.path.isdir(plug_dir):
447
for fname in os.listdir(plug_dir):
448
# Include plugin dlls, but not debugging dlls
449
fullpath = os.path.join(plug_dir, fname)
450
if fname.endswith('.dll') and not fname.endswith('d4.dll'):
451
files.append(fullpath)
453
data_files.append(('imageformats', files))
455
log.warn('PyQt4 was found, but we could not find any imageformat'
456
' plugins. Are you sure your configuration is correct?')
441
459
def get_svn_py2exe_info(includes, excludes, packages):