Subgroup: Network

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.

New in version 3.2: 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

Signals

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 – the URL to be fetched
  • fetchingMode – 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.

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 – can either be a local file path or a remote content which has previously been fetched
receivers()
sender()
senderSignalIndex()
timerEvent()