Class: QgsConfigCache¶
- class qgis.server.QgsConfigCache¶
Bases:
PyQt5.QtCore.QObject
Cache for server configuration.
QgsConfigCache(settings:
QgsServerSettings
) Initialize from settingsMethods
Initialize from settings.
Returns the current instance.
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
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- initialize(settings: QgsServerSettings)¶
Initialize from settings.
This method must be called prior any call to QgsConfigCache.instance
- Parameters:
settings (QgsServerSettings)
- instance() QgsConfigCache ¶
Returns the current instance.
- Return type:
- isSignalConnected(self, QMetaMethod) bool ¶
- 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
- projectRemovedFromCache¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...)
revision (int = ...)
arguments (Sequence = ...)
- Return type:
PYQT_SIGNAL
- projects(self) List[QgsProject] ¶
Returns projects currently in cache.
Added in version 3.30.
- Return type:
List[QgsProject]
- receivers(self, PYQT_SIGNAL) int ¶
- removeChangedEntries(self)¶
Remove all changed cache entries
- removeChangedEntry(self, path: str)¶
Remove cache entry
- Parameters:
path (str)
- removeEntry(self, path: str)¶
Removes an entry from cache.
- Parameters:
path (str) – The path of the project
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- strategyName(self) str ¶
Returns the name of the current strategy
Added in version 3.26.
- Return type:
str
- timerEvent(self, QTimerEvent)¶