From 1620dee54830d88f769dfa2aa9d34eff2161f156 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 6 Jun 2011 06:56:34 -0600 Subject: [PATCH] Clean up Qt plugins dir in windows build --- setup/installer/windows/freeze.py | 4 ++++ src/calibre/test_build.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/setup/installer/windows/freeze.py b/setup/installer/windows/freeze.py index e67f75f9b0..59d08cea64 100644 --- a/setup/installer/windows/freeze.py +++ b/setup/installer/windows/freeze.py @@ -197,6 +197,10 @@ class Win32Freeze(Command, WixMixIn): if os.path.exists(tg): shutil.rmtree(tg) shutil.copytree(imfd, tg) + for dirpath, dirnames, filenames in os.walk(tdir): + for x in filenames: + if not x.endswith('.dll'): + os.remove(self.j(dirpath, x)) print print 'Adding third party dependencies' diff --git a/src/calibre/test_build.py b/src/calibre/test_build.py index 0610f01805..4d45077b93 100644 --- a/src/calibre/test_build.py +++ b/src/calibre/test_build.py @@ -65,7 +65,8 @@ def test_sqlite(): def test_qt(): from PyQt4.Qt import (QWebView, QDialog, QImageReader, QNetworkAccessManager) fmts = set(map(unicode, QImageReader.supportedImageFormats())) - if 'jpg' not in fmts or 'png' not in fmts: + testf = set(['jpg', 'png', 'mng', 'svg', 'ico', 'gif']) + if testf.intersection(fmts) != testf: raise RuntimeError( "Qt doesn't seem to be able to load its image plugins") QWebView, QDialog