Class: QgsConfigCache

class qgis.server.QgsConfigCache

Bases: PyQt5.QtCore.QObject

Cache for server configuration.

QgsConfigCache(settings: QgsServerSettings) Initialize from settings

Methods

childEvent

connectNotify

customEvent

disconnectNotify

initialize

Initialize from settings.

instance

Returns the current instance.

isSignalConnected

project

If the project is not cached yet, then the project is read from the path.

projects

Returns projects currently in cache.

receivers

removeChangedEntries

Remove all changed cache entries

removeChangedEntry

Remove cache entry

removeEntry

Removes an entry from cache.

sender

senderSignalIndex

strategyName

Returns the name of the current strategy

timerEvent

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:

QgsConfigCache

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 to True (the default value is False).

Parameters:
  • path (str) – the filename of the QGIS project

  • settings (QgsServerSettings = None) – QGIS server settings

Return type:

QgsProject

Returns:

the project or None if an error happened

projects(self) List[QgsProject]

Returns projects currently in cache.

New 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

New in version 3.26.

Return type:

str

timerEvent(self, QTimerEvent)