Skip to content

Commit be8d1d7

Browse files
committedDec 16, 2017
run sipify
1 parent 281392b commit be8d1d7

19 files changed

+87
-85
lines changed
 

‎python/core/geometry/qgsgeometry.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,11 +1146,11 @@ Export the geometry to WKB
11461146
%Docstring
11471147
Exports the geometry to WKT
11481148

1149+
:return: true in case of success and false else
1150+
11491151
.. note::
11501152

11511153
precision parameter added in QGIS 2.4
1152-
1153-
:return: true in case of success and false else
11541154
%End
11551155

11561156
QString asJson( int precision = 17 ) const;

‎python/core/geometry/qgsgeometryutils.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ Retrieves the vertices which are before and after the interpolated point at a sp
6868
:param previousVertex: will be set to previous vertex ID
6969
:param nextVertex: will be set to next vertex ID
7070

71+
:return: true if vertices were successfully retrieved
72+
7173
.. note::
7274

7375
if the distance coincides exactly with a vertex, then both previousVertex and nextVertex will be set to this vertex
7476

75-
:return: true if vertices were successfully retrieved
76-
7777
.. versionadded:: 3.0
7878
%End
7979

‎python/core/qgsapplication.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ on load.
170170
All themes found in ~/.qgis3/themes folder.
171171
The path is to the root folder for the theme
172172

173+
:return: A hash of theme name and theme path. Valid theme folders contain style.qss
174+
173175
.. note::
174176

175177
Valid theme folders must contain a style.qss file.
176-
177-
:return: A hash of theme name and theme path. Valid theme folders contain style.qss
178178
%End
179179

180180
static QString authorsFilePath();

‎python/core/qgscoordinatereferencesystem.sip

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,12 @@ Creates a CRS from a specified QGIS SRS ID.
297297
%Docstring
298298
Sets this CRS by lookup of the given ID in the CRS database.
299299

300+
:return: True on success else false
301+
300302
.. note::
301303

302304
We encourage you to use EPSG code, WKT or Proj4 to describe CRS's in your code
303305
wherever possible. Internal QGIS CRS IDs are not guaranteed to be permanent / involatile.
304-
305-
:return: True on success else false
306306
/ // TODO QGIS 3: remove type and always use EPSG code, rename to createFromEpsg
307307
%End
308308

@@ -314,12 +314,12 @@ Accepts both "<auth>:<code>" format and OGC URN "urn:ogc:def:crs:<auth>:[<versio
314314
It also recognizes "QGIS", "USER", "CUSTOM" authorities, which all have the same meaning
315315
and refer to QGIS internal CRS IDs.
316316

317+
:return: True on success else false
318+
317319
.. note::
318320

319321
this method uses an internal cache. Call invalidateCache() to clear the cache.
320322

321-
:return: True on success else false
322-
323323
.. seealso:: :py:func:`fromOgcWmsCrs()`
324324
/ // TODO QGIS 3: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid())
325325
%End
@@ -343,6 +343,10 @@ and createFromOgcWmsCrs() is used to initialize the object.
343343
Otherwise the WKT will be converted to a proj4 string and createFromProj4()
344344
set up the object.
345345

346+
:param wkt: The WKT for the desired spatial reference system.
347+
348+
:return: True on success else false
349+
346350
.. note::
347351

348352
Some members may be left blank if no match can be found in CRS database.
@@ -351,10 +355,6 @@ set up the object.
351355

352356
this method uses an internal cache. Call invalidateCache() to clear the cache.
353357

354-
:param wkt: The WKT for the desired spatial reference system.
355-
356-
:return: True on success else false
357-
358358
.. seealso:: :py:func:`fromWkt()`
359359
%End
360360

@@ -365,14 +365,14 @@ Sets this CRS by lookup of internal QGIS CRS ID in the CRS database.
365365
If the srsid is < USER_CRS_START_ID, system CRS database is used, otherwise
366366
user's local CRS database from home directory is used.
367367

368-
.. note::
369-
370-
this method uses an internal cache. Call invalidateCache() to clear the cache.
371-
372368
:param srsId: The internal QGIS CRS ID for the desired spatial reference system.
373369

374370
:return: True on success else false
375371

372+
.. note::
373+
374+
this method uses an internal cache. Call invalidateCache() to clear the cache.
375+
376376
.. seealso:: :py:func:`fromSrsId()`
377377
%End
378378

@@ -394,6 +394,10 @@ We try to match the proj4 string to internal QGIS CRS ID using the following log
394394
a match where the parameters are in a different order
395395
- if none of the above match, use findMatchingProj()
396396

397+
:param projString: A proj4 format string
398+
399+
:return: True on success else false
400+
397401
.. note::
398402

399403
Some members may be left blank if no match can be found in CRS database.
@@ -402,10 +406,6 @@ a match where the parameters are in a different order
402406

403407
this method uses an internal cache. Call invalidateCache() to clear the cache.
404408

405-
:param projString: A proj4 format string
406-
407-
:return: True on success else false
408-
409409
.. seealso:: :py:func:`fromProj4()`
410410
%End
411411

@@ -439,14 +439,14 @@ ESRI.[WKT string] (directly or in a file), "IGNF:xxx"
439439
For more details on supported formats see OGRSpatialReference.SetFromUserInput()
440440
( http://www.gdal.org/ogr/classOGRSpatialReference.html#aec3c6a49533fe457ddc763d699ff8796 )
441441

442+
:param definition: A String containing a coordinate reference system definition.
443+
444+
:return: True on success else false
445+
442446
.. note::
443447

444448
this function generates a WKT string using OSRSetFromUserInput() and
445449
passes it to createFromWkt() function.
446-
447-
:param definition: A String containing a coordinate reference system definition.
448-
449-
:return: True on success else false
450450
/ // TODO QGIS3: rename to createFromStringOGR so it is clear it's similar to createFromString, just different backend
451451
%End
452452

‎python/core/qgsdistancearea.sip

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,6 @@ Measures the distance between two points.
217217
Calculates the distance from one point with distance in meters and azimuth (direction)
218218
When the sourceCrs() is geographic, computeSpheroidProject() will be called
219219
otherwise QgsPoint.project() will be called after QgsUnitTypes.fromUnitToUnitFactor() has been applied to the distance
220-
\note:
221-
The input Point must be in the coordinate reference system being used
222-
223-
.. versionadded:: 3.0
224220

225221
:param p1: start point [can be Cartesian or Geographic]
226222
:param distance: must be in meters
@@ -232,15 +228,21 @@ The input Point must be in the coordinate reference system being used
232228
.. seealso:: :py:func:`sourceCrs()`
233229

234230
.. seealso:: :py:func:`computeSpheroidProject()`
231+
232+
.. note::
233+
234+
The input Point must be in the coordinate reference system being used
235+
236+
.. versionadded:: 3.0
235237
%End
236238

237239
QgsUnitTypes::DistanceUnit lengthUnits() const;
238240
%Docstring
239241
Returns the units of distance for length calculations made by this object.
240242

241-
.. versionadded:: 2.14
242-
243243
.. seealso:: :py:func:`areaUnits()`
244+
245+
.. versionadded:: 2.14
244246
%End
245247

246248
QgsUnitTypes::AreaUnit areaUnits() const;
@@ -335,6 +337,12 @@ location of the projected point. Based on Vincenty's formula
335337
for the geodetic direct problem as described in "Geocentric
336338
Datum of Australia Technical Manual", Chapter 4.
337339

340+
:param p1: - location of first geographic (latitude/longitude) point as degrees.
341+
:param distance: - distance in meters.
342+
:param azimuth: - azimuth in radians, clockwise from North
343+
344+
:return: p2 - location of projected point as longitude/latitude.
345+
338346
.. note::
339347

340348
code (and documentation) taken from rttopo project
@@ -345,12 +353,6 @@ https://git.osgeo.org/gogs/rttopo/librttopo
345353
--> latitudes outside these bounds cause the calculations to become unstable and can return invalid results
346354

347355
.. versionadded:: 3.0
348-
349-
:param p1: - location of first geographic (latitude/longitude) point as degrees.
350-
:param distance: - distance in meters.
351-
:param azimuth: - azimuth in radians, clockwise from North
352-
353-
:return: p2 - location of projected point as longitude/latitude.
354356
%End
355357

356358
};

‎python/core/qgsproject.sip

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ Writes the project to a file.
211211

212212
:param filename: destination file
213213

214+
:return: true if project was written successfully
215+
214216
.. note::
215217

216218
calling this implicitly sets the project's filename (see setFileName() )
@@ -219,20 +221,18 @@ Writes the project to a file.
219221

220222
isDirty() will be set to false if project is successfully written
221223

222-
:return: true if project was written successfully
223-
224224
.. versionadded:: 3.0
225225
%End
226226

227227
bool write();
228228
%Docstring
229229
Writes the project to its current associated file (see fileName() ).
230230

231+
:return: true if project was written successfully
232+
231233
.. note::
232234

233235
isDirty() will be set to false if project is successfully written
234-
235-
:return: true if project was written successfully
236236
%End
237237

238238
bool writeEntry( const QString &scope, const QString &key, bool value ) /PyName=writeEntryBool/;

‎python/core/qgsuserprofilemanager.sip

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ If no name is given it returns a profile called "default".
5050
By default will create the profile folder if not found.
5151
By default will init the user settings.
5252

53-
.. note::
54-
55-
Returns a new QgsUserProfile. Ownership transferred to caller.
56-
5753
:param defaultProfile: The profile name to find. Empty profile name will return "default" for the name.
5854
:param createNew: Create the profile folder if it doesn't exist.
5955
:param initSettings: if the settings should be initialized
6056

6157
:return: The user profile
58+
59+
.. note::
60+
61+
Returns a new QgsUserProfile. Ownership transferred to caller.
6262
%End
6363

6464
void setRootLocation( const QString &rootProfileLocation );
@@ -125,11 +125,11 @@ First checks profile.ini in \\profiles folder
125125
Then checks defaultProfile in global settings
126126
Finally returns "default" if all else fails
127127

128+
:return: The name of the default profile.
129+
128130
.. note::
129131

130132
Setting overrideLocalProfile in global settings will always ignore profiles.ini
131-
132-
:return: The name of the default profile.
133133
%End
134134

135135
void setDefaultProfileName( const QString &name );
@@ -167,13 +167,13 @@ Create a user profile given by the name
167167
%Docstring
168168
Deletes a profile from the root profiles folder.
169169

170-
.. note::
171-
172-
There is no undo on this as it deletes the folder from the machine.
173-
174170
:param name: The name of the profile to delete.
175171

176172
:return: A QgsError with a message if the profile failed to be deleted.
173+
174+
.. note::
175+
176+
There is no undo on this as it deletes the folder from the machine.
177177
%End
178178

179179
QgsUserProfile *userProfile();

‎python/core/qgsvectordataprovider.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ In such cases, the implementation must ensure that the data is not susceptible t
8787
if it is possible that both feature source and provider may need reading/writing to some shared data at the
8888
same time, some synchronization mechanisms must be used (e.g. mutexes) to prevent data corruption.
8989

90-
.. versionadded:: 2.4
91-
9290
:return: new instance of QgsAbstractFeatureSource (caller is responsible for deleting it)
91+
92+
.. versionadded:: 2.4
9393
%End
9494

9595
virtual QString storageType() const;

‎python/core/qgsvectorlayer.sip

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -783,12 +783,12 @@ Will return the named style corresponding to style id provided
783783
%Docstring
784784
Delete a style from the database
785785

786-
.. versionadded:: 3.0
787-
788786
:param styleId: the provider's layer_styles table id of the style to delete
789787
:param msgError: reference to string that will be updated with any error messages
790788

791789
:return: true in case of success
790+
791+
.. versionadded:: 3.0
792792
%End
793793

794794
virtual QString loadNamedStyle( const QString &theURI, bool &resultFlag /Out/, bool loadFromLocalDb );
@@ -1189,11 +1189,11 @@ Adds topological points for every vertex of the geometry.
11891189

11901190
:param geom: the geometry where each vertex is added to segments of other features
11911191

1192+
:return: 0 in case of success
1193+
11921194
.. note::
11931195

11941196
geom is not going to be modified by the function
1195-
1196-
:return: 0 in case of success
11971197
%End
11981198

11991199
int addTopologicalPoints( const QgsPointXY &p );

‎python/core/qgsvectorlayereditutils.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,11 @@ Adds topological points for every vertex of the geometry.
178178

179179
:param geom: the geometry where each vertex is added to segments of other features
180180

181+
:return: 0 in case of success
182+
181183
.. note::
182184

183185
geom is not going to be modified by the function
184-
185-
:return: 0 in case of success
186186
%End
187187

188188
int addTopologicalPoints( const QgsPointXY &p );

‎python/core/raster/qgsrasterdataprovider.sip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ into a subset of the GUI raster properties "Metadata" tab.
222222

223223
virtual QString lastErrorTitle() = 0;
224224
%Docstring
225-
Returns the caption error text for the last error in this provider
225+
Returns the caption error text for the last error in this provider
226226

227227
If an operation returns 0 (e.g. draw()), this function
228228
returns the text of the error associated with the failure.
@@ -280,14 +280,14 @@ By default providers are not editable. Use setEditable() method to enable/disabl
280280
Turns on/off editing mode of the provider. When in editing mode, it is possible
281281
to overwrite data of the provider using writeBlock() calls.
282282

283+
:return: true if the switch to/from editing mode was successful
284+
283285
.. note::
284286

285287
Only some providers support editing mode and even those may fail to turn
286288
the underlying data source into editing mode, so it is necessary to check the return
287289
value whether the operation was successful.
288290

289-
:return: true if the switch to/from editing mode was successful
290-
291291
.. seealso:: :py:func:`isEditable()`
292292

293293
.. versionadded:: 3.0

‎python/core/raster/qgsrasterfilewriter.sip

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ Create a raster file with one band without initializing the pixel data.
5353
Returned provider may be used to initialize the raster using writeBlock() calls.
5454
Ownership of the returned provider is passed to the caller.
5555

56+
:return: Instance of data provider in editing mode (on success) or None on error.
57+
5658
.. note::
5759

5860
Does not work with tiled mode enabled.
5961

60-
:return: Instance of data provider in editing mode (on success) or None on error.
61-
6262
.. versionadded:: 3.0
6363
%End
6464

@@ -72,12 +72,12 @@ Create a raster file with given number of bands without initializing the pixel d
7272
Returned provider may be used to initialize the raster using writeBlock() calls.
7373
Ownership of the returned provider is passed to the caller.
7474

75+
:return: Instance of data provider in editing mode (on success) or None on error.
76+
7577
.. note::
7678

7779
Does not work with tiled mode enabled.
7880

79-
:return: Instance of data provider in editing mode (on success) or None on error.
80-
8181
.. versionadded:: 3.0
8282
%End
8383

‎python/core/symbology/qgscategorizedsymbolrenderer.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ Update the color ramp used and all symbols colors.
216216
%Docstring
217217
creates a QgsCategorizedSymbolRenderer from an existing renderer.
218218

219-
.. versionadded:: 2.5
220-
221219
:return: a new renderer if the conversion was possible, otherwise 0.
220+
221+
.. versionadded:: 2.5
222222
%End
223223

224224
void setDataDefinedSizeLegend( QgsDataDefinedSizeLegend *settings /Transfer/ );

‎python/core/symbology/qgsgraduatedsymbolrenderer.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,9 @@ set the method used for graduation (either size or color)
410410
%Docstring
411411
creates a QgsGraduatedSymbolRenderer from an existing renderer.
412412

413-
.. versionadded:: 2.6
414-
415413
:return: a new renderer if the conversion was possible, otherwise 0.
414+
415+
.. versionadded:: 2.6
416416
%End
417417

418418
void setDataDefinedSizeLegend( QgsDataDefinedSizeLegend *settings /Transfer/ );

‎python/core/symbology/qgsinvertedpolygonrenderer.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ This will involve some CPU-demanding computations and is thus disabled by defaul
166166
%Docstring
167167
Creates a QgsInvertedPolygonRenderer by a conversion from an existing renderer.
168168

169-
.. versionadded:: 2.5
170-
171169
:return: a new renderer if the conversion was possible, otherwise 0.
170+
171+
.. versionadded:: 2.5
172172
%End
173173

174174
};

‎python/core/symbology/qgspointdisplacementrenderer.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ Sets the center symbol for a displacement group.
146146
%Docstring
147147
Creates a QgsPointDisplacementRenderer from an existing renderer.
148148

149-
.. versionadded:: 2.5
150-
151149
:return: a new renderer if the conversion was possible, otherwise None.
150+
151+
.. versionadded:: 2.5
152152
%End
153153

154154
private:

‎python/core/symbology/qgsrulebasedrenderer.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,9 @@ take a rule and create a list of new rules with intervals of scales given by the
520520
%Docstring
521521
creates a QgsRuleBasedRenderer from an existing renderer.
522522

523-
.. versionadded:: 2.5
524-
525523
:return: a new renderer if the conversion was possible, otherwise 0.
524+
525+
.. versionadded:: 2.5
526526
%End
527527

528528
static void convertToDataDefinedSymbology( QgsSymbol *symbol, const QString &sizeScaleField, const QString &rotationField = QString() );

‎python/core/symbology/qgssinglesymbolrenderer.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ create renderer from XML element
6262
%Docstring
6363
creates a QgsSingleSymbolRenderer from an existing renderer.
6464

65-
.. versionadded:: 2.5
66-
6765
:return: a new renderer if the conversion was possible, otherwise 0.
66+
67+
.. versionadded:: 2.5
6868
%End
6969

7070
void setDataDefinedSizeLegend( QgsDataDefinedSizeLegend *settings /Transfer/ );

‎python/gui/qgsmaplayerconfigwidgetfactory.sip

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ Set the icon for the factory object.
5252
%Docstring
5353
The title of the panel.
5454

55+
:return: Title of the panel
56+
5557
.. note::
5658

5759
This may or may not be shown to the user.
58-
59-
:return: Title of the panel
6060
%End
6161

6262
void setTitle( const QString &title );
@@ -112,16 +112,16 @@ Set support flag for style dock
112112
%Docstring
113113
Factory function to create the widget on demand as needed by the dock.
114114

115-
.. note::
116-
117-
This function is called each time the panel is selected. Keep it light for better UX.
118-
119115
:param layer: The active layer in the dock.
120116
:param canvas: The map canvas.
121117
:param dockWidget: True of the widget will be shown a dock style widget.
122118
:param parent: The parent of the widget.
123119

124120
:return: A new QgsMapStylePanel which is shown in the map style dock.
121+
122+
.. note::
123+
124+
This function is called each time the panel is selected. Keep it light for better UX.
125125
%End
126126

127127
};

0 commit comments

Comments
 (0)
Please sign in to comment.