[Qgis-developer] Python unit tests and SIP API version

Chris Crook ccrook at linz.govt.nz
Tue Jun 18 12:59:30 PDT 2013


Ok I've found it at

http://stackoverflow.com/questions/6238193/pyqt-new-api-with-python-2

Looks like I need to add

import sip
API_NAMES = ["QDate", "QDateTime", "QString", "QTextStream", "QTime", "QUrl", "QVariant"]
API_VERSION = 2
for name in API_NAMES:
    sip.setapi(name, API_VERSION)

before importing from PyQt4.QtCore.  And also to not try and import QString.

Seems to be working..

Chris

> -----Original Message-----
> From: Chris Crook
> Sent: Wednesday, 19 June 2013 6:15 a.m.
> To: qgis-developer at lists.osgeo.org
> Subject: [Qgis-developer] Python unit tests and SIP API version
>
> Hi
>
> Currently when I run make the unit tests (unbuntu) the delimited text
> python tests are running under SIP API version 1, or possibly some sort of
> strange mixture, and seem to be failing.  So if I do
>
> from PyQt4.QtCore import QVariant
> import sip
>
> print sip.getapi('QVariant')
>
> I get '1'.  I see sip as a setapi function, which I guess I should be using to set
> the API I want.  Anyone know how to use it?
>
> Thanks
> Chris
>
> This message contains information, which is confidential and may be
> subject to legal privilege. If you are not the intended recipient, you must
> not peruse, use, disseminate, distribute or copy this message. If you have
> received this message in error, please notify us immediately (Phone 0800
> 665 463 or info at linz.govt.nz) and destroy the original message. LINZ accepts
> no responsibility for changes to this email, or for any attachments, after its
> transmission from LINZ. Thank You.


This message contains information, which is confidential and may be subject to legal privilege. If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info at linz.govt.nz) and destroy the original message. LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ. Thank You.


More information about the Qgis-developer mailing list