Skip to content

Commit

Permalink
Minor improvements to PyQGIS returns for SIP_OUT params
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 4, 2019
1 parent 4b0f6b7 commit 384d310
Show file tree
Hide file tree
Showing 25 changed files with 60 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Calculates interpolation value for map coordinates x, y
:param feedback: optional feedback object for progress and cancelation support

:return: - 0 in case of success
- result: interpolation result
- result: interpolation result
%End


Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/expression/qgsexpression.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ Tests whether a string is a valid expression.
:param context: optional expression context

:return: - true if string is a valid expression
- errorMessage: will be filled with any error message from the validation
- errorMessage: will be filled with any error message from the validation

.. versionadded:: 2.12
%End
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ Returns next vertex id and coordinates
in this variable if found.

:return: - false if at end
- vertex: container for found node
- vertex: container for found node
%End

virtual void adjacentVertices( QgsVertexId vertex, QgsVertexId &previousVertex /Out/, QgsVertexId &nextVertex /Out/ ) const = 0;
Expand Down Expand Up @@ -348,7 +348,7 @@ Searches for the closest segment of the geometry to a given point.
:param epsilon: epsilon for segment snapping

:return: - squared distance to closest segment or negative value on error
- leftOf: indicates whether the point lies on the left side of the geometry (-1 if point is to the left of the geometry, +1 if the point is to the right of the geometry, or 0 for cases where left/right could not be determined, e.g. point exactly on a line) false if point is to right of segment)
- leftOf: indicates whether the point lies on the left side of the geometry (-1 if point is to the left of the geometry, +1 if the point is to the right of the geometry, or 0 for cases where left/right could not be determined, e.g. point exactly on a line) false if point is to right of segment)
%End


Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/geometry/qgscurve.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Returns the point and vertex id of a point within the curve.
:param type: will be set to the vertex type of the node

:return: - true if node exists within the curve
- point: will be set to point at corresponding node in the curve
- point: will be set to point at corresponding node in the curve
%End

virtual QgsCurve *reversed() const = 0 /Factory/;
Expand Down
6 changes: 3 additions & 3 deletions python/core/auto_generated/geometry/qgsgeometry.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ Searches for the closest vertex in this geometry to the given point.
:param point: Specifiest the point for search

:return: - The squared Cartesian distance is also returned in sqrDist, negative number on error
- atVertex: Receives index of the closest vertex
- atVertex: Receives index of the closest vertex
%End

double closestSegmentWithContext( const QgsPointXY &point, QgsPointXY &minDistPoint /Out/, int &afterVertex /Out/, int *leftOf /Out/ = 0, double epsilon = DEFAULT_SEGMENT_EPSILON ) const;
Expand All @@ -649,7 +649,7 @@ Searches for the closest segment of geometry to the given point
:param epsilon: epsilon for segment snapping

:return: - The squared Cartesian distance is also returned in sqrDist, negative number on error
- minDistPoint: Receives the nearest point on the segment
- minDistPoint: Receives the nearest point on the segment
%End

OperationResult addRing( const QVector<QgsPointXY> &ring );
Expand Down Expand Up @@ -822,7 +822,7 @@ Returns the minimal enclosing circle for the geometry.
:param segments: Number of segments used to segment geometry. :py:func:`QgsEllipse.toPolygon`

:return: - the minimal enclosing circle as a QGIS geometry
- center: Center of the minimal enclosing circle returneds
- center: Center of the minimal enclosing circle returneds

.. versionadded:: 3.0
%End
Expand Down
8 changes: 4 additions & 4 deletions python/core/auto_generated/geometry/qgsgeometryutils.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Retrieves the vertices which are before and after the interpolated point at a sp
:param previousVertex: will be set to previous vertex ID

:return: - true if vertices were successfully retrieved
- nextVertex: will be set to next vertex ID
- nextVertex: will be set to next vertex ID

.. note::

Expand Down Expand Up @@ -99,7 +99,7 @@ supported and is retrieved from the first 3D point amongst ``p1`` and
:param v2: Direction vector of the second line

:return: - Whether the lines intersect
- intersection: Output parameter, the intersection point
- intersection: Output parameter, the intersection point
%End

static bool segmentIntersection( const QgsPoint &p1, const QgsPoint &p2, const QgsPoint &q1, const QgsPoint &q2, QgsPoint &intersectionPoint /Out/, bool &isIntersection /Out/, double tolerance = 1e-8, bool acceptImproperIntersection = false );
Expand All @@ -115,7 +115,7 @@ Compute the intersection between two segments
:param acceptImproperIntersection: By default, this method returns true only if segments have proper intersection. If set true, returns also true if segments have improper intersection (end of one segment on other segment ; continuous segments).

:return: - Whether the segments intersect
- intersectionPoint: Output parameter, the intersection point
- intersectionPoint: Output parameter, the intersection point
* Example:
.. code-block:: python

Expand Down Expand Up @@ -598,7 +598,7 @@ An algorithm to calculate an (approximate) intersection of two lines in 3D.
:param Lb2: is the second point on the second line,

:return: - true if the intersection can be found, false - otherwise.
- intersection: is the result intersection, of it can be found.
- intersection: is the result intersection, of it can be found.
example:
.. code-block:: python

Expand Down
4 changes: 2 additions & 2 deletions python/core/auto_generated/qgsdistancearea.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ otherwise QgsPoint.project() will be called after QgsUnitTypes.fromUnitToUnitFac
:param azimuth: - azimuth in radians, clockwise from North

:return: - distance in mapUnits
- projectedPoint: calculated projected point
- projectedPoint: calculated projected point

.. seealso:: :py:func:`sourceCrs`

Expand Down Expand Up @@ -405,7 +405,7 @@ will also be in this same CRS.
:param p2: Ending point, in ellipsoidCrs()

:return: - the latitude at which the geodesic crosses the antimeridian
- fractionAlongLine: will be set to the fraction along the geodesic line joining ``p1`` to ``p2`` at which the antimeridian crossing occurs.
- fractionAlongLine: will be set to the fraction along the geodesic line joining ``p1`` to ``p2`` at which the antimeridian crossing occurs.

.. seealso:: :py:func:`splitGeometryAtAntimeridian`

Expand Down
14 changes: 7 additions & 7 deletions python/core/auto_generated/qgsmaplayer.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ record in the users style table in their personal qgis.db)


:return: - a QString with any status messages
- resultFlag: a reference to a flag that will be set to false if we did not manage to save the default metadata.
- resultFlag: a reference to a flag that will be set to false if we did not manage to save the default metadata.

.. versionadded:: 3.0
%End
Expand Down Expand Up @@ -689,7 +689,7 @@ record in the users style table in their personal qgis.db)
key matches the URI.

:return: - a QString with any status messages
- resultFlag: a reference to a flag that will be set to false if we did not manage to load the default metadata.
- resultFlag: a reference to a flag that will be set to false if we did not manage to load the default metadata.

.. versionadded:: 3.0
%End
Expand Down Expand Up @@ -752,7 +752,7 @@ record in the users style table in their personal qgis.db)


:return: - a QString with any status messages
- resultFlag: a reference to a flag that will be set to false if we did not manage to load the default style.
- resultFlag: a reference to a flag that will be set to false if we did not manage to load the default style.

.. seealso:: :py:func:`also`
%End
Expand All @@ -771,7 +771,7 @@ record in the users style table in their personal qgis.db)
:param categories: the style categories to be loaded.

:return: - a QString with any status messages
- resultFlag: a reference to a flag that will be set to false if we did not manage to load the default style.
- resultFlag: a reference to a flag that will be set to false if we did not manage to load the default style.

.. seealso:: :py:func:`also`
%End
Expand All @@ -784,7 +784,7 @@ Retrieve a named style for this layer from a sqlite database.
:param uri: uri for table

:return: - true if style was successfully loaded
- qml: will be set to QML style content from database
- qml: will be set to QML style content from database
%End

virtual bool importNamedStyle( QDomDocument &doc, QString &errorMsg /Out/,
Expand Down Expand Up @@ -832,7 +832,7 @@ record in the users style table in their personal qgis.db)


:return: - a QString with any status messages
- resultFlag: a reference to a flag that will be set to false if we did not manage to save the default style.
- resultFlag: a reference to a flag that will be set to false if we did not manage to save the default style.

.. seealso:: :py:func:`loadNamedStyle`
%End
Expand All @@ -851,7 +851,7 @@ record in the users style table in their personal qgis.db)
:param categories: the style categories to be saved.

:return: - a QString with any status messages
- resultFlag: a reference to a flag that will be set to false if we did not manage to save the default style.
- resultFlag: a reference to a flag that will be set to false if we did not manage to save the default style.

.. seealso:: :py:func:`saveDefaultStyle`
%End
Expand Down
12 changes: 6 additions & 6 deletions python/core/auto_generated/qgsproperty.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ Calculates the current value of the property, including any transforms which are
:param defaultValue: default value to return if the property is not active or cannot be calculated

:return: - calculated value for property
- ok: if specified, will be set to true if conversion was successful
- ok: will be set to true if conversion was successful

.. seealso:: :py:func:`valueAsString`

Expand All @@ -351,7 +351,7 @@ Calculates the current value of the property and interprets it as a string.
:param defaultString: default string to return if the property cannot be calculated as a string

:return: - value parsed to string
- ok: if specified, will be set to true if conversion was successful
- ok: will be set to true if conversion was successful

.. seealso:: :py:func:`value`

Expand All @@ -372,7 +372,7 @@ Calculates the current value of the property and interprets it as a color.
:param defaultColor: default color to return if the property cannot be calculated as a color

:return: - value parsed to color
- ok: if specified, will be set to true if conversion was successful
- ok: will be set to true if conversion was successful

.. seealso:: :py:func:`value`

Expand All @@ -393,7 +393,7 @@ Calculates the current value of the property and interprets it as a double.
:param defaultValue: default double to return if the property cannot be calculated as a double

:return: - value parsed to double
- ok: if specified, will be set to true if conversion was successful
- ok: will be set to true if conversion was successful

.. seealso:: :py:func:`value`

Expand All @@ -414,7 +414,7 @@ Calculates the current value of the property and interprets it as an integer.
:param defaultValue: default integer to return if the property cannot be calculated as an integer

:return: - value parsed to integer
- ok: if specified, will be set to true if conversion was successful
- ok: will be set to true if conversion was successful

.. seealso:: :py:func:`value`

Expand All @@ -435,7 +435,7 @@ Calculates the current value of the property and interprets it as an boolean.
:param defaultValue: default boolean to return if the property cannot be calculated as an boolean

:return: - value parsed to boolean
- ok: if specified, will be set to true if conversion was successful
- ok: will be set to true if conversion was successful

.. seealso:: :py:func:`value`

Expand Down
10 changes: 5 additions & 5 deletions python/core/auto_generated/qgspropertycollection.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Calculates the current value of the property with the specified key and interpre
:param defaultString: default string to return if the property cannot be calculated as a string

:return: - value parsed to string
- ok: if specified, will be set to true if conversion was successful
- ok: will be set to true if conversion was successful

.. seealso:: :py:func:`value`

Expand All @@ -142,7 +142,7 @@ Calculates the current value of the property with the specified key and interpre
:param defaultColor: default color to return if the property cannot be calculated as a color

:return: - value parsed to color
- ok: if specified, will be set to true if conversion was successful
- ok: will be set to true if conversion was successful

.. seealso:: :py:func:`value`

Expand All @@ -165,7 +165,7 @@ Calculates the current value of the property with the specified key and interpre
:param defaultValue: default double to return if the property cannot be calculated as a double

:return: - value parsed to double
- ok: if specified, will be set to true if conversion was successful
- ok: will be set to true if conversion was successful

.. seealso:: :py:func:`value`

Expand All @@ -188,7 +188,7 @@ Calculates the current value of the property with the specified key and interpre
:param defaultValue: default integer to return if the property cannot be calculated as a integer

:return: - value parsed to integer
- ok: if specified, will be set to true if conversion was successful
- ok: will be set to true if conversion was successful

.. seealso:: :py:func:`value`

Expand All @@ -211,7 +211,7 @@ Calculates the current value of the property with the specified key and interpre
:param defaultValue: default boolean to return if the property cannot be calculated as a boolean

:return: - value parsed to bool
- ok: if specified, will be set to true if conversion was successful
- ok: will be set to true if conversion was successful

.. seealso:: :py:func:`value`

Expand Down
6 changes: 3 additions & 3 deletions python/core/auto_generated/qgspropertytransformer.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ Attempts to parse an expression into a corresponding property transformer.
empty string if an expression is the transformer input.

:return: - corresponding property transformer, or None if expression could not
- baseExpression: will be set to the component of the source expression which is used to calculate the input to the property transformer. This will be set to an empty string if a field reference is the transformer input.
- baseExpression: will be set to the component of the source expression which is used to calculate the input to the property transformer. This will be set to an empty string if a field reference is the transformer input.
be parsed to a transformer.
%End

Expand Down Expand Up @@ -367,7 +367,7 @@ Attempts to parse an expression into a corresponding :py:class:`QgsSizeScaleTran
empty string if an expression is the transformer input.

:return: - corresponding :py:class:`QgsSizeScaleTransformer`, or None if expression could not
- baseExpression: will be set to the component of the source expression which is used to calculate the input to the property transformer. This will be set to an empty string if a field reference is the transformer input.
- baseExpression: will be set to the component of the source expression which is used to calculate the input to the property transformer. This will be set to an empty string if a field reference is the transformer input.
be parsed to a size scale transformer.
%End

Expand Down Expand Up @@ -514,7 +514,7 @@ Attempts to parse an expression into a corresponding QgsSizeScaleTransformer.
empty string if an expression is the transformer input.

:return: - corresponding QgsSizeScaleTransformer, or None if expression could not
- baseExpression: will be set to the component of the source expression which is used to calculate the input to the property transformer. This will be set to an empty string if a field reference is the transformer input.
- baseExpression: will be set to the component of the source expression which is used to calculate the input to the property transformer. This will be set to an empty string if a field reference is the transformer input.
be parsed to a size scale transformer.
%End

Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgstransaction.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Execute the ``sql`` string.
:param name: Name of the transaction ( only used if `isDirty` is true)

:return: - true if everything is OK, false otherwise
- error: The error message
- error: The error message
%End

static bool supportsTransaction( const QgsVectorLayer *layer );
Expand Down
14 changes: 7 additions & 7 deletions python/core/auto_generated/qgsunittypes.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Decodes a distance unit from a string.
:param string: string to decode

:return: - decoded units
- ok: optional boolean, will be set to true if string was converted successfully
- ok: boolean, will be set to true if string was converted successfully

.. seealso:: :py:func:`encodeUnit`
%End
Expand Down Expand Up @@ -186,7 +186,7 @@ Converts a translated string to a distance unit.
:param string: string representing a distance unit

:return: - the distance unit
- ok: optional boolean, will be set to true if string was converted successfully
- ok: boolean, will be set to true if string was converted successfully

.. seealso:: :py:func:`toString`
%End
Expand Down Expand Up @@ -225,7 +225,7 @@ Decodes an areal unit from a string.
:param string: string to decode

:return: - decoded units
- ok: optional boolean, will be set to true if string was converted successfully
- ok: boolean, will be set to true if string was converted successfully

.. seealso:: :py:func:`encodeUnit`
%End
Expand Down Expand Up @@ -257,7 +257,7 @@ Converts a translated string to an areal unit.
:param string: string representing an areal unit

:return: - the area unit
- ok: optional boolean, will be set to true if string was converted successfully
- ok: boolean, will be set to true if string was converted successfully

.. seealso:: :py:func:`toString`
%End
Expand Down Expand Up @@ -300,7 +300,7 @@ Decodes an angular unit from a string.
:param string: string to decode

:return: - decoded units
- ok: optional boolean, will be set to true if string was converted successfully
- ok: boolean, will be set to true if string was converted successfully

.. seealso:: :py:func:`encodeUnit`
%End
Expand Down Expand Up @@ -409,7 +409,7 @@ Decodes a render unit from a string.
:param string: string to decode

:return: - decoded units
- ok: optional boolean, will be set to true if string was converted successfully
- ok: boolean, will be set to true if string was converted successfully

.. seealso:: :py:func:`encodeUnit`
%End
Expand Down Expand Up @@ -443,7 +443,7 @@ Decodes a layout unit from a string.
:param string: string to decode

:return: - decoded units
- ok: optional boolean, will be set to true if string was converted successfully
- ok: boolean, will be set to true if string was converted successfully

.. seealso:: :py:func:`encodeUnit`

Expand Down
Loading

0 comments on commit 384d310

Please sign in to comment.