Class: QgsExternalStorage¶
Abstract interface for external storage - to be implemented by various
backends and registered in QgsExternalStorageRegistry
.
Added in version 3.22.
Methods
Returns the translated external storage name, which should be used for any user-visible display of the external storage name. |
|
Fetches file from url using authCfg for this project external storage. |
|
Stores file filePath to the url using authCfg authentication for this project external storage. |
|
Fetches file from url for this project external storage. |
|
Stores file filePath to the url for this project external storage. |
|
Unique identifier of the external storage type. |
- class qgis.core.QgsExternalStorage[source]¶
Bases:
object
- displayName(self) str [source]¶
Returns the translated external storage name, which should be used for any user-visible display of the external storage name.
- Return type:
str
- doFetch(self, url: str | None, authCfg: str | None = '') QgsExternalStorageFetchedContent | None [source]¶
Fetches file from
url
usingauthCfg
for this project external storage.See also
- Parameters:
url (Optional[str])
authCfg (Optional[str] = '')
- Return type:
Optional[QgsExternalStorageFetchedContent]
- doStore(self, filePath: str | None, url: str | None, authCfg: str | None = '') QgsExternalStorageStoredContent | None [source]¶
Stores file
filePath
to theurl
usingauthCfg
authentication for this project external storage.See also
- Parameters:
filePath (Optional[str])
url (Optional[str])
authCfg (Optional[str] = '')
- Return type:
Optional[QgsExternalStorageStoredContent]
- fetch(self, url: str | None, authCfg: str | None = '', fetchingMode: Qgis.ActionStart = Qgis.ActionStart.Deferred) QgsExternalStorageFetchedContent | None [source]¶
Fetches file from
url
for this project external storage. Fetching process is run in background. Returns aQgsExternalStorageFetchedContent
to follow the status of the fetched resource.fetchingMode
defines if the download will start immediately or shall be manually triggered callingQgsExternalStorageFetchedContent.fetch()
. User should useQgis
.ActionStart.Deferred if he needs to connect thefetched()
signal.After using this method, user should wait for
QgsExternalStorageStoredContent.fetched()
,QgsExternalStorageStoredContent.errorOccurred()
orQgsExternalStorageStoredContent.canceled()
signals.It’s possible to give
authCfg
authentication configuration id in case its needed.- Parameters:
url (Optional[str])
authCfg (Optional[str] = '')
fetchingMode (Qgis.ActionStart = Qgis.ActionStart.Deferred)
- Return type:
Optional[QgsExternalStorageFetchedContent]
- store(self, filePath: str | None, url: str | None, authCfg: str | None = '', storingMode: Qgis.ActionStart = Qgis.ActionStart.Deferred) QgsExternalStorageStoredContent | None [source]¶
Stores file
filePath
to theurl
for this project external storage. Storing process is run in background. Returns aQgsExternalStorageStoredContent
to follow the status of the stored resource.storingMode
defines if the download will start immediately or shall be manually triggered callingQgsExternalStorageStoredContent.store()
. User should useQgis
.ActionStart.Deferred if he needs to connect thestored()
signal.After using this method, user wait for
QgsExternalStorageStoredContent.stored()
,QgsExternalStorageStoredContent.errorOccurred()
orQgsExternalStorageStoredContent.canceled()
signals.It’s possible to give
authCfg
authentication configuration id in case its needed.Caller takes ownership of the returned symbol.
- Parameters:
filePath (Optional[str])
url (Optional[str])
authCfg (Optional[str] = '')
storingMode (Qgis.ActionStart = Qgis.ActionStart.Deferred)
- Return type:
Optional[QgsExternalStorageStoredContent]