GCab.Cabinet¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Reserved |
||
r/w |
Signature |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class GCab.Cabinet(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
An opaque object holding a Cabinet file reference.
- classmethod new()¶
- Returns:
a new
GCab.Cabinet
- Return type:
Create a new
GCab.Cabinet
object to read or create a Cabinet archive.
- add_allowed_compression(compression)¶
- Parameters:
compression (
GCab.Compression
) – aGCab.Compression
kind, e.g.GCab.Compression.MSZIP
Adds a compression kind to the allow-list. By default, GCab will use all decompression support compiled in at build time. Once this function has been called only specific compression kinds will be used in functions like
GCab.Cabinet.load
().New in version 1.6.
- add_folder(folder)¶
- Parameters:
folder (
GCab.Folder
) – aGCab.Folder
- Raises:
- Returns:
True
on success.- Return type:
Add folder to self.
- extract(path, file_callback, progress_callback, user_data, cancellable)¶
- Parameters:
file_callback (
GCab.FileCallback
orNone
) – an optionalGCab.File
callback, returnFalse
to filter out or skip files.progress_callback (
Gio.FileProgressCallback
orNone
) – a progress callbackcancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignore
- Raises:
- Returns:
True
on success.- Return type:
Extract files to given path.
If path is
None
then the files are decompressed to memory blobs stored on eachGCab.File
.
- extract_simple(path, file_callback, user_data, cancellable)¶
- Parameters:
path (
Gio.File
) – the path to extract filesfile_callback (
GCab.FileCallback
orNone
) – an optionalGCab.File
callback, returnFalse
to filter out or skip files.cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignore
- Raises:
- Returns:
True
on success.- Return type:
Extract files to given path.
- get_folders()¶
- Returns:
an array of
GCab.Folder
- Return type:
Get the Cabinet folders within the self. Note that Cabinet folders are not like filesystem path, they are group of files sharing some layout parameters.
- get_signature(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignore- Raises:
- Returns:
the array containing the PKCS#7 signed data or
None
on error.- Return type:
Lookup the cabinet authenticode signature if any.
New in version 0.5.
- get_size()¶
- Returns:
size in bytes
- Return type:
Get the size of the compressed cabinet file.
New in version 1.0.
- load(stream, cancellable)¶
- Parameters:
stream (
Gio.InputStream
) – aGio.InputStream
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignore
- Raises:
- Returns:
True
on success- Return type:
Load a cabinet archive.
- write(stream, file_callback, progress_callback, user_data, cancellable)¶
- Parameters:
stream (
Gio.OutputStream
) – aGio.OutputStream
alsoGio.Seekable
file_callback (
GCab.FileCallback
orNone
) – report current file being savedprogress_callback (
Gio.FileProgressCallback
orNone
) – report saving progresscancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignore
- Raises:
- Returns:
True
on success.- Return type:
Save self to the output stream out. out must be a
Gio.Seekable
.
- write_simple(stream, file_callback, user_data, cancellable)¶
- Parameters:
stream (
Gio.OutputStream
) – aGio.OutputStream
alsoGio.Seekable
file_callback (
GCab.FileCallback
orNone
) – report current file being savedcancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignore
- Raises:
- Returns:
True
on success.- Return type:
Save self to the output stream out. out must be a
Gio.Seekable
.
Property Details¶
- GCab.Cabinet.props.reserved¶
- Name:
reserved
- Type:
- Default Value:
- Flags:
Reserved
- GCab.Cabinet.props.signature¶
- Name:
signature
- Type:
- Default Value:
- Flags:
Signature