Convert doxygen \throws to Sphinx :raises: syntax in sipify

This commit is contained in:
Nyall Dawson 2019-08-13 08:46:38 +10:00
parent 9b4cb6f502
commit dd27f72b0e
4 changed files with 16 additions and 7 deletions

View File

@ -115,7 +115,7 @@ Handles the request within its ``context``
Subclasses must implement this methods, and call validate() to
extract validated parameters from the request.
\throws QgsServerApiBadRequestError if the method encounters any error
:raises QgsServerApiBadRequestError: if the method encounters any error
%End
virtual QVariantMap values( const QgsServerApiContext &context ) const throw( QgsServerApiBadRequestException );
@ -137,7 +137,8 @@ the parameters map.
.. seealso:: :py:func:`path`
.. seealso:: :py:func:`parameters`
\throws QgsServerApiBadRequestError if validation fails
:raises QgsServerApiBadRequestError: if validation fails
%End
QString contentTypeForAccept( const QString &accept ) const;
@ -202,7 +203,7 @@ The path file extension is examined first and checked for known mime types,
the "Accept" HTTP header is examined next.
Fallback to the default content type of the handler if none of the above matches.
\throws QgsServerApiBadRequestError if the content type of the request is not compatible with the handler (:py:func:`contentTypes` member)
:raises QgsServerApiBadRequestError: if the content type of the request is not compatible with the handler (:py:func:`contentTypes` member)
%End
static QString parentLink( const QUrl &url, int levels = 1 );

View File

@ -169,7 +169,8 @@ Loads the data associated to the parameter converted into an url.
Raises an exception in case of an invalid parameters.
:param msg: The message describing the exception
\throws QgsBadRequestException Invalid parameter exception
:raises QgsBadRequestException: Invalid parameter exception
%End
QVariant::Type mType;
@ -216,7 +217,8 @@ Constructor for QgsServerParameter.
void raiseError() const;
%Docstring
Raises an error in case of an invalid conversion.
\throws QgsBadRequestException Invalid parameter exception
:raises QgsBadRequestException: Invalid parameter exception
%End
static QString name( const QgsServerParameter::Name name );

View File

@ -74,7 +74,8 @@ Validation steps:
.. seealso:: :py:func:`setCustomValidator`
:return: the parameter value or an invalid QVariant if not found (and not required)
\throws QgsServerApiBadRequestError if validation fails
:raises QgsServerApiBadRequestError: if validation fails
%End

View File

@ -190,7 +190,7 @@ sub processDoxygenLine {
# if inside multi-line parameter, ensure additional lines are indented
if ($line ne '') {
if ( $line !~ m/^\s*[\\:]+(param|note|since|return|deprecated|warning)/ ) {
if ( $line !~ m/^\s*[\\:]+(param|note|since|return|deprecated|warning|throws)/ ) {
$line = "$INDENT$line";
}
}
@ -299,6 +299,11 @@ sub processDoxygenLine {
$COMMENT_LAST_LINE_NOTE_WARNING = 1;
return "\n.. warning::\n\n $1\n";
}
if ( $line =~ m/[\\@]throws (.+?)\b\s*(.*)/ ) {
$INDENT = '';
$COMMENT_LAST_LINE_NOTE_WARNING = 1;
return "\n:raises $1: $2\n";
}
if ( $line !~ m/^\s*$/ ){
if ( $COMMENT_LAST_LINE_NOTE_WARNING == 1 ){