Skip to content

Commit dd27f72

Browse files
committed
Convert doxygen \throws to Sphinx :raises: syntax in sipify
1 parent 9b4cb6f commit dd27f72

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

python/server/auto_generated/qgsserverogcapihandler.sip.in

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Handles the request within its ``context``
115115
Subclasses must implement this methods, and call validate() to
116116
extract validated parameters from the request.
117117

118-
\throws QgsServerApiBadRequestError if the method encounters any error
118+
:raises QgsServerApiBadRequestError: if the method encounters any error
119119
%End
120120

121121
virtual QVariantMap values( const QgsServerApiContext &context ) const throw( QgsServerApiBadRequestException );
@@ -137,7 +137,8 @@ the parameters map.
137137
.. seealso:: :py:func:`path`
138138

139139
.. seealso:: :py:func:`parameters`
140-
\throws QgsServerApiBadRequestError if validation fails
140+
141+
:raises QgsServerApiBadRequestError: if validation fails
141142
%End
142143

143144
QString contentTypeForAccept( const QString &accept ) const;
@@ -202,7 +203,7 @@ The path file extension is examined first and checked for known mime types,
202203
the "Accept" HTTP header is examined next.
203204
Fallback to the default content type of the handler if none of the above matches.
204205

205-
\throws QgsServerApiBadRequestError if the content type of the request is not compatible with the handler (:py:func:`contentTypes` member)
206+
:raises QgsServerApiBadRequestError: if the content type of the request is not compatible with the handler (:py:func:`contentTypes` member)
206207
%End
207208

208209
static QString parentLink( const QUrl &url, int levels = 1 );

python/server/auto_generated/qgsserverparameters.sip.in

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ Loads the data associated to the parameter converted into an url.
169169
Raises an exception in case of an invalid parameters.
170170

171171
:param msg: The message describing the exception
172-
\throws QgsBadRequestException Invalid parameter exception
172+
173+
:raises QgsBadRequestException: Invalid parameter exception
173174
%End
174175

175176
QVariant::Type mType;
@@ -216,7 +217,8 @@ Constructor for QgsServerParameter.
216217
void raiseError() const;
217218
%Docstring
218219
Raises an error in case of an invalid conversion.
219-
\throws QgsBadRequestException Invalid parameter exception
220+
221+
:raises QgsBadRequestException: Invalid parameter exception
220222
%End
221223

222224
static QString name( const QgsServerParameter::Name name );

python/server/auto_generated/qgsserverquerystringparameter.sip.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ Validation steps:
7474
.. seealso:: :py:func:`setCustomValidator`
7575

7676
:return: the parameter value or an invalid QVariant if not found (and not required)
77-
\throws QgsServerApiBadRequestError if validation fails
77+
78+
:raises QgsServerApiBadRequestError: if validation fails
7879
%End
7980

8081

scripts/sipify.pl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ sub processDoxygenLine {
190190

191191
# if inside multi-line parameter, ensure additional lines are indented
192192
if ($line ne '') {
193-
if ( $line !~ m/^\s*[\\:]+(param|note|since|return|deprecated|warning)/ ) {
193+
if ( $line !~ m/^\s*[\\:]+(param|note|since|return|deprecated|warning|throws)/ ) {
194194
$line = "$INDENT$line";
195195
}
196196
}
@@ -299,6 +299,11 @@ sub processDoxygenLine {
299299
$COMMENT_LAST_LINE_NOTE_WARNING = 1;
300300
return "\n.. warning::\n\n $1\n";
301301
}
302+
if ( $line =~ m/[\\@]throws (.+?)\b\s*(.*)/ ) {
303+
$INDENT = '';
304+
$COMMENT_LAST_LINE_NOTE_WARNING = 1;
305+
return "\n:raises $1: $2\n";
306+
}
302307

303308
if ( $line !~ m/^\s*$/ ){
304309
if ( $COMMENT_LAST_LINE_NOTE_WARNING == 1 ){

0 commit comments

Comments
 (0)