Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[sipify] Correctly convert doxygen warning blocks to sphinx warnings
  • Loading branch information
nyalldawson committed Dec 23, 2017
1 parent 87b8a37 commit c7e37e8
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 10 deletions.
8 changes: 6 additions & 2 deletions python/core/geocms/geonode/qgsgeonoderequest.sip
Expand Up @@ -103,7 +103,9 @@ Any existing request will be aborted.

Calling this method does not block while waiting for a result.

\warning When using the non-blocking methods in this class, sending
.. warning::

When using the non-blocking methods in this class, sending
overlapping requests results in undefined behavior. Use separate instances
of QgsGeoNodeRequest instead to avoid this.

Expand All @@ -129,7 +131,9 @@ with the result.

This method is non-blocking and returns immediately.

\warning When using the non-blocking methods in this class, sending
.. warning::

When using the non-blocking methods in this class, sending
overlapping requests results in undefined behavior. Use separate instances
of QgsGeoNodeRequest instead to avoid this.

Expand Down
5 changes: 4 additions & 1 deletion python/core/locator/qgslocator.sip
Expand Up @@ -52,7 +52,10 @@ Destructor for QgsLocator. Destruction will block while any currently running qu
%Docstring
Registers a ``filter`` within the locator. Ownership of the filter is transferred to the
locator.
\warning Plugins which register filters to the locator must take care to correctly call

.. warning::

Plugins which register filters to the locator must take care to correctly call
deregisterFilter() and deregister their filters upon plugin unload to avoid crashes.

.. seealso:: :py:func:`deregisterFilter()`
Expand Down
4 changes: 3 additions & 1 deletion python/core/qgscoordinatetransform.sip
Expand Up @@ -65,7 +65,9 @@ to utilize.
Python scripts should generally use the constructor variant which accepts
a QgsProject instance instead of this constructor.

\warning Do NOT use an empty/default constructed QgsCoordinateTransformContext()
.. warning::

Do NOT use an empty/default constructed QgsCoordinateTransformContext()
object when creating QgsCoordinateTransform objects. This prevents correct
datum transform handling and may result in inaccurate transformations. Always
ensure that the QgsCoordinateTransformContext object is correctly retrieved
Expand Down
4 changes: 3 additions & 1 deletion python/core/qgscoordinatetransformcontext.sip
Expand Up @@ -79,7 +79,9 @@ The map keys will be :py:func:`QgsCoordinateReferenceSystems.authid()`s.
If either the source transform ID or destination transform ID is -1, then no datum transform is
required for transformations for that source or destination.

\warning This method should not be used to calculate the corresponding datum transforms
.. warning::

This method should not be used to calculate the corresponding datum transforms
to use for a coordinate transform. Instead, always use calculateDatumTransforms()
to determine this.

Expand Down
9 changes: 7 additions & 2 deletions python/core/symbology/qgsrenderer.sip
Expand Up @@ -115,7 +115,10 @@ be followed by a corresponding call to stopRender() after all features have been

.. seealso:: :py:func:`stopRender()`

\warning This method is not thread safe. Before calling startRender() in a non-main thread,

.. warning::

This method is not thread safe. Before calling startRender() in a non-main thread,
the renderer should instead be cloned and startRender()/stopRender() called on the clone.
%End

Expand All @@ -125,7 +128,9 @@ Must be called when a render cycle has finished, to allow the renderer to clean

Calls to stopRender() must always be preceded by a call to startRender().

\warning This method is not thread safe. Before calling startRender() in a non-main thread,
.. warning::

This method is not thread safe. Before calling startRender() in a non-main thread,
the renderer should instead be cloned and startRender()/stopRender() called on the clone.

.. seealso:: :py:func:`startRender()`
Expand Down
5 changes: 4 additions & 1 deletion python/gui/qgisinterface.sip
Expand Up @@ -912,7 +912,10 @@ More information here: http://qt-project.org/forums/viewthread/27098
%Docstring
Registers a locator ``filter`` for the app's locator bar. Ownership of the filter is transferred to the
locator.
\warning Plugins which register filters to the locator bar must take care to correctly call

.. warning::

Plugins which register filters to the locator bar must take care to correctly call
deregisterLocatorFilter() and deregister their filters upon plugin unload to avoid crashes.

.. seealso:: :py:func:`deregisterLocatorFilter()`
Expand Down
4 changes: 3 additions & 1 deletion python/gui/qgsprojectionselectiondialog.sip
Expand Up @@ -97,7 +97,9 @@ by the given Coordinate Reference Systems.
list of projections by. This is useful in (e.g.) WMS situations
where you just want to offer what the WMS server can support.

\warning This function's behavior is undefined if it is called after the dialog is shown.
.. warning::

This function's behavior is undefined if it is called after the dialog is shown.
%End

};
Expand Down
4 changes: 3 additions & 1 deletion python/gui/qgsprojectionselectiontreewidget.sip
Expand Up @@ -135,7 +135,9 @@ by the given Coordinate Reference Systems.
list of projections by. This is useful in (e.g.) WMS situations
where you just want to offer what the WMS server can support.

\warning This function's behavior is undefined if it is called after the widget is shown.
.. warning::

This function's behavior is undefined if it is called after the widget is shown.
%End

void pushProjectionToFront();
Expand Down
3 changes: 3 additions & 0 deletions scripts/sipify.pl
Expand Up @@ -203,6 +203,9 @@ sub processDoxygenLine {
if ( $line =~ m/[\\@]note (.*)/ ) {
return "\n.. note::\n\n $1\n";
}
if ( $line =~ m/[\\@]warning (.*)/ ) {
return "\n.. warning::\n\n $1\n";
}
if ( $line =~ m/[\\@]brief (.*)/ ) {
return " $1\n";
}
Expand Down

0 comments on commit c7e37e8

Please sign in to comment.