Skip to content

Commit 4eeacb8

Browse files
committedApr 5, 2017
[sipify] Replace :: with . during doxygen->docstring conversion
e.g. You can use QgsXmlUtils::writeVariant to save it to an XML document -> You can use QgsXmlUtils.writeVariant to load it from an XML document
1 parent 3c4a9fd commit 4eeacb8

File tree

10 files changed

+39
-31
lines changed

10 files changed

+39
-31
lines changed
 

‎python/core/annotations/qgsannotationmanager.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class QgsAnnotationManager : QObject
1919

2020
QgsAnnotationManager handles the storage, serializing and deserializing
2121
of QgsAnnotations. Usually this class is not constructed directly, but
22-
rather accessed through a QgsProject via QgsProject::annotationManager().
22+
rather accessed through a QgsProject via QgsProject.annotationManager().
2323

2424
QgsAnnotationManager retains ownership of all the annotations contained
2525
in the manager.

‎python/core/processing/qgsprocessingregistry.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class QgsProcessingRegistry : QObject
1616
and various parameters and outputs.
1717

1818
QgsProcessingRegistry is not usually directly created, but rather accessed through
19-
QgsApplication::processingRegistry().
19+
QgsApplication.processingRegistry().
2020
.. versionadded:: 3.0
2121
%End
2222

‎python/core/qgsactionscoperegistry.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class QgsActionScopeRegistry : QObject
1818
To get access use the QgsApplication:
1919

2020
```
21-
QgsApplication::actionScopeRegistry()
21+
QgsApplication.actionScopeRegistry()
2222
```
2323

2424
.. versionadded:: 3.0
@@ -34,7 +34,7 @@ class QgsActionScopeRegistry : QObject
3434
%Docstring
3535
Create a new QgsActionScopeRegistry.
3636
QGIS already creates a central registry. You will normally
37-
want to use QgsApplication::actionScopeRegistry() to get access
37+
want to use QgsApplication.actionScopeRegistry() to get access
3838
to that one instead.
3939

4040
.. versionadded:: 3.0

‎python/core/qgsconditionalstyle.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class QgsConditionalStyle
203203
If no match is found a invalid QgsConditionalStyle is return.
204204

205205
\returns A condtional style that matches the value and feature.
206-
Check with QgsConditionalStyle::isValid()
206+
Check with QgsConditionalStyle.isValid()
207207
%End
208208

209209
static QgsConditionalStyle matchingConditionalStyle( const QList<QgsConditionalStyle> &styles, const QVariant &value, QgsExpressionContext &context );
@@ -212,7 +212,7 @@ class QgsConditionalStyle
212212
If no match is found a invalid QgsConditionalStyle is return.
213213

214214
\returns A condtional style that matches the value and feature.
215-
Check with QgsConditionalStyle::isValid()
215+
Check with QgsConditionalStyle.isValid()
216216
%End
217217

218218
static QgsConditionalStyle compressStyles( const QList<QgsConditionalStyle> &styles );

‎python/core/qgspropertytransformer.sip

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@ class QgsCurveTransform
9898
QVariant toVariant() const;
9999
%Docstring
100100
Saves this curve transformer to a QVariantMap, wrapped in a QVariant.
101-
You can use QgsXmlUtils::writeVariant to save it to an XML document.
101+
You can use QgsXmlUtils.writeVariant to save it to an XML document.
102102

103103
\see loadVariant()
104104
%End
105105

106106
bool loadVariant( const QVariant &transformer );
107107
%Docstring
108108
Load this curve transformer from a QVariantMap, wrapped in a QVariant.
109-
You can use QgsXmlUtils::writeVariant to load it from an XML document.
109+
You can use QgsXmlUtils.writeVariant to load it from an XML document.
110110

111111
\see toVariant()
112112
%End
@@ -179,15 +179,15 @@ class QgsPropertyTransformer
179179
virtual bool loadVariant( const QVariant &transformer );
180180
%Docstring
181181
Loads this transformer from a QVariantMap, wrapped in a QVariant.
182-
You can use QgsXmlUtils::writeVariant to save it to an XML document.
182+
You can use QgsXmlUtils.writeVariant to save it to an XML document.
183183

184184
\see loadVariant()
185185
%End
186186

187187
virtual QVariant toVariant() const;
188188
%Docstring
189189
Saves this transformer to a QVariantMap, wrapped in a QVariant.
190-
You can use QgsXmlUtils::writeVariant to save it to an XML document.
190+
You can use QgsXmlUtils.writeVariant to save it to an XML document.
191191

192192
\see toVariant()
193193
%End

‎python/core/qgssettings.sip

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ class QgsSettings : QObject
6969
%Docstring
7070
Construct a QgsSettings object for accessing settings of the application called application
7171
from the organization called organization, and with parent parent.
72-
If scope is QSettings::UserScope, the QSettings object searches user-specific settings first,
73-
before it searches system-wide settings as a fallback. If scope is QSettings::SystemScope,
72+
If scope is QSettings.UserScope, the QSettings object searches user-specific settings first,
73+
before it searches system-wide settings as a fallback. If scope is QSettings.SystemScope,
7474
the QSettings object ignores user-specific settings and provides access to system-wide settings.
7575

76-
The storage format is set to QSettings::NativeFormat (i.e. calling setDefaultFormat() before
76+
The storage format is set to QSettings.NativeFormat (i.e. calling setDefaultFormat() before
7777
calling this constructor has no effect).
7878

7979
If no application name is given, the QSettings object will only access the organization-wide
@@ -85,11 +85,11 @@ class QgsSettings : QObject
8585
%Docstring
8686
Construct a QgsSettings object for accessing settings of the application called application
8787
from the organization called organization, and with parent parent.
88-
If scope is QSettings::UserScope, the QSettings object searches user-specific settings first,
89-
before it searches system-wide settings as a fallback. If scope is QSettings::SystemScope,
88+
If scope is QSettings.UserScope, the QSettings object searches user-specific settings first,
89+
before it searches system-wide settings as a fallback. If scope is QSettings.SystemScope,
9090
the QSettings object ignores user-specific settings and provides access to system-wide settings.
91-
If format is QSettings::NativeFormat, the native API is used for storing settings. If format
92-
is QSettings::IniFormat, the INI format is used.
91+
If format is QSettings.NativeFormat, the native API is used for storing settings. If format
92+
is QSettings.IniFormat, the INI format is used.
9393

9494
If no application name is given, the QSettings object will only access the organization-wide
9595
locations.
@@ -100,11 +100,11 @@ class QgsSettings : QObject
100100
Construct a QgsSettings object for accessing the settings stored in the file called fileName,
101101
with parent parent. If the file doesn't already exist, it is created.
102102

103-
If format is QSettings::NativeFormat, the meaning of fileName depends on the platform. On Unix,
103+
If format is QSettings.NativeFormat, the meaning of fileName depends on the platform. On Unix,
104104
fileName is the name of an INI file. On macOS and iOS, fileName is the name of a .plist file.
105105
On Windows, fileName is a path in the system registry.
106106

107-
If format is QSettings::IniFormat, fileName is the name of an INI file.
107+
If format is QSettings.IniFormat, fileName is the name of an INI file.
108108

109109
Warning: This function is provided for convenience. It works well for accessing INI or .plist
110110
files generated by Qt, but might fail on some syntaxes found in such files originated by
@@ -119,10 +119,10 @@ class QgsSettings : QObject
119119
explicit QgsSettings( QObject *parent = 0 );
120120
%Docstring
121121
Constructs a QgsSettings object for accessing settings of the application and organization
122-
set previously with a call to QCoreApplication::setOrganizationName(),
123-
QCoreApplication::setOrganizationDomain(), and QCoreApplication::setApplicationName().
122+
set previously with a call to QCoreApplication.setOrganizationName(),
123+
QCoreApplication.setOrganizationDomain(), and QCoreApplication.setApplicationName().
124124

125-
The scope is QSettings::UserScope and the format is defaultFormat() (QSettings::NativeFormat
125+
The scope is QSettings.UserScope and the format is defaultFormat() (QSettings.NativeFormat
126126
by default). Use setDefaultFormat() before calling this constructor to change the default
127127
format used by this constructor.
128128
%End

‎python/core/qgsvectorlayer.sip

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class QgsVectorLayer : QgsMapLayer, QgsExpressionContextGenerator
5555

5656
- crs=definition
5757
Defines the coordinate reference system to use for the layer.
58-
definition is any string accepted by QgsCoordinateReferenceSystem::createFromString()
58+
definition is any string accepted by QgsCoordinateReferenceSystem.createFromString()
5959

6060
- index=yes
6161
Specifies that the layer will be constructed with a spatial index
@@ -257,7 +257,7 @@ class QgsVectorLayer : QgsMapLayer, QgsExpressionContextGenerator
257257
- crs=crsstring
258258

259259
Defines the coordinate reference system used for the layer. This can be
260-
any string accepted by QgsCoordinateReferenceSystem::createFromString()
260+
any string accepted by QgsCoordinateReferenceSystem.createFromString()
261261

262262
-subsetIndex=(yes|no)
263263

@@ -663,15 +663,15 @@ Return the provider type for this layer
663663
Reads vector layer specific state from project file Dom node.
664664
.. note::
665665

666-
Called by QgsMapLayer::readXml().
666+
Called by QgsMapLayer.readXml().
667667
%End
668668

669669
virtual bool writeXml( QDomNode &layer_node, QDomDocument &doc ) const;
670670
%Docstring
671671
Write vector layer specific state to project file Dom node.
672672
.. note::
673673

674-
Called by QgsMapLayer::writeXml().
674+
Called by QgsMapLayer.writeXml().
675675
%End
676676

677677
void resolveReferences( QgsProject *project );
@@ -815,7 +815,7 @@ Return the provider type for this layer
815815
virtual QString subsetString() const;
816816
%Docstring
817817
Get the string (typically sql) used to define a subset of the layer
818-
\returns The subset string or QString::null if not implemented by the provider
818+
\returns The subset string or QString.null if not implemented by the provider
819819
%End
820820

821821
QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const;
@@ -1711,7 +1711,7 @@ Is emitted, before changes are rolled back
17111711
void attributeAdded( int idx );
17121712
%Docstring
17131713
Will be emitted, when a new attribute has been added to this vector layer.
1714-
Applies only to types QgsFields::OriginEdit, QgsFields::OriginProvider and QgsFields::OriginExpression
1714+
Applies only to types QgsFields.OriginEdit, QgsFields.OriginProvider and QgsFields.OriginExpression
17151715

17161716
\param idx The index of the new attribute
17171717

@@ -1721,15 +1721,15 @@ Is emitted, before changes are rolled back
17211721
void beforeAddingExpressionField( const QString &fieldName );
17221722
%Docstring
17231723
Will be emitted, when an expression field is going to be added to this vector layer.
1724-
Applies only to types QgsFields::OriginExpression
1724+
Applies only to types QgsFields.OriginExpression
17251725

17261726
\param fieldName The name of the attribute to be added
17271727
%End
17281728

17291729
void attributeDeleted( int idx );
17301730
%Docstring
17311731
Will be emitted, when an attribute has been deleted from this vector layer.
1732-
Applies only to types QgsFields::OriginEdit, QgsFields::OriginProvider and QgsFields::OriginExpression
1732+
Applies only to types QgsFields.OriginEdit, QgsFields.OriginProvider and QgsFields.OriginExpression
17331733

17341734
\param idx The index of the deleted attribute
17351735

@@ -1739,7 +1739,7 @@ Is emitted, before changes are rolled back
17391739
void beforeRemovingExpressionField( int idx );
17401740
%Docstring
17411741
Will be emitted, when an expression field is going to be deleted from this vector layer.
1742-
Applies only to types QgsFields::OriginExpression
1742+
Applies only to types QgsFields.OriginExpression
17431743

17441744
\param idx The index of the attribute to be deleted
17451745
%End

‎scripts/sipify.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ sub processDoxygenLine
1212
my $line = $_[0];
1313
# remove \a formatting
1414
$line =~ s/\\a //g;
15+
# replace :: with . (changes c++ style namespace/class directives to Python style)
16+
$line =~ s/::/./g;
1517
if ( $line =~ m/[\\@](ingroup|class)/ ) {
1618
return ""
1719
}

‎tests/scripts/sipifyheader.expected.sip

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ class QgsSipifyHeader : QtClass<QVariant>
4040
{
4141
%Docstring
4242
Documentation goes here
43+
44+
Here's some comment mentioning another class QgsAutoAwesomemater.makeAwesome.
4345
.. versionadded:: 3.0
4446
.. note::
4547

@@ -126,6 +128,7 @@ Factory annotation
126128
some brief
127129
My long doc string
128130
is not very interesting!
131+
Here's some comment mentioning another class QgsAutoAwesomemater.makeLessAwesome.
129132
%End
130133

131134
bool isOKwithErrMesg( QString &ErrMsg /Out/ );

‎tests/scripts/sipifyheader.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ typedef QVector<QVariant> QgsSuperClass;
7777

7878
/** \ingroup core
7979
* Documentation goes here
80+
*
81+
* Here's some comment mentioning another class QgsAutoAwesomemater::makeAwesome.
8082
* \since QGIS 3.0
8183
* \note some other note
8284
*/
@@ -157,6 +159,7 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private QgsBaseCla
157159
* \brief some brief
158160
* My long doc \a string
159161
* is not very interesting!
162+
* Here's some comment mentioning another class QgsAutoAwesomemater::makeLessAwesome.
160163
*/
161164
void LongDocStringMethodWithBrief();
162165

0 commit comments

Comments
 (0)
Please sign in to comment.