Skip to content
Permalink
Browse files
[sipify] Replace nullptr with None in docstrings
Since nullptr has no meaning to Python devs
  • Loading branch information
nyalldawson committed Apr 6, 2017
1 parent 5ccc6cc commit ca8e1d343d921e0f53c9452edb84b5bea7d3c31f
@@ -261,7 +261,7 @@ class QgsPropertyTransformer
\param fieldName will be set to a field name which is used to calculate the input
to the property transformer. This will be set to an
empty string if an expression is the transformer input.
\returns corresponding property transformer, or nullptr if expression could not
\returns corresponding property transformer, or None if expression could not
be parsed to a transformer.
%End

@@ -323,7 +323,7 @@ class QgsGenericNumericTransformer : QgsPropertyTransformer
\param fieldName will be set to a field name which is used to calculate the input
to the property transformer. This will be set to an
empty string if an expression is the transformer input.
\returns corresponding QgsSizeScaleTransformer, or nullptr if expression could not
\returns corresponding QgsSizeScaleTransformer, or None if expression could not
be parsed to a size scale transformer.
%End

@@ -449,7 +449,7 @@ class QgsSizeScaleTransformer : QgsPropertyTransformer
\param fieldName will be set to a field name which is used to calculate the input
to the property transformer. This will be set to an
empty string if an expression is the transformer input.
\returns corresponding QgsSizeScaleTransformer, or nullptr if expression could not
\returns corresponding QgsSizeScaleTransformer, or None if expression could not
be parsed to a size scale transformer.
%End

@@ -48,7 +48,7 @@ class QgsRasterFileWriter
.. note::

Does not work with tiled mode enabled.
\returns Instance of data provider in editing mode (on success) or null on error.
\returns Instance of data provider in editing mode (on success) or None on error.
.. versionadded:: 3.0
%End

@@ -14,6 +14,9 @@ sub processDoxygenLine
$line =~ s/\\a //g;
# replace :: with . (changes c++ style namespace/class directives to Python style)
$line =~ s/::/./g;
# replace nullptr with None (nullptr means nothing to Python devs)
$line =~ s/\bnullptr\b/None/g;

if ( $line =~ m/[\\@](ingroup|class)/ ) {
return ""
}
@@ -59,7 +59,7 @@ class CORE_EXPORT QgsRasterFileWriter
* Returned provider may be used to initialize the raster using writeBlock() calls.
* Ownership of the returned provider is passed to the caller.
* \note Does not work with tiled mode enabled.
* \returns Instance of data provider in editing mode (on success) or null on error.
* \returns Instance of data provider in editing mode (on success) or nullptr on error.
* \since QGIS 3.0
*/
QgsRasterDataProvider *createOneBandRaster( Qgis::DataType dataType,
@@ -131,6 +131,11 @@ Factory annotation
Here's some comment mentioning another class QgsAutoAwesomemater.makeLessAwesome.
%End

MyPointer *pointerReturnValue();
%Docstring
I return a pointer. If something bad happens, I return None.
%End

bool isOKwithErrMesg( QString &ErrMsg /Out/ );

void InOutParam( bool &ok = true /In,Out/ );
@@ -163,6 +163,11 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas
*/
void LongDocStringMethodWithBrief();

/**
* I return a pointer. If something bad happens, I return nullptr.
*/
MyPointer *pointerReturnValue();

bool isOKwithErrMesg( QString &ErrMsg SIP_OUT );

void InOutParam( bool &ok = true SIP_INOUT );

0 comments on commit ca8e1d3

Please sign in to comment.