[PyKDE] Conditional SIP processing based on the PyQt version

Gerard Vermeulen gvermeul at grenoble.cnrs.fr
Fri Jan 23 09:27:01 GMT 2004


On Thu, 22 Jan 2004 13:14:18 -0800
"Tuvi, Selim" <stuvi at SLAC.Stanford.EDU> wrote:

> Hi, I noticed that beginning with PyQt 3.9 the sip files are divided into
> subdirectories. We have a SIP interface where we need to import some of the
> core SIP files from the PyQt distribution. But I don't want to break the
> compilation in case the code is compiled against an old version of PyQt. I
> tried modifying the sip.exe command line to add -I c:/PyQt/sip/qt and -I
> c:/PyQt/sip/qtcanvas in addition to -I c:/Pyqt/sip but that gives an error
> saying that qtmod is already defined. So I want to do something like:
> 
> %If (- PyQt_3_9)
> %Import qtmod.sip
> %Import qtcanvasmod.sip
> %End
> 
> %If (PyQt_3_9 -)
> %Import qt/qtmod.sip
> %Import qtcanvas/qtcanvasmod.sip
> %End
>
You can define OLD_SIP and NEW_SIP as features:

%Feature OLD_SIP
%Feature NEW_SIP

and do:

%If (OLD_SIP)
...
%End

%If (NEW_SIP)
...
%END

But for PyQwt, I did not do that because the new and old sip languages
are too different for my taste. (snapshot at http://pyqwt.sourceforge.net)

Gerard  




More information about the PyQt mailing list