Skip to content

Commit e0af537

Browse files
committed
Add missing enum class monkey patching
Fix accidental API break introduced by qgis#61451
1 parent 364530d commit e0af537

File tree

10 files changed

+94
-34
lines changed

10 files changed

+94
-34
lines changed

python/PyQt6/analysis/auto_additions/qgskde.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,21 @@
6868
"""
6969
# --
7070
# monkey patching scoped based enum
71-
QgsKernelDensityEstimation.Result.Success.__doc__ = "Operation completed successfully"
72-
QgsKernelDensityEstimation.Result.DriverError.__doc__ = "Could not open the driver for the specified format"
73-
QgsKernelDensityEstimation.Result.InvalidParameters.__doc__ = "Input parameters were not valid"
74-
QgsKernelDensityEstimation.Result.FileCreationError.__doc__ = "Error creating output file"
75-
QgsKernelDensityEstimation.Result.RasterIoError.__doc__ = "Error writing to raster"
71+
QgsKernelDensityEstimation.Success = QgsKernelDensityEstimation.Result.Success
72+
QgsKernelDensityEstimation.Success.is_monkey_patched = True
73+
QgsKernelDensityEstimation.Success.__doc__ = "Operation completed successfully"
74+
QgsKernelDensityEstimation.DriverError = QgsKernelDensityEstimation.Result.DriverError
75+
QgsKernelDensityEstimation.DriverError.is_monkey_patched = True
76+
QgsKernelDensityEstimation.DriverError.__doc__ = "Could not open the driver for the specified format"
77+
QgsKernelDensityEstimation.InvalidParameters = QgsKernelDensityEstimation.Result.InvalidParameters
78+
QgsKernelDensityEstimation.InvalidParameters.is_monkey_patched = True
79+
QgsKernelDensityEstimation.InvalidParameters.__doc__ = "Input parameters were not valid"
80+
QgsKernelDensityEstimation.FileCreationError = QgsKernelDensityEstimation.Result.FileCreationError
81+
QgsKernelDensityEstimation.FileCreationError.is_monkey_patched = True
82+
QgsKernelDensityEstimation.FileCreationError.__doc__ = "Error creating output file"
83+
QgsKernelDensityEstimation.RasterIoError = QgsKernelDensityEstimation.Result.RasterIoError
84+
QgsKernelDensityEstimation.RasterIoError.is_monkey_patched = True
85+
QgsKernelDensityEstimation.RasterIoError.__doc__ = "Error writing to raster"
7686
QgsKernelDensityEstimation.Result.__doc__ = """Result of operation
7787
7888
* ``Success``: Operation completed successfully

python/PyQt6/analysis/auto_additions/qgsrastercalculator.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
11
# The following has been generated automatically from src/analysis/raster/qgsrastercalculator.h
22
# monkey patching scoped based enum
3-
QgsRasterCalculator.Result.Success.__doc__ = "Calculation successful"
4-
QgsRasterCalculator.Result.CreateOutputError.__doc__ = "Error creating output data file"
5-
QgsRasterCalculator.Result.InputLayerError.__doc__ = "Error reading input layer"
6-
QgsRasterCalculator.Result.Canceled.__doc__ = "User canceled calculation"
7-
QgsRasterCalculator.Result.ParserError.__doc__ = "Error parsing formula"
8-
QgsRasterCalculator.Result.MemoryError.__doc__ = "Error allocating memory for result"
9-
QgsRasterCalculator.Result.BandError.__doc__ = "Invalid band number for input"
10-
QgsRasterCalculator.Result.CalculationError.__doc__ = "Error occurred while performing calculation"
3+
QgsRasterCalculator.Success = QgsRasterCalculator.Result.Success
4+
QgsRasterCalculator.Success.is_monkey_patched = True
5+
QgsRasterCalculator.Success.__doc__ = "Calculation successful"
6+
QgsRasterCalculator.CreateOutputError = QgsRasterCalculator.Result.CreateOutputError
7+
QgsRasterCalculator.CreateOutputError.is_monkey_patched = True
8+
QgsRasterCalculator.CreateOutputError.__doc__ = "Error creating output data file"
9+
QgsRasterCalculator.InputLayerError = QgsRasterCalculator.Result.InputLayerError
10+
QgsRasterCalculator.InputLayerError.is_monkey_patched = True
11+
QgsRasterCalculator.InputLayerError.__doc__ = "Error reading input layer"
12+
QgsRasterCalculator.Canceled = QgsRasterCalculator.Result.Canceled
13+
QgsRasterCalculator.Canceled.is_monkey_patched = True
14+
QgsRasterCalculator.Canceled.__doc__ = "User canceled calculation"
15+
QgsRasterCalculator.ParserError = QgsRasterCalculator.Result.ParserError
16+
QgsRasterCalculator.ParserError.is_monkey_patched = True
17+
QgsRasterCalculator.ParserError.__doc__ = "Error parsing formula"
18+
QgsRasterCalculator.MemoryError = QgsRasterCalculator.Result.MemoryError
19+
QgsRasterCalculator.MemoryError.is_monkey_patched = True
20+
QgsRasterCalculator.MemoryError.__doc__ = "Error allocating memory for result"
21+
QgsRasterCalculator.BandError = QgsRasterCalculator.Result.BandError
22+
QgsRasterCalculator.BandError.is_monkey_patched = True
23+
QgsRasterCalculator.BandError.__doc__ = "Invalid band number for input"
24+
QgsRasterCalculator.CalculationError = QgsRasterCalculator.Result.CalculationError
25+
QgsRasterCalculator.CalculationError.is_monkey_patched = True
26+
QgsRasterCalculator.CalculationError.__doc__ = "Error occurred while performing calculation"
1127
QgsRasterCalculator.Result.__doc__ = """Result of the calculation
1228
1329
* ``Success``: Calculation successful

python/PyQt6/analysis/auto_additions/qgstininterpolator.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# The following has been generated automatically from src/analysis/interpolation/qgstininterpolator.h
22
# monkey patching scoped based enum
3-
QgsTinInterpolator.TinInterpolation.Linear.__doc__ = "Linear interpolation"
4-
QgsTinInterpolator.TinInterpolation.CloughTocher.__doc__ = "Clough-Tocher interpolation"
3+
QgsTinInterpolator.Linear = QgsTinInterpolator.TinInterpolation.Linear
4+
QgsTinInterpolator.Linear.is_monkey_patched = True
5+
QgsTinInterpolator.Linear.__doc__ = "Linear interpolation"
6+
QgsTinInterpolator.CloughTocher = QgsTinInterpolator.TinInterpolation.CloughTocher
7+
QgsTinInterpolator.CloughTocher.is_monkey_patched = True
8+
QgsTinInterpolator.CloughTocher.__doc__ = "Clough-Tocher interpolation"
59
QgsTinInterpolator.TinInterpolation.__doc__ = """Indicates the type of interpolation to be performed
610
711
* ``Linear``: Linear interpolation

python/analysis/auto_additions/qgskde.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,21 @@
6868
"""
6969
# --
7070
# monkey patching scoped based enum
71-
QgsKernelDensityEstimation.Result.Success.__doc__ = "Operation completed successfully"
72-
QgsKernelDensityEstimation.Result.DriverError.__doc__ = "Could not open the driver for the specified format"
73-
QgsKernelDensityEstimation.Result.InvalidParameters.__doc__ = "Input parameters were not valid"
74-
QgsKernelDensityEstimation.Result.FileCreationError.__doc__ = "Error creating output file"
75-
QgsKernelDensityEstimation.Result.RasterIoError.__doc__ = "Error writing to raster"
71+
QgsKernelDensityEstimation.Success = QgsKernelDensityEstimation.Result.Success
72+
QgsKernelDensityEstimation.Success.is_monkey_patched = True
73+
QgsKernelDensityEstimation.Success.__doc__ = "Operation completed successfully"
74+
QgsKernelDensityEstimation.DriverError = QgsKernelDensityEstimation.Result.DriverError
75+
QgsKernelDensityEstimation.DriverError.is_monkey_patched = True
76+
QgsKernelDensityEstimation.DriverError.__doc__ = "Could not open the driver for the specified format"
77+
QgsKernelDensityEstimation.InvalidParameters = QgsKernelDensityEstimation.Result.InvalidParameters
78+
QgsKernelDensityEstimation.InvalidParameters.is_monkey_patched = True
79+
QgsKernelDensityEstimation.InvalidParameters.__doc__ = "Input parameters were not valid"
80+
QgsKernelDensityEstimation.FileCreationError = QgsKernelDensityEstimation.Result.FileCreationError
81+
QgsKernelDensityEstimation.FileCreationError.is_monkey_patched = True
82+
QgsKernelDensityEstimation.FileCreationError.__doc__ = "Error creating output file"
83+
QgsKernelDensityEstimation.RasterIoError = QgsKernelDensityEstimation.Result.RasterIoError
84+
QgsKernelDensityEstimation.RasterIoError.is_monkey_patched = True
85+
QgsKernelDensityEstimation.RasterIoError.__doc__ = "Error writing to raster"
7686
QgsKernelDensityEstimation.Result.__doc__ = """Result of operation
7787
7888
* ``Success``: Operation completed successfully

python/analysis/auto_additions/qgsrastercalculator.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
11
# The following has been generated automatically from src/analysis/raster/qgsrastercalculator.h
22
# monkey patching scoped based enum
3-
QgsRasterCalculator.Result.Success.__doc__ = "Calculation successful"
4-
QgsRasterCalculator.Result.CreateOutputError.__doc__ = "Error creating output data file"
5-
QgsRasterCalculator.Result.InputLayerError.__doc__ = "Error reading input layer"
6-
QgsRasterCalculator.Result.Canceled.__doc__ = "User canceled calculation"
7-
QgsRasterCalculator.Result.ParserError.__doc__ = "Error parsing formula"
8-
QgsRasterCalculator.Result.MemoryError.__doc__ = "Error allocating memory for result"
9-
QgsRasterCalculator.Result.BandError.__doc__ = "Invalid band number for input"
10-
QgsRasterCalculator.Result.CalculationError.__doc__ = "Error occurred while performing calculation"
3+
QgsRasterCalculator.Success = QgsRasterCalculator.Result.Success
4+
QgsRasterCalculator.Success.is_monkey_patched = True
5+
QgsRasterCalculator.Success.__doc__ = "Calculation successful"
6+
QgsRasterCalculator.CreateOutputError = QgsRasterCalculator.Result.CreateOutputError
7+
QgsRasterCalculator.CreateOutputError.is_monkey_patched = True
8+
QgsRasterCalculator.CreateOutputError.__doc__ = "Error creating output data file"
9+
QgsRasterCalculator.InputLayerError = QgsRasterCalculator.Result.InputLayerError
10+
QgsRasterCalculator.InputLayerError.is_monkey_patched = True
11+
QgsRasterCalculator.InputLayerError.__doc__ = "Error reading input layer"
12+
QgsRasterCalculator.Canceled = QgsRasterCalculator.Result.Canceled
13+
QgsRasterCalculator.Canceled.is_monkey_patched = True
14+
QgsRasterCalculator.Canceled.__doc__ = "User canceled calculation"
15+
QgsRasterCalculator.ParserError = QgsRasterCalculator.Result.ParserError
16+
QgsRasterCalculator.ParserError.is_monkey_patched = True
17+
QgsRasterCalculator.ParserError.__doc__ = "Error parsing formula"
18+
QgsRasterCalculator.MemoryError = QgsRasterCalculator.Result.MemoryError
19+
QgsRasterCalculator.MemoryError.is_monkey_patched = True
20+
QgsRasterCalculator.MemoryError.__doc__ = "Error allocating memory for result"
21+
QgsRasterCalculator.BandError = QgsRasterCalculator.Result.BandError
22+
QgsRasterCalculator.BandError.is_monkey_patched = True
23+
QgsRasterCalculator.BandError.__doc__ = "Invalid band number for input"
24+
QgsRasterCalculator.CalculationError = QgsRasterCalculator.Result.CalculationError
25+
QgsRasterCalculator.CalculationError.is_monkey_patched = True
26+
QgsRasterCalculator.CalculationError.__doc__ = "Error occurred while performing calculation"
1127
QgsRasterCalculator.Result.__doc__ = """Result of the calculation
1228
1329
* ``Success``: Calculation successful

python/analysis/auto_additions/qgstininterpolator.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# The following has been generated automatically from src/analysis/interpolation/qgstininterpolator.h
22
# monkey patching scoped based enum
3-
QgsTinInterpolator.TinInterpolation.Linear.__doc__ = "Linear interpolation"
4-
QgsTinInterpolator.TinInterpolation.CloughTocher.__doc__ = "Clough-Tocher interpolation"
3+
QgsTinInterpolator.Linear = QgsTinInterpolator.TinInterpolation.Linear
4+
QgsTinInterpolator.Linear.is_monkey_patched = True
5+
QgsTinInterpolator.Linear.__doc__ = "Linear interpolation"
6+
QgsTinInterpolator.CloughTocher = QgsTinInterpolator.TinInterpolation.CloughTocher
7+
QgsTinInterpolator.CloughTocher.is_monkey_patched = True
8+
QgsTinInterpolator.CloughTocher.__doc__ = "Clough-Tocher interpolation"
59
QgsTinInterpolator.TinInterpolation.__doc__ = """Indicates the type of interpolation to be performed
610
711
* ``Linear``: Linear interpolation

src/analysis/interpolation/qgstininterpolator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ANALYSIS_EXPORT QgsTinInterpolator : public QgsInterpolator
3737
{
3838
public:
3939
//! Indicates the type of interpolation to be performed
40-
enum class TinInterpolation : int
40+
enum class TinInterpolation SIP_MONKEYPATCH_SCOPEENUM_UNNEST( QgsTinInterpolator, TinInterpolation ) : int
4141
{
4242
Linear, //!< Linear interpolation
4343
CloughTocher, //!< Clough-Tocher interpolation

src/analysis/interpolation/qgstriangulation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class ANALYSIS_EXPORT QgsTriangulation
4242
{
4343
public:
4444
//! Enumeration describing the behavior, if two forced lines cross.
45-
enum class ForcedCrossBehavior : int
45+
enum class ForcedCrossBehavior SIP_MONKEYPATCH_SCOPEENUM_UNNEST( QgsTriangulation, ForcedCrossBehavior ) : int
4646
{
4747
SnappingTypeVertex, //!< The second inserted forced line is snapped to the closest vertice of the first inserted forced line.
4848
DeleteFirst, //!< The status of the first inserted forced line is reset to that of a normal edge (so that the second inserted forced line remain and the first not)

src/analysis/raster/qgskde.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class ANALYSIS_EXPORT QgsKernelDensityEstimation
5656
};
5757

5858
//! Result of operation
59-
enum class Result : int
59+
enum class Result SIP_MONKEYPATCH_SCOPEENUM_UNNEST( QgsKernelDensityEstimation, Result ) : int
6060
{
6161
Success, //!< Operation completed successfully
6262
DriverError, //!< Could not open the driver for the specified format

src/analysis/raster/qgsrastercalculator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class ANALYSIS_EXPORT QgsRasterCalculator
7575
{
7676
public:
7777
//! Result of the calculation
78-
enum class Result : int
78+
enum class Result SIP_MONKEYPATCH_SCOPEENUM_UNNEST( QgsRasterCalculator, Result ) : int
7979
{
8080
Success = 0, //!< Calculation successful
8181
CreateOutputError = 1, //!< Error creating output data file

0 commit comments

Comments
 (0)