Class: QgsConfigCache¶
Cache for server configuration.
Class Hierarchy¶
Base classes¶
Methods
If the project is not cached yet, then the project is read from the path. |
|
Returns projects currently in cache. |
|
Remove all changed cache entries |
|
Remove cache entry |
|
Removes an entry from cache. |
|
Returns the name of the current strategy |
Static Methods
Initialize from settings. |
|
Returns the current instance. |
Signals
Emitted whenever a project is removed from the cache. |
- class qgis.server.QgsConfigCache[source]¶
Bases:
QObject
- __init__(settings: QgsServerSettings | None)
Initialize from settings
- Parameters:
settings (Optional[QgsServerSettings])
- static initialize(settings: QgsServerSettings | None)[source]¶
Initialize from settings.
This method must be called prior any call to QgsConfigCache.instance
- Parameters:
settings (Optional[QgsServerSettings])
- static instance() QgsConfigCache | None [source]¶
Returns the current instance.
- Return type:
Optional[QgsConfigCache]
- project(self, path: str | None, settings: QgsServerSettings | None = None) QgsProject | None [source]¶
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 (Optional[str]) – the filename of the QGIS project
settings (Optional[QgsServerSettings] = None) – QGIS server settings
- Return type:
Optional[QgsProject]
- Returns:
the project or
None
if an error happened
- signal projectRemovedFromCache(path: str)[source]¶
Emitted whenever a project is removed from the cache.
Added in version 3.38.
- Parameters:
path (str)
- projects(self) List[QgsProject] ¶
Returns projects currently in cache.
Added in version 3.30.
- Return type:
List[QgsProject]
- removeChangedEntry(self, path: str | None)[source]¶
Remove cache entry
- Parameters:
path (Optional[str])