I am having a problem where I need to run code before a RT hooks is run. Sorry for longer explanation --

       Background:

QtCore defines SIP wrapper around the c++ QString type, which is either a special QString type, or regular Python's str, depending on API version. The default is 1, but programs can set API version *before* PyQt4.QtCore gets imported by saying

    import sip
    sip.setapi('QString',2)

Similar logic works for QVariant, which is either exposed as QVariant type, or as Python tuple (see http://stackoverflow.com/questions/6238193/pyqt-new-api-with-python-2 for some details).


       Problem:

The rthooks/pyi_rth_qt4plugins.py hook imports PyQt4.QtCore. Because runtime hooks are run before any user code, calling sip.setapi('QString',2) fails, since API has been set through the PyQt4.QtCore import to its default value already (1).

What can I do? For now, I modified pyi_rth_qt4plugins.py by hand, but I would like to have a nicer solution. Can I sepcify a hook, which is run before this one automatically?

Cheers, Vaclav

--
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.

Reply via email to