Class: QgsArchive¶
Class allowing to manage the zip/unzip actions
Class Hierarchy¶
Subclasses¶
Class allowing to manage the zip/unzip actions on project file |
Methods
Add a new file to this archive. |
|
Clear the current content of this archive and create a new temporary directory. |
|
Returns the current temporary directory. |
|
Returns |
|
Returns the list of files within this archive |
|
Remove a file from this archive and from the filesystem. |
|
Clear the current content of this archive and unzip. |
|
Zip the content of this archive |
- class qgis.core.QgsArchive[source]¶
Bases:
object
- addFile(self, filename: str | None)[source]¶
Add a new file to this archive. During a zip action, this file will be part of the resulting zipped file.
- Parameters:
filename (Optional[str]) – A file to add when zipping this archive
- clear(self)[source]¶
Clear the current content of this archive and create a new temporary directory.
- exists(self) bool [source]¶
Returns
True
if the archive exists on the filesystem,False
otherwise.Added in version 3.20.
- Return type:
bool
- files(self) List[str] [source]¶
Returns the list of files within this archive
- Return type:
List[str]
- removeFile(self, filename: str | None) bool [source]¶
Remove a file from this archive and from the filesystem.
- Parameters:
filename (Optional[str]) – The path of the file to remove
- Return type:
bool
- Returns:
True
if the file has been removed from the filesystem,False
otherwise