Skip to content

Commit

Permalink
run sipify
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Dec 16, 2017
1 parent 281392b commit be8d1d7
Show file tree
Hide file tree
Showing 19 changed files with 87 additions and 85 deletions.
4 changes: 2 additions & 2 deletions python/core/geometry/qgsgeometry.sip
Expand Up @@ -1146,11 +1146,11 @@ Export the geometry to WKB
%Docstring
Exports the geometry to WKT

:return: true in case of success and false else

.. note::

precision parameter added in QGIS 2.4

:return: true in case of success and false else
%End

QString asJson( int precision = 17 ) const;
Expand Down
4 changes: 2 additions & 2 deletions python/core/geometry/qgsgeometryutils.sip
Expand Up @@ -68,12 +68,12 @@ Retrieves the vertices which are before and after the interpolated point at a sp
:param previousVertex: will be set to previous vertex ID
:param nextVertex: will be set to next vertex ID

:return: true if vertices were successfully retrieved

.. note::

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

:return: true if vertices were successfully retrieved

.. versionadded:: 3.0
%End

Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsapplication.sip
Expand Up @@ -170,11 +170,11 @@ on load.
All themes found in ~/.qgis3/themes folder.
The path is to the root folder for the theme

:return: A hash of theme name and theme path. Valid theme folders contain style.qss

.. note::

Valid theme folders must contain a style.qss file.

:return: A hash of theme name and theme path. Valid theme folders contain style.qss
%End

static QString authorsFilePath();
Expand Down
40 changes: 20 additions & 20 deletions python/core/qgscoordinatereferencesystem.sip
Expand Up @@ -297,12 +297,12 @@ Creates a CRS from a specified QGIS SRS ID.
%Docstring
Sets this CRS by lookup of the given ID in the CRS database.

:return: True on success else false

.. note::

We encourage you to use EPSG code, WKT or Proj4 to describe CRS's in your code
wherever possible. Internal QGIS CRS IDs are not guaranteed to be permanent / involatile.

:return: True on success else false
/ // TODO QGIS 3: remove type and always use EPSG code, rename to createFromEpsg
%End

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

:return: True on success else false

.. note::

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

:return: True on success else false

.. seealso:: :py:func:`fromOgcWmsCrs()`
/ // TODO QGIS 3: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid())
%End
Expand All @@ -343,6 +343,10 @@ and createFromOgcWmsCrs() is used to initialize the object.
Otherwise the WKT will be converted to a proj4 string and createFromProj4()
set up the object.

:param wkt: The WKT for the desired spatial reference system.

:return: True on success else false

.. note::

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

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

:param wkt: The WKT for the desired spatial reference system.

:return: True on success else false

.. seealso:: :py:func:`fromWkt()`
%End

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

.. note::

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

:param srsId: The internal QGIS CRS ID for the desired spatial reference system.

:return: True on success else false

.. note::

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

.. seealso:: :py:func:`fromSrsId()`
%End

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

:param projString: A proj4 format string

:return: True on success else false

.. note::

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

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

:param projString: A proj4 format string

:return: True on success else false

.. seealso:: :py:func:`fromProj4()`
%End

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

:param definition: A String containing a coordinate reference system definition.

:return: True on success else false

.. note::

this function generates a WKT string using OSRSetFromUserInput() and
passes it to createFromWkt() function.

:param definition: A String containing a coordinate reference system definition.

:return: True on success else false
/ // TODO QGIS3: rename to createFromStringOGR so it is clear it's similar to createFromString, just different backend
%End

Expand Down
26 changes: 14 additions & 12 deletions python/core/qgsdistancearea.sip
Expand Up @@ -217,10 +217,6 @@ Measures the distance between two points.
Calculates the distance from one point with distance in meters and azimuth (direction)
When the sourceCrs() is geographic, computeSpheroidProject() will be called
otherwise QgsPoint.project() will be called after QgsUnitTypes.fromUnitToUnitFactor() has been applied to the distance
\note:
The input Point must be in the coordinate reference system being used

.. versionadded:: 3.0

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

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

.. note::

The input Point must be in the coordinate reference system being used

.. versionadded:: 3.0
%End

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

.. versionadded:: 2.14

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

.. versionadded:: 2.14
%End

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

:param p1: - location of first geographic (latitude/longitude) point as degrees.
:param distance: - distance in meters.
:param azimuth: - azimuth in radians, clockwise from North

:return: p2 - location of projected point as longitude/latitude.

.. note::

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

.. versionadded:: 3.0

:param p1: - location of first geographic (latitude/longitude) point as degrees.
:param distance: - distance in meters.
:param azimuth: - azimuth in radians, clockwise from North

:return: p2 - location of projected point as longitude/latitude.
%End

};
Expand Down
8 changes: 4 additions & 4 deletions python/core/qgsproject.sip
Expand Up @@ -211,6 +211,8 @@ Writes the project to a file.

:param filename: destination file

:return: true if project was written successfully

.. note::

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

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

:return: true if project was written successfully

.. versionadded:: 3.0
%End

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

:return: true if project was written successfully

.. note::

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

:return: true if project was written successfully
%End

bool writeEntry( const QString &scope, const QString &key, bool value ) /PyName=writeEntryBool/;
Expand Down
20 changes: 10 additions & 10 deletions python/core/qgsuserprofilemanager.sip
Expand Up @@ -50,15 +50,15 @@ If no name is given it returns a profile called "default".
By default will create the profile folder if not found.
By default will init the user settings.

.. note::

Returns a new QgsUserProfile. Ownership transferred to caller.

:param defaultProfile: The profile name to find. Empty profile name will return "default" for the name.
:param createNew: Create the profile folder if it doesn't exist.
:param initSettings: if the settings should be initialized

:return: The user profile

.. note::

Returns a new QgsUserProfile. Ownership transferred to caller.
%End

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

:return: The name of the default profile.

.. note::

Setting overrideLocalProfile in global settings will always ignore profiles.ini

:return: The name of the default profile.
%End

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

.. note::

There is no undo on this as it deletes the folder from the machine.

:param name: The name of the profile to delete.

:return: A QgsError with a message if the profile failed to be deleted.

.. note::

There is no undo on this as it deletes the folder from the machine.
%End

QgsUserProfile *userProfile();
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsvectordataprovider.sip
Expand Up @@ -87,9 +87,9 @@ In such cases, the implementation must ensure that the data is not susceptible t
if it is possible that both feature source and provider may need reading/writing to some shared data at the
same time, some synchronization mechanisms must be used (e.g. mutexes) to prevent data corruption.

.. versionadded:: 2.4

:return: new instance of QgsAbstractFeatureSource (caller is responsible for deleting it)

.. versionadded:: 2.4
%End

virtual QString storageType() const;
Expand Down
8 changes: 4 additions & 4 deletions python/core/qgsvectorlayer.sip
Expand Up @@ -783,12 +783,12 @@ Will return the named style corresponding to style id provided
%Docstring
Delete a style from the database

.. versionadded:: 3.0

:param styleId: the provider's layer_styles table id of the style to delete
:param msgError: reference to string that will be updated with any error messages

:return: true in case of success

.. versionadded:: 3.0
%End

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

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

:return: 0 in case of success

.. note::

geom is not going to be modified by the function

:return: 0 in case of success
%End

int addTopologicalPoints( const QgsPointXY &p );
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsvectorlayereditutils.sip
Expand Up @@ -178,11 +178,11 @@ Adds topological points for every vertex of the geometry.

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

:return: 0 in case of success

.. note::

geom is not going to be modified by the function

:return: 0 in case of success
%End

int addTopologicalPoints( const QgsPointXY &p );
Expand Down
6 changes: 3 additions & 3 deletions python/core/raster/qgsrasterdataprovider.sip
Expand Up @@ -222,7 +222,7 @@ into a subset of the GUI raster properties "Metadata" tab.

virtual QString lastErrorTitle() = 0;
%Docstring
Returns the caption error text for the last error in this provider
Returns the caption error text for the last error in this provider

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

:return: true if the switch to/from editing mode was successful

.. note::

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

:return: true if the switch to/from editing mode was successful

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

.. versionadded:: 3.0
Expand Down

0 comments on commit be8d1d7

Please sign in to comment.