Class: QgsConfigCache

class qgis.server.QgsConfigCache

Bases: PyQt5.QtCore.QObject

Cache for server configuration.

QgsConfigCache(settings: Optional[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, a0: QChildEvent | None)
connectNotify(self, signal: QMetaMethod)
customEvent(self, a0: QEvent | None)
disconnectNotify(self, signal: QMetaMethod)
initialize(settings: QgsServerSettings | None)

Initialize from settings.

This method must be called prior any call to QgsConfigCache.instance

Parameters:

settings (Optional[QgsServerSettings])

instance() QgsConfigCache | None

Returns the current instance.

Return type:

Optional[QgsConfigCache]

isSignalConnected(self, signal: QMetaMethod) bool
project(self, path: str | None, settings: QgsServerSettings | None = None) QgsProject | None

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 (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

projects(self) List[QgsProject]

Returns projects currently in cache.

Added in version 3.30.

Return type:

List[QgsProject]

receivers(self, signal: PYQT_SIGNAL) int
removeChangedEntries(self)

Remove all changed cache entries

removeChangedEntry(self, path: str | None)

Remove cache entry

Parameters:

path (Optional[str])

removeEntry(self, path: str | None)

Removes an entry from cache.

Parameters:

path (Optional[str]) – The path of the project

sender(self) QObject | None
senderSignalIndex(self) int
strategyName(self) str

Returns the name of the current strategy

Added in version 3.26.

Return type:

str

timerEvent(self, a0: QTimerEvent | None)