Class: QgsNetworkContentFetcherRegistry

class qgis.core.QgsNetworkContentFetcherRegistry

Bases: PyQt5.QtCore.QObject

Create the registry for temporary downloaded files

Registry for temporary fetched files

This provides a simple way of downloading and accessing remote files during QGIS application running.

Methods

childEvent

connectNotify

customEvent

disconnectNotify

fetch

Initialize a download for the given URL

isSignalConnected

localPath

Returns the path to a local file or to a temporary file previously fetched by the registry

receivers

sender

senderSignalIndex

timerEvent

Attributes

DownloadImmediately

DownloadLater

DownloadImmediately = 1
DownloadLater = 0
class FetchingMode

Bases: int

baseClass

alias of QgsNetworkContentFetcherRegistry

childEvent()
connectNotify()
customEvent()
disconnectNotify()
fetch(self, url: str, fetchingMode: QgsNetworkContentFetcherRegistry.FetchingMode = QgsNetworkContentFetcherRegistry.DownloadLater) → QgsFetchedContent

Initialize a download for the given URL

Parameters
  • url (str) – the URL to be fetched

  • fetchingMode (QgsNetworkContentFetcherRegistry.FetchingMode = QgsNetworkContentFetcherRegistry.DownloadLater) – defines if the download will start immediately or shall be manually triggered

Note

If the download starts immediately, it will not redownload any already fetched or currently fetching file.

Return type

QgsFetchedContent

isSignalConnected()
localPath(self, filePathOrUrl: str) → str

Returns the path to a local file or to a temporary file previously fetched by the registry

Parameters

filePathOrUrl (str) – can either be a local file path or a remote content which has previously been fetched

Return type

str

receivers()
sender()
senderSignalIndex()
timerEvent()