How can I document my custom Python functions in QGIS?
I would like to offer users help for functions I wrote for them:
I've tried adding a docstring:
But whenever I click Load an error message is displayed:
The error message clearly shows an indentation error, which does not correspond to my actual code.
Answer
What you are doing is the correct way to document your custom function.
The error you are encountering is because by default when you write a function in the Function Editor, the indentation before the return
statement is that of 4 spaces characters and not 'tab space'. Just check if that is the case. The indentation should be consistent (either only spaces or tab space).
No comments:
Post a Comment