Re: [Qgis-developer] Missing next() method in Python 3 QgsFeatureIterator in master

2016-07-01 Thread Matthias Kuhn
On 07/01/2016 12:34 PM, Alessandro Pasotti wrote:
> Thanks!
> 
> I thought that the RefactoringTool: was taking care of that.

I guess you are referring to -DPORT_PLUGINS=ON (which is enabled on
travis/py3).


> Isn't the 2to3 run automatically on the test python files too?

No.
Actually it would be better if it wouldn't even run on plugins, but that
would mean that it would have to be run on their source and that might
potentially break them for python 2. Since plugins miss comprehensive
tests (and most of them miss tests at all) that would point out issues
and since python 2 is our current stable target that's too much risk.
Tests on the other hand have a pretty good test coverage inherently, so
they can be ported statically.

Matthias
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Missing next() method in Python 3 QgsFeatureIterator in master

2016-07-01 Thread Alessandro Pasotti
Thanks!

I thought that the RefactoringTool: was taking care of that.

Isn't the 2to3 run automatically on the test python files too?

In my case the error was not directly in a test but in a file imported by a
test: offlineditingtestbase.py is that the reason why it was not refactored?



2016-07-01 12:15 GMT+02:00 Matthias Kuhn :

> Hi Alessandro
>
>
> On 07/01/2016 11:59 AM, Alessandro Pasotti wrote:
> > Hi,
> >
> > I'm trying to adapt a test to Py3/Qt5 and I get this odd error:
> >
> > AttributeError: 'QgsFeatureIterator' object has no attribute 'next'
>
>
> ./scripts/2to3
>
> is your friend
>
> http://stackoverflow.com/a/12274637/2319028
>
> Matthias
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer




-- 
Alessandro Pasotti
w3:   www.itopen.it
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Missing next() method in Python 3 QgsFeatureIterator in master

2016-07-01 Thread Matthias Kuhn
Hi Alessandro


On 07/01/2016 11:59 AM, Alessandro Pasotti wrote:
> Hi,
> 
> I'm trying to adapt a test to Py3/Qt5 and I get this odd error:
> 
> AttributeError: 'QgsFeatureIterator' object has no attribute 'next'


./scripts/2to3

is your friend

http://stackoverflow.com/a/12274637/2319028

Matthias
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Missing next() method in Python 3 QgsFeatureIterator in master

2016-07-01 Thread Alessandro Pasotti
Hi,

I'm trying to adapt a test to Py3/Qt5 and I get this odd error:

AttributeError: 'QgsFeatureIterator' object has no attribute 'next'

The C++-like call works fine:

fit=layer.dataProvider().getFeatures(request)
f=QgsFeature()
fit.nextFeature(f)
True


the layer is a test layer:
layer.dataProvider().dataSourceUri()
"dbname='/tmp/tmp57y5_gmm/offlineDbFile.sqlite'
table='wfs_test_point20160701113316894'(Geometry) sql="

Same error in python console with a shapefile layer.

Any idea?


-- 
Alessandro Pasotti
w3:   www.itopen.it
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer