QGIS/python/core/auto_additions/qgscadutils.py
Nyall Dawson 1f27fc627a [pyqgis] Wrap unambiguously static methods in staticmethod
sip doesn't use the standard Python staticmethod type for defining
static methods, which means that standard means of testing
for a static method (like `isinstance(..., staticmethod)`) fail
with any PyQGIS static methods.

This causes issues with lint tools, which incorrectly flag
calls to QGIS static methods as missing self arguments. It also
breaks detection of static methods in the sphinx PyQGIS docs,
so all static methods are shown as non-static.

Work around this in sipify, by wrapping unambiguously static
methods in staticmethod wrappers.
2024-08-14 22:08:41 +10:00

15 lines
1.8 KiB
Python

# The following has been generated automatically from src/core/qgscadutils.h
try:
QgsCadUtils.AlignMapPointConstraint.__attribute_docs__ = {'locked': 'Whether the constraint is active, i.e. should be considered', 'relative': 'Whether the value is relative to previous value', 'value': 'Numeric value of the constraint (coordinate/distance in map units or angle in degrees)'}
except NameError:
pass
try:
QgsCadUtils.AlignMapPointOutput.__attribute_docs__ = {'valid': 'Whether the combination of constraints is actually valid', 'finalMapPoint': 'map point aligned according to the constraints', 'snapMatch': 'Snapped point - only valid if actually used for something\n\n.. versionadded:: 3.14', 'edgeMatch': 'Snapped segment - only valid if actually used for something\n\n.. deprecated::\n will be removed in QGIS 4.0 - use snapMatch instead', 'softLockCommonAngle': 'Angle (in degrees) to which we have soft-locked ourselves (if not set it is -1)'}
except NameError:
pass
try:
QgsCadUtils.AlignMapPointContext.__attribute_docs__ = {'snappingUtils': 'Snapping utils that will be used to snap point to map. Must not be ``None``.', 'mapUnitsPerPixel': 'Map units/pixel ratio from map canvas.', 'xConstraint': 'Constraint for X coordinate', 'yConstraint': 'Constraint for Y coordinate', 'zConstraint': 'Constraint for Z coordinate\n\n.. versionadded:: 3.22', 'mConstraint': 'Constraint for M coordinate\n\n.. versionadded:: 3.22', 'distanceConstraint': 'Constraint for distance', 'angleConstraint': 'Constraint for angle', 'commonAngleConstraint': 'Constraint for soft lock to a common angle', 'snappingToFeaturesOverridesCommonAngle': 'Flag to set snapping to features priority over common angle.\n\n.. versionadded:: 3.32'}
except NameError:
pass
QgsCadUtils.alignMapPoint = staticmethod(QgsCadUtils.alignMapPoint)