GnomeAutoar.Extractor¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
Number of files has been written |
||
r |
Bytes written to disk |
||
r/w/c |
Whether the source archive is deleted after a successful extraction |
||
r/w/c |
Minimal time interval between progress signal |
||
r/w/co |
The |
||
r/w/c |
Whether |
||
r/w/co |
The |
||
r |
Number of files in the archive |
||
r |
Total size of the extracted files |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted after archive extracting job is cancelled by the |
|
This signal is emitted after the archive extracting job is successfully completed. |
|
This signal is emitted when error occurs and all jobs should be terminated. |
|
This signal is used to report progress of extraction. |
|
This signal is emitted when the archive extracting job needs a passphrase. |
|
This signal is emitted when |
Fields¶
- Inherited:
Class Details¶
- class GnomeAutoar.Extractor(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(source_file, output_file)¶
- Parameters:
- Returns:
a new
GnomeAutoar.Extractor
object- Return type:
Create a new
GnomeAutoar.Extractor
object.
- classmethod quark()¶
- Returns:
a #GQuark.
- Return type:
Gets the
GnomeAutoar.Extractor
Error Quark.
- get_completed_files()¶
- Returns:
number of files has been written to disk
- Return type:
Gets the number of files has been written to disk.
- get_completed_size()¶
- Returns:
size in bytes has been written
- Return type:
Gets the size in bytes has been written to disk.
- get_delete_after_extraction()¶
-
Whether the source archive will be deleted after a successful extraction.
- get_notify_interval()¶
- Returns:
the minimal interval in microseconds between the emission of the
GnomeAutoar.Extractor
::progress
signal.- Return type:
- get_output_file()¶
-
Gets the
Gio.File
object which represents the output directory of extracted file or directory, or the extracted file or directory itself if you setGnomeAutoar.Extractor
:output-is-dest
on the returned object.
- get_output_is_dest()¶
- Returns:
True
ifGnomeAutoar.Extractor
:output-file
is the destination for extracted files- Return type:
- get_source_file()¶
-
Gets the
Gio.File
object which represents the source archive that will be extracted for this object.
- get_total_files()¶
- Returns:
total number of extracted files
- Return type:
Gets the total number of files will be written when the operation is completed.
- get_total_size()¶
- Returns:
total size of extracted files in bytes
- Return type:
Gets the size in bytes will be written when the operation is completed.
- set_delete_after_extraction(delete_after_extraction)¶
- Parameters:
delete_after_extraction (
bool
) –True
if the source archive should be deleted after a successful extraction
By default
GnomeAutoar.Extractor
:delete-after-extraction
is set toFalse
so the source archive will not be automatically deleted if extraction succeeds.
- set_notify_interval(notify_interval)¶
- Parameters:
notify_interval (
int
) – the minimal interval in microseconds
Sets the minimal interval between emission of
GnomeAutoar.Extractor
::progress
signal. This prevent too frequent signal emission, which may cause performance impact. If you do not want this feature, you can set the interval to 0, so you will receive every progress update.
- set_output_is_dest(output_is_dest)¶
- Parameters:
output_is_dest (
bool
) –True
ifGnomeAutoar.Extractor
:output-file
is the destination for extracted files
By default
GnomeAutoar.Extractor
:output-is-dest
is set toFalse
, which means only one file or directory will be created inGnomeAutoar.Extractor
:output-file
. The destination is internally determined by analyzing the contents of the archive. If this is not wanted,GnomeAutoar.Extractor
:output-is-dest
can be set toTrue
, which will makeGnomeAutoar.Extractor
:output-file
the destination for extracted files. In any case, the destination will be notified viaGnomeAutoar.Extractor
::decide-destination
, when it is possible to set a new destination.GnomeAutoar.Extractor
will attempt to create the destination regardless to whether its path was internally decided or not.This function should only be called before calling
GnomeAutoar.Extractor.start
() orGnomeAutoar.Extractor.start_async
().
- set_passphrase(passphrase)¶
- Parameters:
passphrase (
str
) – a string with the passphrase to use
Sets a passphrase to use if the file to decompress is passphrase-protected.
- start(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
to ignore
Runs the archive extracting work. All callbacks will be called in the same thread as the caller of this functions.
- start_async(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
to ignore
Asynchronously runs the archive extracting work. You should connect to
GnomeAutoar.Extractor
::cancelled
,GnomeAutoar.Extractor
::error
, andGnomeAutoar.Extractor
::completed
signal to get notification when the work is terminated. All callbacks will be called in the main thread, so you can safely manipulate GTK+ widgets in the callbacks.
Signal Details¶
- GnomeAutoar.Extractor.signals.cancelled(extractor)¶
- Signal Name:
cancelled
- Flags:
- Parameters:
extractor (
GnomeAutoar.Extractor
) – The object which received the signal
This signal is emitted after archive extracting job is cancelled by the
Gio.Cancellable
.
- GnomeAutoar.Extractor.signals.completed(extractor)¶
- Signal Name:
completed
- Flags:
- Parameters:
extractor (
GnomeAutoar.Extractor
) – The object which received the signal
This signal is emitted after the archive extracting job is successfully completed.
- GnomeAutoar.Extractor.signals.conflict(extractor, file, new_file)¶
- Signal Name:
conflict
- Flags:
- Parameters:
- Returns:
the
GnomeAutoar.ConflictAction
to be performed byGnomeAutoar.Extractor
This signal is used to report and offer the possibility to solve name conflicts when extracting files. If it is not handled, the file will be skipped.
- Return type:
- GnomeAutoar.Extractor.signals.decide_destination(extractor, destination, files)¶
- Signal Name:
decide-destination
- Flags:
- Parameters:
- Returns:
Gio.File
for location that will overwrite destination, orNone
if this is not wantedThis signal is emitted when the path of the destination is determined. It is useful for solving name conflicts or for setting a new destination, based on the contents of the archive.
- Return type:
- GnomeAutoar.Extractor.signals.error(extractor, error)¶
- Signal Name:
error
- Flags:
- Parameters:
extractor (
GnomeAutoar.Extractor
) – The object which received the signalerror (
GLib.Error
) – theGLib.Error
This signal is emitted when error occurs and all jobs should be terminated. Possible error domains are %AUTOAR_EXTRACTOR_ERROR, %G_IO_ERROR, and %AUTOAR_LIBARCHIVE_ERROR, which represent error occurs in
GnomeAutoar.Extractor
, GIO, and libarchive, respectively. TheGLib.Error
is owned byGnomeAutoar.Extractor
and should not be freed.
- GnomeAutoar.Extractor.signals.progress(extractor, completed_size, completed_files)¶
- Signal Name:
progress
- Flags:
- Parameters:
extractor (
GnomeAutoar.Extractor
) – The object which received the signalcompleted_size (
int
) – bytes has been written to diskcompleted_files (
int
) – number of files have been written to disk
This signal is used to report progress of extraction.
- GnomeAutoar.Extractor.signals.request_passphrase(extractor)¶
- Signal Name:
request-passphrase
- Flags:
- Parameters:
extractor (
GnomeAutoar.Extractor
) – The object which received the signal- Return type:
This signal is emitted when the archive extracting job needs a passphrase.
- GnomeAutoar.Extractor.signals.scanned(extractor, files)¶
- Signal Name:
scanned
- Flags:
- Parameters:
extractor (
GnomeAutoar.Extractor
) – The object which received the signalfiles (
int
) – the number of files will be extracted from the source archive
This signal is emitted when
GnomeAutoar.Extractor
finish scanning filename entries in the source archive.
Property Details¶
- GnomeAutoar.Extractor.props.completed_files¶
-
Number of files has been written
- GnomeAutoar.Extractor.props.completed_size¶
-
Bytes written to disk
- GnomeAutoar.Extractor.props.delete_after_extraction¶
-
Whether the source archive is deleted after a successful extraction
- GnomeAutoar.Extractor.props.notify_interval¶
-
Minimal time interval between progress signal
- GnomeAutoar.Extractor.props.output_file¶
- Name:
output-file
- Type:
- Default Value:
- Flags:
The
Gio.File
of the directory where the files will be extracted
- GnomeAutoar.Extractor.props.output_is_dest¶
-
Whether
GnomeAutoar.Extractor
:output-file
is used as destination
- GnomeAutoar.Extractor.props.source_file¶
- Name:
source-file
- Type:
- Default Value:
- Flags:
The
Gio.File
of the source archive that will be extracted
- GnomeAutoar.Extractor.props.total_files¶
-
Number of files in the archive