[sipify] correctly output deprecation

This commit is contained in:
Denis Rouzaud 2019-10-15 13:17:15 +02:00
parent 5f24a0b214
commit c5e36dbf73

View File

@ -242,9 +242,12 @@ sub processDoxygenLine {
$FOUND_SINCE = 1;
return "\n.. versionadded:: $1\n";
}
if ( $line =~ m/\\deprecated(.*)/i ) {
if ( $line =~ m/\\deprecated(?:\s+since\s+(?:QGIS\s+)(?<DEPR_VERSION>[0-9.]+)(,\s*)?)?(?<DEPR_MESSAGE>.*)?/i ) {
$INDENT = '';
return "\n.. deprecated::$1\n";
my $depr_line = "\n.. deprecated::";
$depr_line .= " QGIS $+{DEPR_VERSION}" if (defined $+{DEPR_VERSION});
$depr_line .= "\n $+{DEPR_MESSAGE}\n" if (defined $+{DEPR_MESSAGE});
return $depr_line;
}
# create links in see also