Fix code sample rendering in pyqgis doc

This commit is contained in:
Harrissou Sant-anna 2019-08-28 00:06:04 +02:00 committed by Nyall Dawson
parent c70d3cef2b
commit 63f5fa9c86
2 changed files with 6 additions and 0 deletions

View File

@ -54,6 +54,7 @@ The path pre-processor function is called before any bad layer handler.
Setting a new ``processor`` replaces any existing processor.
Example - replace an outdated folder path with a new one:
.. code-block:: python
def my_processor(path):
@ -62,6 +63,7 @@ Example - replace an outdated folder path with a new one:
QgsPathResolver.setPathPreprocessor(my_processor)
Example - replace a stored database host with a new one:
.. code-block:: python
def my_processor(path):
@ -71,6 +73,7 @@ Example - replace a stored database host with a new one:
Example - replace stored database credentials with new ones:
.. code-block:: python
def my_processor(path):

View File

@ -79,6 +79,7 @@ class CORE_EXPORT QgsPathResolver
* \note Setting a new \a processor replaces any existing processor.
*
* Example - replace an outdated folder path with a new one:
*
* \code{.py}
* def my_processor(path):
* return path.replace('c:/Users/ClintBarton/Documents/Projects', 'x:/Projects/')
@ -87,6 +88,7 @@ class CORE_EXPORT QgsPathResolver
* \endcode
*
* Example - replace a stored database host with a new one:
*
* \code{.py}
* def my_processor(path):
* return path.replace('host=10.1.1.115', 'host=10.1.1.116')
@ -95,6 +97,7 @@ class CORE_EXPORT QgsPathResolver
* \endcode
*
* Example - replace stored database credentials with new ones:
*
* \code{.py}
* def my_processor(path):
* path = path.replace("user='gis_team'", "user='team_awesome'")