Hi,

I'm trying package my PyQt app to one file, but I'm getting the
following error:

----
Z:\tmp\pyinstaller-py26win>python Build.py webkit_example
\webkit_example.spec
I: Dependent assemblies of C:\Python26\python.exe:
I: x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww
checking Analysis
checking PYZ
checking PKG
building because outPKG3.toc missing or bad
building PKG outPKG3.pkg
Cannot find ('QtWebKit4.dll', 'bincache01\qtwebkit4.dll', 1, 'b')
Traceback (most recent call last):
  File "Build.py", line 1368, in <module>
    main(args[0], configfilename=opts.configfile)
  File "Build.py", line 1346, in main
    build(specfile)
  File "Build.py", line 1306, in build
    execfile(spec)
  File "webkit_example\webkit_example.spec", line 14, in <module>
    console=True )
  File "Build.py", line 796, in __init__
    strip_binaries=self.strip, upx_binaries=self.upx, crypt=self.crypt)
  File "Build.py", line 688, in __init__
    self.__postinit__()
  File "Build.py", line 258, in __postinit__
    self.assemble()
  File "Build.py", line 749, in assemble
    archive.build(self.name, mytoc)
  File "Z:\tmp\pyinstaller-py26win\archive.py", line 229, in build
    self.add(tocentry)   # the guts of the archive
  File "Z:\tmp\pyinstaller-py26win\carchive.py", line 235, in add
    s = open(pathnm, 'rb').read()
IOError: [Errno 22] Invalid argument

Z:\tmp\pyinstaller-py26win>
----

Some time ago I was able to build my app with webkit in onefile mode.
PyQt 4.7.3
Python 2.6.5

Attached is a small example using webkit and also failing with the same
error.

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyinstaller?hl=en.

#!/usr/bin/env python

import sys

from PyQt4 import QtCore, QtGui, QtWebKit


APPNAME = 'Embedded WebView on Canvas'
HTMLCODE = u"""
<html>
<head><style type="text/css"><!--
body {
    background-color: transparent;
}
.content {
    color: red;
    font-size: 4.5em;
    font-weight: bold;
    text-align: center;
}
--></style></head>
<body><div class="content">
This is content.
</div></body>
</html>
"""


def main():

    app = QtGui.QApplication(sys.argv)
    app.setApplicationName(APPNAME)
    scene = QtGui.QGraphicsScene()

    webview = QtWebKit.QWebView()
    webview.setHtml(HTMLCODE)

    # ensure transparent background
    palette = webview.palette()
    palette.setBrush(QtGui.QPalette.Base, QtCore.Qt.transparent)
    webview.page().setPalette(palette)
    #webview.setAttribute(Qt.WA_OpaquePaintEvent, False)
    webview.setAttribute(QtCore.Qt.WA_OpaquePaintEvent, True)

    proxy = QtGui.QGraphicsProxyWidget()
    proxy.setWidget(webview)
    rect = proxy.boundingRect()
    proxy.setPos(rect.width(), rect.height())
    proxy.show()
    scene.addItem(proxy)

    scene.setSceneRect(scene.itemsBoundingRect())

    view = QtGui.QGraphicsView()
    view.setScene(scene)

    # OpenGL rendering enabled.
    # OpenGL will speed up rendering and
    # decreases CPU utilization
    #view.setViewport(QGLWidget())

    view.setRenderHints(QtGui.QPainter.Antialiasing | QtGui.QPainter.SmoothPixmapTransform)
    view.setBackgroundBrush(QtGui.QBrush(QtGui.QColor('blue')))
    view.setCacheMode(QtGui.QGraphicsView.CacheBackground)
    view.setViewportUpdateMode(QtGui.QGraphicsView.BoundingRectViewportUpdate)
    view.show()
    view.setWindowTitle(APPNAME)
    view.resize(800, 150)

    app.exec_()


if __name__ == '__main__':
    main()

Reply via email to