QGIS/python/PyQt6/core/auto_additions/qgsexpression.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

44 lines
3.6 KiB
Python

# The following has been generated automatically from src/core/expression/qgsexpression.h
QgsExpression.ParserError.Unknown = QgsExpression.ParserError.ParserErrorType.Unknown
QgsExpression.ParserError.FunctionUnknown = QgsExpression.ParserError.ParserErrorType.FunctionUnknown
QgsExpression.ParserError.FunctionWrongArgs = QgsExpression.ParserError.ParserErrorType.FunctionWrongArgs
QgsExpression.ParserError.FunctionInvalidParams = QgsExpression.ParserError.ParserErrorType.FunctionInvalidParams
QgsExpression.ParserError.FunctionNamedArgsError = QgsExpression.ParserError.ParserErrorType.FunctionNamedArgsError
QgsExpression.soBbox = QgsExpression.SpatialOperator.soBbox
QgsExpression.soIntersects = QgsExpression.SpatialOperator.soIntersects
QgsExpression.soContains = QgsExpression.SpatialOperator.soContains
QgsExpression.soCrosses = QgsExpression.SpatialOperator.soCrosses
QgsExpression.soEquals = QgsExpression.SpatialOperator.soEquals
QgsExpression.soDisjoint = QgsExpression.SpatialOperator.soDisjoint
QgsExpression.soOverlaps = QgsExpression.SpatialOperator.soOverlaps
QgsExpression.soTouches = QgsExpression.SpatialOperator.soTouches
QgsExpression.soWithin = QgsExpression.SpatialOperator.soWithin
try:
QgsExpression.__attribute_docs__ = {'errorType': 'The type of parser error that was found.', 'errorMsg': 'The message for the error at this location.', 'firstLine': "The first line that contained the error in the parser.\nDepending on the error sometimes this doesn't mean anything.", 'firstColumn': "The first column that contained the error in the parser.\nDepending on the error sometimes this doesn't mean anything.", 'lastLine': 'The last line that contained the error in the parser.', 'lastColumn': 'The last column that contained the error in the parser.'}
except NameError:
pass
QgsExpression.expressionToLayerFieldIndex = staticmethod(QgsExpression.expressionToLayerFieldIndex)
QgsExpression.quoteFieldExpression = staticmethod(QgsExpression.quoteFieldExpression)
QgsExpression.checkExpression = staticmethod(QgsExpression.checkExpression)
QgsExpression.replaceExpressionText = staticmethod(QgsExpression.replaceExpressionText)
QgsExpression.evaluateToDouble = staticmethod(QgsExpression.evaluateToDouble)
QgsExpression.registerFunction = staticmethod(QgsExpression.registerFunction)
QgsExpression.unregisterFunction = staticmethod(QgsExpression.unregisterFunction)
QgsExpression.cleanRegisteredFunctions = staticmethod(QgsExpression.cleanRegisteredFunctions)
QgsExpression.isFunctionName = staticmethod(QgsExpression.isFunctionName)
QgsExpression.functionIndex = staticmethod(QgsExpression.functionIndex)
QgsExpression.functionCount = staticmethod(QgsExpression.functionCount)
QgsExpression.quotedColumnRef = staticmethod(QgsExpression.quotedColumnRef)
QgsExpression.quotedString = staticmethod(QgsExpression.quotedString)
QgsExpression.quotedValue = staticmethod(QgsExpression.quotedValue)
QgsExpression.helpText = staticmethod(QgsExpression.helpText)
QgsExpression.tags = staticmethod(QgsExpression.tags)
QgsExpression.addVariableHelpText = staticmethod(QgsExpression.addVariableHelpText)
QgsExpression.variableHelpText = staticmethod(QgsExpression.variableHelpText)
QgsExpression.formatVariableHelp = staticmethod(QgsExpression.formatVariableHelp)
QgsExpression.group = staticmethod(QgsExpression.group)
QgsExpression.formatPreviewString = staticmethod(QgsExpression.formatPreviewString)
QgsExpression.createFieldEqualityExpression = staticmethod(QgsExpression.createFieldEqualityExpression)
QgsExpression.isFieldEqualityExpression = staticmethod(QgsExpression.isFieldEqualityExpression)
QgsExpression.attemptReduceToInClause = staticmethod(QgsExpression.attemptReduceToInClause)