Commit 88d1d4fd authored by Benjamin Jakimow's avatar Benjamin Jakimow
Browse files
parent 719a18a8
......@@ -279,20 +279,20 @@ def registerQgsExpressionFunctions():
if QgsExpression.isFunctionName(
if not QgsExpression.unregisterFunction(
msgtitle = QCoreApplication.translate("UserExpressions", "User expressions")
msg = QCoreApplication.translate("UserExpressions",
"User expression {0} already exists and "
"can not be unregistered.").format(
QgsMessageLog.logMessage(msg + "\n", msgtitle, Qgis.Warning)
QgsMessageLog.logMessage(msg + "\n", level=Qgis.Warning)
return None
if QgsExpression.registerFunction(func):
QgsMessageLog.logMessage(f'Registered {}', level=Qgis.Info)
QgsMessageLog.logMessage(f'Failed to register {}', level=Qgis.Warning)
def unregisterQgsExpressionFunctions():
msgtitle = QCoreApplication.translate("UserExpressions", "User expressions")
for name, func in QGIS_FUNCTION_INSTANCES.items():
if QgsExpression.unregisterFunction(name):
QgsMessageLog.logMessage(f'Unregistered {name}', msgtitle, Qgis.Info)
QgsMessageLog.logMessage(f'Unregistered {name}', level=Qgis.Info)
QgsMessageLog.logMessage(f'Unable to unregister {name}', msgtitle, Qgis.Warning)
\ No newline at end of file
QgsMessageLog.logMessage(f'Unable to unregister {name}',level=Qgis.Warning)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment