Skip to content
Permalink
Browse files
Fix formatting of exception blocks in PyQGIS docs
  • Loading branch information
nyalldawson committed Jun 10, 2021
1 parent fa6bc1e commit 835928101213484c23f46e5c91b8329102478534
Showing with 381 additions and 181 deletions.
  1. +2 −2 python/core/auto_generated/geometry/qgscurvepolygon.sip.in
  2. +35 −21 python/core/auto_generated/geometry/qgsgeometry.sip.in
  3. +11 −5 python/core/auto_generated/geometry/qgsgeometrycollection.sip.in
  4. +28 −20 python/core/auto_generated/geometry/qgslinestring.sip.in
  5. +1 −1 python/core/auto_generated/geometry/qgsmulticurve.sip.in
  6. +1 −1 python/core/auto_generated/geometry/qgsmultilinestring.sip.in
  7. +1 −1 python/core/auto_generated/geometry/qgsmultipoint.sip.in
  8. +1 −1 python/core/auto_generated/geometry/qgsmultipolygon.sip.in
  9. +1 −1 python/core/auto_generated/geometry/qgsmultisurface.sip.in
  10. +12 −28 python/core/auto_generated/qgsfeature.sip.in
  11. +1 −1 python/core/auto_generated/qgsfield.sip.in
  12. +27 −6 python/core/auto_generated/qgsfields.sip.in
  13. +2 −1 python/core/auto_generated/qgspathresolver.sip.in
  14. +3 −2 python/core/auto_generated/qgsspatialindex.sip.in
  15. +9 −3 python/core/auto_generated/symbology/qgssymbol.sip.in
  16. +3 −0 python/core/auto_generated/textrenderer/qgstextblock.sip.in
  17. +3 −0 python/core/auto_generated/textrenderer/qgstextdocument.sip.in
  18. +2 −2 src/core/geometry/qgscurvepolygon.h
  19. +28 −21 src/core/geometry/qgsgeometry.h
  20. +9 −5 src/core/geometry/qgsgeometrycollection.h
  21. +23 −20 src/core/geometry/qgslinestring.h
  22. +1 −1 src/core/geometry/qgsmulticurve.h
  23. +1 −1 src/core/geometry/qgsmultilinestring.h
  24. +1 −1 src/core/geometry/qgsmultipoint.h
  25. +1 −1 src/core/geometry/qgsmultipolygon.h
  26. +1 −1 src/core/geometry/qgsmultisurface.h
  27. +70 −16 src/core/qgsfeature.h
  28. +1 −1 src/core/qgsfield.h
  29. +68 −9 src/core/qgsfields.h
  30. +2 −1 src/core/qgspathresolver.h
  31. +3 −2 src/core/qgsspatialindex.h
  32. +9 −3 src/core/symbology/qgssymbol.h
  33. +10 −1 src/core/textrenderer/qgstextblock.h
  34. +10 −1 src/core/textrenderer/qgstextdocument.h
@@ -95,7 +95,7 @@ Returns the curve polygon's exterior ring.
%Docstring
Retrieves an interior ring from the curve polygon. The first interior ring has index 0.

An IndexError will be raised if no interior ring with the specified index exists.
:raises IndexError: if no interior ring with the specified index exists.

.. seealso:: :py:func:`numInteriorRings`

@@ -151,7 +151,7 @@ Removes an interior ring from the polygon. The first interior ring has index 0.
The corresponding ring is removed from the polygon and deleted.
It is not possible to remove the exterior ring using this method.

An IndexError will be raised if no interior ring with the specified index exists.
:raises IndexError: if no interior ring with the specified index exists.

.. seealso:: :py:func:`removeInteriorRings`
%End
@@ -1694,9 +1694,11 @@ Returns a list of ``count`` random points generated inside a (multi)polygon geom
Optionally, a specific random ``seed`` can be used when generating points. If ``seed``
is 0, then a completely random sequence of points will be generated.

This method works only with (multi)polygon geometry types. If the geometry
is not a polygon type, a TypeError will be raised. If the geometry
is null, a ValueError will be raised.
This method works only with (multi)polygon geometry types.

:raises TypeError: if the geometry is not a polygon type

:raises ValueError: if the geometry is null

.. versionadded:: 3.10
%End
@@ -1823,9 +1825,11 @@ Returns the contents of the geometry as a 2-dimensional point.

Any z or m values present in the geometry will be discarded.

This method works only with single-point geometry types. If the geometry
is not a single-point type, a TypeError will be raised. If the geometry
is null, a ValueError will be raised.
This method works only with single-point geometry types.

:raises TypeError: if the geometry is not a single-point type

:raises ValueError: if the geometry is null
%End
%MethodCode
const QgsWkbTypes::Type type = sipCpp->wkbType();
@@ -1853,9 +1857,11 @@ Returns the contents of the geometry as a polyline.
Any z or m values present in the geometry will be discarded. If the geometry is a curved line type
(such as a CircularString), it will be automatically segmentized.

This method works only with single-line (or single-curve) geometry types. If the geometry
is not a single-line type, a TypeError will be raised. If the geometry is null, a ValueError
will be raised.
This method works only with single-line (or single-curve).

:raises TypeError: if the geometry is not a single-line type

:raises ValueError: if the geometry is null
%End
%MethodCode
const QgsWkbTypes::Type type = sipCpp->wkbType();
@@ -1884,9 +1890,11 @@ Returns the contents of the geometry as a polygon.
Any z or m values present in the geometry will be discarded. If the geometry is a curved polygon type
(such as a CurvePolygon), it will be automatically segmentized.

This method works only with single-polygon (or single-curve polygon) geometry types. If the geometry
is not a single-polygon type, a TypeError will be raised. If the geometry is null, a ValueError
will be raised.
This method works only with single-polygon (or single-curve polygon) geometry types.

:raises TypeError: if the geometry is not a single-polygon type

:raises ValueError: if the geometry is null
%End
%MethodCode
const QgsWkbTypes::Type type = sipCpp->wkbType();
@@ -1914,9 +1922,11 @@ Returns the contents of the geometry as a multi-point.

Any z or m values present in the geometry will be discarded.

This method works only with multi-point geometry types. If the geometry
is not a multi-point type, a TypeError will be raised. If the geometry is null, a ValueError
will be raised.
This method works only with multi-point geometry types.

:raises TypeError: if the geometry is not a multi-point type

:raises ValueError: if the geometry is null
%End
%MethodCode
const QgsWkbTypes::Type type = sipCpp->wkbType();
@@ -1945,9 +1955,11 @@ Returns the contents of the geometry as a multi-linestring.
Any z or m values present in the geometry will be discarded. If the geometry is a curved line type
(such as a MultiCurve), it will be automatically segmentized.

This method works only with multi-linestring (or multi-curve) geometry types. If the geometry
is not a multi-linestring type, a TypeError will be raised. If the geometry is null, a ValueError
will be raised.
This method works only with multi-linestring (or multi-curve) geometry types.

:raises TypeError: if the geometry is not a multi-linestring type

:raises ValueError: if the geometry is null
%End
%MethodCode
const QgsWkbTypes::Type type = sipCpp->wkbType();
@@ -1976,9 +1988,11 @@ Returns the contents of the geometry as a multi-polygon.
Any z or m values present in the geometry will be discarded. If the geometry is a curved polygon type
(such as a MultiSurface), it will be automatically segmentized.

This method works only with multi-polygon (or multi-curve polygon) geometry types. If the geometry
is not a multi-polygon type, a TypeError will be raised. If the geometry is null, a ValueError
will be raised.
This method works only with multi-polygon (or multi-curve polygon) geometry types.

:raises TypeError: if the geometry is not a multi-polygon type

:raises ValueError: if the geometry is null
%End
%MethodCode
const QgsWkbTypes::Type type = sipCpp->wkbType();
@@ -69,7 +69,9 @@ Returns the number of geometries within the collection.
%Docstring
Returns a geometry from within the collection.

:param n: index of geometry to return. An IndexError will be raised if no geometry with the specified index exists.
:param n: index of geometry to return.

:raises IndexError: if no geometry with the specified index exists.
%End
%MethodCode
if ( a0 < 0 || a0 >= sipCpp->numGeometries() )
@@ -133,9 +135,9 @@ Inserts a geometry before a specified index and takes ownership. Returns ``True`
%Docstring
Removes a geometry from the collection by index.

An IndexError will be raised if no geometry with the specified index exists.

:return: ``True`` if removal was successful.

:raises IndexError: if no geometry with the specified index exists.
%End
%MethodCode
const int count = sipCpp->numGeometries();
@@ -256,11 +258,13 @@ Returns a geometry without curves. Caller takes ownership

SIP_PYOBJECT __getitem__( int index ) /TypeHint="QgsAbstractGeometry"/;
%Docstring
Returns the geometry at the specified ``index``. An IndexError will be raised if no geometry with the specified ``index`` exists.
Returns the geometry at the specified ``index``.

Indexes can be less than 0, in which case they correspond to geometries from the end of the collect. E.g. an index of -1
corresponds to the last geometry in the collection.

:raises IndexError: if no geometry with the specified ``index`` exists.

.. versionadded:: 3.6
%End
%MethodCode
@@ -282,11 +286,13 @@ corresponds to the last geometry in the collection.

void __delitem__( int index );
%Docstring
Deletes the geometry at the specified ``index``. A geometry at the ``index`` must already exist or an IndexError will be raised.
Deletes the geometry at the specified ``index``.

Indexes can be less than 0, in which case they correspond to geometries from the end of the collection. E.g. an index of -1
corresponds to the last geometry in the collection.

:raises IndexError: if no geometry at the ``index`` exists

.. versionadded:: 3.6
%End
%MethodCode
@@ -274,10 +274,12 @@ Returns a new linestring from a QPolygonF ``polygon`` input.

SIP_PYOBJECT pointN( int i ) const /TypeHint="QgsPoint"/;
%Docstring
Returns the point at the specified index. An IndexError will be raised if no point with the specified index exists.
Returns the point at the specified index.

Indexes can be less than 0, in which case they correspond to positions from the end of the line. E.g. an index of -1
corresponds to the last point in the line.

:raises IndexError: if no point with the specified index exists.
%End
%MethodCode
const int count = sipCpp->numPoints();
@@ -303,10 +305,10 @@ corresponds to the last point in the line.
%Docstring
Returns the x-coordinate of the specified node in the line string.

An IndexError will be raised if no point with the specified index exists.

Indexes can be less than 0, in which case they correspond to positions from the end of the line. E.g. an index of -1
corresponds to the last point in the line.

:raises IndexError: if no point with the specified index exists.
%End
%MethodCode
const int count = sipCpp->numPoints();
@@ -330,10 +332,10 @@ corresponds to the last point in the line.
%Docstring
Returns the y-coordinate of the specified node in the line string.

An IndexError will be raised if no point with the specified index exists.

Indexes can be less than 0, in which case they correspond to positions from the end of the line. E.g. an index of -1
corresponds to the last point in the line.

:raises IndexError: if no point with the specified index exists.
%End
%MethodCode
const int count = sipCpp->numPoints();
@@ -360,12 +362,12 @@ corresponds to the last point in the line.
%Docstring
Returns the z-coordinate of the specified node in the line string.

An IndexError will be raised if no point with the specified index exists.

If the LineString does not have a z-dimension then ``nan`` will be returned.

Indexes can be less than 0, in which case they correspond to positions from the end of the line. E.g. an index of -1
corresponds to the last point in the line.

:raises IndexError: if no point with the specified index exists.
%End
%MethodCode
const int count = sipCpp->numPoints();
@@ -388,12 +390,12 @@ corresponds to the last point in the line.
%Docstring
Returns the m-coordinate of the specified node in the line string.

An IndexError will be raised if no point with the specified index exists.

If the LineString does not have a m-dimension then ``nan`` will be returned.

Indexes can be less than 0, in which case they correspond to positions from the end of the line. E.g. an index of -1
corresponds to the last point in the line.

:raises IndexError: if no point with the specified index exists.
%End
%MethodCode
const int count = sipCpp->numPoints();
@@ -417,11 +419,11 @@ corresponds to the last point in the line.
Sets the x-coordinate of the specified node in the line string.
The corresponding node must already exist in line string.

An IndexError will be raised if no point with the specified index exists.

Indexes can be less than 0, in which case they correspond to positions from the end of the line. E.g. an index of -1
corresponds to the last point in the line.

:raises IndexError: if no point with the specified index exists.

.. seealso:: :py:func:`xAt`
%End
%MethodCode
@@ -446,11 +448,11 @@ corresponds to the last point in the line.
Sets the y-coordinate of the specified node in the line string.
The corresponding node must already exist in line string.

An IndexError will be raised if no point with the specified index exists.

Indexes can be less than 0, in which case they correspond to positions from the end of the line. E.g. an index of -1
corresponds to the last point in the line.

:raises IndexError: if no point with the specified index exists.

.. seealso:: :py:func:`yAt`
%End
%MethodCode
@@ -475,11 +477,11 @@ corresponds to the last point in the line.
Sets the z-coordinate of the specified node in the line string.
The corresponding node must already exist in line string and the line string must have z-dimension.

An IndexError will be raised if no point with the specified index exists.

Indexes can be less than 0, in which case they correspond to positions from the end of the line. E.g. an index of -1
corresponds to the last point in the line.

:raises IndexError: if no point with the specified index exists.

.. seealso:: :py:func:`zAt`
%End
%MethodCode
@@ -504,11 +506,11 @@ corresponds to the last point in the line.
Sets the m-coordinate of the specified node in the line string.
The corresponding node must already exist in line string and the line string must have m-dimension.

An IndexError will be raised if no point with the specified index exists.

Indexes can be less than 0, in which case they correspond to positions from the end of the line. E.g. an index of -1
corresponds to the last point in the line.

:raises IndexError: if no point with the specified index exists.

.. seealso:: :py:func:`mAt`
%End
%MethodCode
@@ -736,11 +738,13 @@ of the curve.

SIP_PYOBJECT __getitem__( int index ) /TypeHint="QgsPoint"/;
%Docstring
Returns the point at the specified ``index``. An IndexError will be raised if no point with the specified ``index`` exists.
Returns the point at the specified ``index``.

Indexes can be less than 0, in which case they correspond to positions from the end of the line. E.g. an index of -1
corresponds to the last point in the line.

:raises IndexError: if no point with the specified ``index`` exists.

.. versionadded:: 3.6
%End
%MethodCode
@@ -763,11 +767,13 @@ corresponds to the last point in the line.

void __setitem__( int index, const QgsPoint &point );
%Docstring
Sets the point at the specified ``index``. A point at the ``index`` must already exist or an IndexError will be raised.
Sets the point at the specified ``index``.

Indexes can be less than 0, in which case they correspond to positions from the end of the line. E.g. an index of -1
corresponds to the last point in the line.

:raises IndexError: if no point with the specified ``index`` exists.

.. versionadded:: 3.6
%End
%MethodCode
@@ -793,11 +799,13 @@ corresponds to the last point in the line.

void __delitem__( int index );
%Docstring
Deletes the vertex at the specified ``index``. A point at the ``index`` must already exist or an IndexError will be raised.
Deletes the vertex at the specified ``index``.

Indexes can be less than 0, in which case they correspond to positions from the end of the line. E.g. an index of -1
corresponds to the last point in the line.

:raises IndexError: if no point with the specified ``index`` exists.

.. versionadded:: 3.6
%End
%MethodCode
@@ -28,7 +28,7 @@ Multi curve geometry collection.
%Docstring
Returns the curve with the specified ``index``.

An IndexError will be raised if no curve with the specified index exists.
:raises IndexError: if no curve with the specified index exists.

.. versionadded:: 3.16
%End
@@ -33,7 +33,7 @@ Constructor for an empty multilinestring geometry.
%Docstring
Returns the line string with the specified ``index``.

An IndexError will be raised if no line string with the specified index exists.
:raises IndexError: if no line string with the specified index exists.

.. versionadded:: 3.16
%End
@@ -31,7 +31,7 @@ Constructor for an empty multipoint geometry.
%Docstring
Returns the point with the specified ``index``.

An IndexError will be raised if no point with the specified index exists.
:raises IndexError: if no point with the specified index exists.

.. versionadded:: 3.16
%End
@@ -33,7 +33,7 @@ Constructor for an empty multipolygon geometry.
%Docstring
Returns the polygon with the specified ``index``.

An IndexError will be raised if no polygon with the specified index exists.
:raises IndexError: if no polygon with the specified index exists.

.. versionadded:: 3.16
%End
@@ -33,7 +33,7 @@ Constructor for an empty multisurface geometry.
%Docstring
Returns the surface with the specified ``index``.

An IndexError will be raised if no surface with the specified index exists.
:raises IndexError: if no surface with the specified index exists.

.. versionadded:: 3.16
%End

0 comments on commit 8359281

Please sign in to comment.