Class: QgsConfigCache¶
-
class
qgis.server.
QgsConfigCache
¶ Bases:
PyQt5.QtCore.QObject
Cache for server configuration.
Methods
Returns the current instance.
If the project is not cached yet, then the project is read from the path.
Removes an entry from cache.
-
instance
() → QgsConfigCache¶ Returns the current instance.
- Return type
-
project
(self, path: str, settings: QgsServerSettings = None) → QgsProject¶ If the project is not cached yet, then the project is read from the path. If the project is not available, then
None
is returned. If the project contains any bad layer it is considered unavailable unless the server configuration variable QGIS_SERVER_IGNORE_BAD_LAYERS passed in the optional settings argument is set toTrue
(the default value isFalse
).- Parameters
path (str) – the filename of the QGIS project
settings (
QgsServerSettings
= None) – QGIS server settings
- Return type
- Returns
the project or
None
if an error happened
New in version 3.0.
-
removeEntry
(self, path: str)¶ Removes an entry from cache.
- Parameters
path (str) – The path of the project
-