gdal/gdal-python-swig3-issue6045.patch

64 lines
2.9 KiB
Diff
Raw Normal View History

diff -rup a/swig/include/python/ogr_python.i b/swig/include/python/ogr_python.i
--- a/swig/include/python/ogr_python.i 2015-02-10 13:12:08.000000000 +0100
+++ b/swig/include/python/ogr_python.i 2015-08-28 11:51:02.955567700 +0200
@@ -66,9 +66,9 @@
def __getitem__(self, value):
"""Support dictionary, list, and slice -like access to the datasource.
-ds[0] would return the first layer on the datasource.
-ds['aname'] would return the layer named "aname".
-ds[0:4] would return a list of the first four layers."""
+ ds[0] would return the first layer on the datasource.
+ ds['aname'] would return the layer named "aname".
+ ds[0:4] would return a list of the first four layers."""
if isinstance(value, slice):
output = []
for i in xrange(value.start,value.stop,value.step):
@@ -134,8 +134,8 @@ ds[0:4] would return a list of the first
def __getitem__(self, value):
"""Support list and slice -like access to the layer.
-layer[0] would return the first feature on the layer.
-layer[0:4] would return a list of the first four features."""
+ layer[0] would return the first feature on the layer.
+ layer[0:4] would return a list of the first four features."""
if isinstance(value, slice):
import sys
output = []
@@ -400,7 +400,7 @@ layer[0:4] would return a list of the fi
def __reduce__(self):
return (self.__class__, (), self.ExportToWkb())
-
+
def __setstate__(self, state):
result = CreateGeometryFromWkb(state)
self.this = result.this
diff -rup a/swig/python/osgeo/ogr.py b/swig/python/osgeo/ogr.py
--- a/swig/python/osgeo/ogr.py 2015-02-10 13:12:08.000000000 +0100
+++ b/swig/python/osgeo/ogr.py 2015-08-28 11:54:46.775552596 +0200
@@ -815,9 +815,9 @@ class DataSource(_object):
def __getitem__(self, value):
"""Support dictionary, list, and slice -like access to the datasource.
- ] would return the first layer on the datasource.
- aname'] would return the layer named "aname".
- :4] would return a list of the first four layers."""
+ ds[0] would return the first layer on the datasource.
+ ds['aname'] would return the layer named "aname".
+ ds[0:4] would return a list of the first four layers."""
if isinstance(value, slice):
output = []
for i in xrange(value.start,value.stop,value.step):
@@ -2035,8 +2035,8 @@ class Layer(_object):
def __getitem__(self, value):
"""Support list and slice -like access to the layer.
- r[0] would return the first feature on the layer.
- r[0:4] would return a list of the first four features."""
+ layer[0] would return the first feature on the layer.
+ layer[0:4] would return a list of the first four features."""
if isinstance(value, slice):
import sys
output = []