Skip to content

Commit

Permalink
[sipify] do not take // comments into docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Apr 30, 2017
1 parent f20b9b9 commit 897e2f0
Show file tree
Hide file tree
Showing 26 changed files with 13 additions and 118 deletions.
4 changes: 0 additions & 4 deletions python/core/geometry/qgscompoundcurve.sip
Expand Up @@ -47,10 +47,6 @@ class QgsCompoundCurve: QgsCurve


virtual double length() const;
%Docstring
curve interface
:rtype: float
%End
virtual QgsPointV2 startPoint() const;
virtual QgsPointV2 endPoint() const;
virtual void points( QgsPointSequence &pts /Out/ ) const;
Expand Down
5 changes: 0 additions & 5 deletions python/core/geometry/qgscurvepolygon.sip
Expand Up @@ -46,18 +46,13 @@ class QgsCurvePolygon: QgsSurface


virtual double area() const;
%Docstring
surface interface
:rtype: float
%End
virtual double perimeter() const;
virtual QgsPolygonV2 *surfaceToPolygon() const /Factory/;

virtual QgsAbstractGeometry *boundary() const /Factory/;

int numInteriorRings() const;
%Docstring
curve polygon interface
:rtype: int
%End
const QgsCurve *exteriorRing() const;
Expand Down
2 changes: 0 additions & 2 deletions python/core/geometry/qgsgeometry.sip
Expand Up @@ -213,7 +213,6 @@ Returns true if WKB of the geometry is of WKBMulti* type

QgsPoint closestVertex( const QgsPoint &point, int &atVertex /Out/, int &beforeVertex /Out/, int &afterVertex /Out/, double &sqrDist /Out/ ) const;
%Docstring
TODO QGIS 3.0 - rename beforeVertex to previousVertex, afterVertex to nextVertex
:rtype: QgsPoint
%End

Expand Down Expand Up @@ -473,7 +472,6 @@ not disjoint with existing polygons of the feature
bool topological,
QList<QgsPoint> &topologyTestPoints /Out/ );
%Docstring
TODO QGIS 3.0 returns an enum instead of a magic constant
:rtype: int
%End

Expand Down
8 changes: 0 additions & 8 deletions python/core/geometry/qgsgeometrycollection.sip
Expand Up @@ -44,10 +44,6 @@ class QgsGeometryCollection: QgsAbstractGeometry

virtual bool isEmpty() const;

%Docstring
methods inherited from QgsAbstractGeometry
:rtype: bool
%End
virtual int dimension() const;
virtual QString geometryType() const;
virtual void clear();
Expand Down Expand Up @@ -107,10 +103,6 @@ Adds a geometry and takes ownership. Returns true in case of success.


virtual bool insertVertex( QgsVertexId position, const QgsPointV2 &vertex );
%Docstring
low-level editing
:rtype: bool
%End
virtual bool moveVertex( QgsVertexId position, const QgsPointV2 &newPos );
virtual bool deleteVertex( QgsVertexId position );

Expand Down
8 changes: 0 additions & 8 deletions python/core/geometry/qgslinestring.sip
Expand Up @@ -161,10 +161,6 @@ Closes the line string by appending the first point to the end of the line, if i


virtual QString geometryType() const;
%Docstring
reimplemented methods
:rtype: str
%End
virtual int dimension() const;
virtual QgsLineString *clone() const /Factory/;
virtual void clear();
Expand All @@ -186,10 +182,6 @@ reimplemented methods


virtual double length() const;
%Docstring
curve interface
:rtype: float
%End
virtual QgsPointV2 startPoint() const;
virtual QgsPointV2 endPoint() const;

Expand Down
4 changes: 0 additions & 4 deletions python/core/geometry/qgsmulticurve.sip
Expand Up @@ -29,10 +29,6 @@ class QgsMultiCurve: QgsGeometryCollection

virtual QDomElement asGML2( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const;

%Docstring
inherited: QString asWkt( int precision = 17 ) const;
:rtype: QDomElement
%End
virtual QDomElement asGML3( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const;

virtual QString asJSON( int precision = 17 ) const;
Expand Down
4 changes: 0 additions & 4 deletions python/core/geometry/qgsmultilinestring.sip
Expand Up @@ -29,10 +29,6 @@ class QgsMultiLineString: QgsMultiCurve

virtual QDomElement asGML2( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const;

%Docstring
inherited: QString asWkt( int precision = 17 ) const;
:rtype: QDomElement
%End
virtual QDomElement asGML3( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const;

virtual QString asJSON( int precision = 17 ) const;
Expand Down
4 changes: 0 additions & 4 deletions python/core/geometry/qgsmultipoint.sip
Expand Up @@ -29,10 +29,6 @@ class QgsMultiPointV2: QgsGeometryCollection

virtual QDomElement asGML2( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const;

%Docstring
inherited: QString asWkt( int precision = 17 ) const;
:rtype: QDomElement
%End
virtual QDomElement asGML3( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const;

virtual QString asJSON( int precision = 17 ) const;
Expand Down
4 changes: 0 additions & 4 deletions python/core/geometry/qgsmultipolygon.sip
Expand Up @@ -29,10 +29,6 @@ class QgsMultiPolygonV2: QgsMultiSurface

virtual QDomElement asGML2( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const;

%Docstring
inherited: QString asWkt( int precision = 17 ) const;
:rtype: QDomElement
%End
virtual QDomElement asGML3( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const;

virtual QString asJSON( int precision = 17 ) const;
Expand Down
4 changes: 0 additions & 4 deletions python/core/geometry/qgsmultisurface.sip
Expand Up @@ -29,10 +29,6 @@ class QgsMultiSurface: QgsGeometryCollection

virtual QDomElement asGML2( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const;

%Docstring
inherited: QString asWkt( int precision = 17 ) const;
:rtype: QDomElement
%End
virtual QDomElement asGML3( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const;

virtual QString asJSON( int precision = 17 ) const;
Expand Down
8 changes: 0 additions & 8 deletions python/core/geometry/qgspointv2.sip
Expand Up @@ -301,10 +301,6 @@ class QgsPointV2: QgsAbstractGeometry
%End

virtual bool isEmpty() const;
%Docstring
implementation of inherited methods
:rtype: bool
%End
virtual QgsRectangle boundingBox() const;
virtual QString geometryType() const;
virtual int dimension() const;
Expand Down Expand Up @@ -334,10 +330,6 @@ implementation of inherited methods
virtual QgsAbstractGeometry *boundary() const /Factory/;

virtual bool insertVertex( QgsVertexId position, const QgsPointV2 &vertex );
%Docstring
low-level editing
:rtype: bool
%End
virtual bool moveVertex( QgsVertexId position, const QgsPointV2 &newPos );
virtual bool deleteVertex( QgsVertexId position );

Expand Down
11 changes: 0 additions & 11 deletions python/core/geometry/qgspolygon.sip
Expand Up @@ -41,17 +41,9 @@ class QgsPolygonV2: QgsCurvePolygon

virtual QByteArray asWkb() const;

%Docstring
inherited: bool fromWkt( const QString &wkt );
:rtype: QByteArray
%End

virtual QgsPolygonV2 *surfaceToPolygon() const /Factory/;

%Docstring
inherited: QString asJSON( int precision = 17 ) const;
:rtype: QgsPolygonV2
%End

virtual QgsAbstractGeometry *toCurveType() const /Factory/;

Expand All @@ -64,9 +56,6 @@ inherited: QString asJSON( int precision = 17 ) const;
virtual void addInteriorRing( QgsCurve *ring /Transfer/ );

virtual void setExteriorRing( QgsCurve *ring /Transfer/ );
%Docstring
overridden to handle LineString25D rings
%End

virtual QgsAbstractGeometry *boundary() const /Factory/;

Expand Down
8 changes: 0 additions & 8 deletions python/core/geometry/qgstriangle.sip
Expand Up @@ -51,10 +51,6 @@ class QgsTriangle : QgsPolygonV2


virtual QString geometryType() const;
%Docstring
inherited: bool operator!=( const QgsTriangle& other ) const;
:rtype: str
%End
virtual QgsTriangle *clone() const /Factory/;
virtual void clear();

Expand All @@ -67,10 +63,6 @@ inherited: bool operator!=( const QgsTriangle& other ) const;

virtual QgsPolygonV2 *surfaceToPolygon() const /Factory/;

%Docstring
inherited: QString asJSON( int precision = 17 ) const;
:rtype: QgsPolygonV2
%End

virtual QgsAbstractGeometry *toCurveType() const /Factory/;

Expand Down
4 changes: 0 additions & 4 deletions python/core/layertree/qgslayertreemodel.sip
Expand Up @@ -48,10 +48,6 @@ The root node is not transferred by the model.

virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;

%Docstring
Implementation of virtual functions from QAbstractItemModel
:rtype: int
%End
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;

virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
Expand Down
3 changes: 0 additions & 3 deletions python/core/qgscolorramp.sip
Expand Up @@ -681,9 +681,6 @@ class QgsCptCityColorRamp : QgsGradientColorRamp
%End

void setSchemeName( const QString &schemeName );
%Docstring
lazy loading - have to call loadPalette() explicitly
%End
void setVariantName( const QString &variantName );
void setVariantList( const QStringList &variantList );
void setName( const QString &schemeName, const QString &variantName = QString(), const QStringList &variantList = QStringList() );
Expand Down
10 changes: 0 additions & 10 deletions python/core/qgsdatasourceuri.sip
Expand Up @@ -12,9 +12,6 @@

class QgsDataSourceUri
{
%Docstring
(Radim Blazek 4/2012)
%End

%TypeHeaderCode
#include "qgsdatasourceuri.h"
Expand Down Expand Up @@ -229,9 +226,6 @@ Clears the schema
%End

void setSchema( const QString &schema );
%Docstring
.. versionadded:: 2.11
%End

void setSql( const QString &sql );
%Docstring
Expand All @@ -255,13 +249,9 @@ Returns the port
%End
QString driver() const;
%Docstring
.. versionadded:: 2.16
:rtype: str
%End
void setDriver( const QString &driver );
%Docstring
.. versionadded:: 2.16
%End
QString password() const;
%Docstring
Returns the password
Expand Down
4 changes: 0 additions & 4 deletions python/core/qgsfieldmodel.sip
Expand Up @@ -108,10 +108,6 @@ class QgsFieldModel : QAbstractItemModel

virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;

%Docstring
QAbstractItemModel interface
:rtype: QModelIndex
%End
virtual QModelIndex parent( const QModelIndex &child ) const;

virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
Expand Down
4 changes: 0 additions & 4 deletions python/core/qgsmaplayermodel.sip
Expand Up @@ -119,10 +119,6 @@ returns if the items can be checked or not

virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;

%Docstring
QAbstractItemModel interface
:rtype: QModelIndex
%End
virtual QModelIndex parent( const QModelIndex &child ) const;

virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
Expand Down
6 changes: 0 additions & 6 deletions python/core/qgsvectorlayer.sip
Expand Up @@ -965,25 +965,21 @@ changeGeometry() instead.

int addRing( const QList<QgsPoint> &ring, QgsFeatureId *featureId = 0 );
%Docstring
TODO QGIS 3.0 returns an enum instead of a magic constant
:rtype: int
%End

int addRing( QgsCurve *ring /Transfer/, QgsFeatureId *featureId = 0 ) /PyName=addCurvedRing/;
%Docstring
TODO QGIS 3.0 returns an enum instead of a magic constant
:rtype: int
%End

int addPart( const QList<QgsPoint> &ring );
%Docstring
TODO QGIS 3.0 returns an enum instead of a magic constant
:rtype: int
%End

int addPart( const QgsPointSequence &ring ) /PyName=addPartV2/;
%Docstring
TODO QGIS 3.0 returns an enum instead of a magic constant
:rtype: int
%End

Expand All @@ -1007,13 +1003,11 @@ TODO QGIS 3.0 returns an enum instead of a magic constant

int splitParts( const QList<QgsPoint> &splitLine, bool topologicalEditing = false );
%Docstring
TODO QGIS 3.0 returns an enum instead of a magic constant
:rtype: int
%End

int splitFeatures( const QList<QgsPoint> &splitLine, bool topologicalEditing = false );
%Docstring
TODO QGIS 3.0 returns an enum instead of a magic constant
:rtype: int
%End

Expand Down
3 changes: 0 additions & 3 deletions python/gui/qgsoptionswidgetfactory.sip
Expand Up @@ -37,9 +37,6 @@ class QgsOptionsPageWidget : QWidget

class QgsOptionsWidgetFactory : QObject
{
%Docstring
QGIS crashing when a plugin crashes/exits without deregistering a factory
%End

%TypeHeaderCode
#include "qgsoptionswidgetfactory.h"
Expand Down
1 change: 0 additions & 1 deletion python/gui/qgsscalewidget.sip
Expand Up @@ -75,7 +75,6 @@ Function to read the min scale

static QString toString( double scale );
%Docstring
be expected.
:rtype: str
%End
static double toDouble( const QString &scaleString, bool *ok = 0 );
Expand Down
10 changes: 7 additions & 3 deletions scripts/sipify.pl
Expand Up @@ -366,9 +366,13 @@ sub remove_constructor_or_body {
# save comments and do not print them, except in SIP_RUN
if ( $SIP_RUN == 0 ){
if ( $line =~ m/^\s*\/\// ){
$line =~ s/^\s*\/\/\!*\s*(.*?)\n?$/$1/;
$comment = processDoxygenLine( $line );
$comment =~ s/\n+$//;
if ($line =~ m/^\s*\/\/\!\s*(.*?)\n?$/){
$comment = processDoxygenLine( $1 );
$comment =~ s/\n+$//;
}
elsif ($lines[$line_idx-1] !~ m/\*\/.*/) {
$comment = '';
}
next;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsdatasourceuri.h
Expand Up @@ -80,13 +80,13 @@ class CORE_EXPORT QgsDataSourceUri
QString quotedTablename() const;

//! Set generic param (generic mode)
// \note if key exists, another is inserted
//! \note if key exists, another is inserted
void setParam( const QString &key, const QString &value );
//! \note available in Python as setParamList
void setParam( const QString &key, const QStringList &value ) SIP_PYNAME( setParamList );

//! Remove generic param (generic mode)
// \note remove all occurrences of key, returns number of params removed
//! \note remove all occurrences of key, returns number of params removed
int removeParam( const QString &key );

//! Get generic param (generic mode)
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgslogger.h
Expand Up @@ -69,11 +69,11 @@ class CORE_EXPORT QgsLogger
static void debug( const QString &var, int val, int debuglevel = 1, const char *file = nullptr, const char *function = nullptr, int line = -1 );

//! Similar to the previous method, but prints a variable double-value pair
// \note not available in Python bindings
//! \note not available in Python bindings
static void debug( const QString &var, double val, int debuglevel = 1, const char *file = nullptr, const char *function = nullptr, int line = -1 );

//! Prints out a variable/value pair for types with overloaded operator<<
// \note not available in Python bindings
//! \note not available in Python bindings
template <typename T> static void debug( const QString &var, T val, const char *file = nullptr, const char *function = nullptr,
int line = -1, int debuglevel = 1 )
{
Expand Down

0 comments on commit 897e2f0

Please sign in to comment.