GnomeAutoar.Compressor¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
Number of files has been read |
||
r |
Bytes has read from disk |
||
r/w/c |
Whether to create a top level directory |
||
r |
Number of files will be compressed |
||
r/w/c |
Minimal time interval between progress signal |
||
r/w/co |
Output directory ( |
||
r/w/c |
Whether output file is used as destination |
||
r |
Total bytes will be read from disk |
||
r/w/co |
The list of GFiles to be archived |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted after archive creating job is cancelled by the |
|
This signal is emitted after the archive creating job is successfully completed. |
|
This signal is emitted when the location of the new archive is determined. |
|
This signal is emitted when error occurs and all jobs should be terminated. |
|
This signal is used to report progress of creating archives. |
Fields¶
- Inherited:
Class Details¶
- class GnomeAutoar.Compressor(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(source_files, output_file, format, filter, create_top_level_directory)¶
- Parameters:
source_files ([
Gio.File
]) – aGLib.List
of sourceGio.Files
to be archivedoutput_file (
Gio.File
) – output directory of the new archive, or the file name of the new archive if you setGnomeAutoar.Compressor
:output-is-dest
on the returned objectformat (
GnomeAutoar.Format
) – the compression formatfilter (
GnomeAutoar.Filter
) – the compression filtercreate_top_level_directory (
bool
) –
- Returns:
a new
GnomeAutoar.Compressor
object- Return type:
Create a new
GnomeAutoar.Compressor
object.
- classmethod quark()¶
- Returns:
a #GQuark.
- Return type:
Gets the
GnomeAutoar.Compressor
Error Quark.
- get_completed_files()¶
- Returns:
number of files has been read
- Return type:
Gets the number of files has been read
- get_completed_size()¶
- Returns:
file size in bytes has been read
- Return type:
Gets the size in bytes has been read from the source files and directories.
- get_create_top_level_directory()¶
- Returns:
whether a top level directory will be created
- Return type:
Gets whether a top level directory will be created in the new archive.
- get_files()¶
- Returns:
total number of files
- Return type:
Gets the number of files will be read when the operation is completed. This value is currently unset, so calling this function is useless.
- get_filter()¶
- Returns:
the compression filter
- Return type:
Gets the compression filter
- get_format()¶
- Returns:
the compression format
- Return type:
Gets the compression format
- get_notify_interval()¶
- Returns:
the minimal interval in microseconds between the emission of the
GnomeAutoar.Compressor
::progress
signal.- Return type:
- get_output_file()¶
-
If #AutoarCompressor:output_is_dest is
False
, gets the directory which contains the new archive. Otherwise, gets the the new archive. SeeGnomeAutoar.Compressor.set_output_is_dest
().
- get_output_is_dest()¶
- Returns:
True
ifGnomeAutoar.Compressor
:output
is the location of the new archive.- Return type:
- get_size()¶
- Returns:
total file size in bytes
- Return type:
Gets the size in bytes will be read when the operation is completed. This value is currently unset, so calling this function is useless.
- get_source_files()¶
-
Gets the list of source files.
- set_notify_interval(notify_interval)¶
- Parameters:
notify_interval (
int
) – the minimal interval in microseconds
Sets the minimal interval between emission of
GnomeAutoar.Compressor
::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
if the location of the new archive has been already decided
By default
GnomeAutoar.Compressor
:output-is-dest
is set toFalse
, which means the new archive will be created as a regular file underGnomeAutoar.Compressor
:output
directory. The name of the new archive will be automatically generated and you will be notified viaGnomeAutoar.Compressor
::decide-dest
when the name is decided. If you have already decided the location of the new archive, and you do not wantGnomeAutoar.Compressor
to decide it for you, you can setGnomeAutoar.Compressor
:output-is-dest
toTrue
.GnomeAutoar.Compressor
will useGnomeAutoar.Compressor
:output
as the location of the new archive, and it will neither check whether the file exists nor create the necessary directories for you. This function should only be called before callingGnomeAutoar.Compressor.start
() orGnomeAutoar.Compressor.start_async
().
- set_passphrase(passphrase)¶
- Parameters:
passphrase (
str
) – the archive passphrase
Sets the archive passphrase. It works only with %ARCHIVE_FORMAT_ZIP.
- start(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
to ignore
Runs the archive creating 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 creating work. You should connect to
GnomeAutoar.Compressor
::cancelled
,GnomeAutoar.Compressor
::error
, andGnomeAutoar.Compressor
::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.Compressor.signals.cancelled(compressor)¶
- Signal Name:
cancelled
- Flags:
- Parameters:
compressor (
GnomeAutoar.Compressor
) – The object which received the signal
This signal is emitted after archive creating job is cancelled by the
Gio.Cancellable
.
- GnomeAutoar.Compressor.signals.completed(compressor)¶
- Signal Name:
completed
- Flags:
- Parameters:
compressor (
GnomeAutoar.Compressor
) – The object which received the signal
This signal is emitted after the archive creating job is successfully completed.
- GnomeAutoar.Compressor.signals.decide_dest(compressor, destination)¶
- Signal Name:
decide-dest
- Flags:
- Parameters:
compressor (
GnomeAutoar.Compressor
) – The object which received the signaldestination (
Gio.File
) – the location of the new archive
This signal is emitted when the location of the new archive is determined.
- GnomeAutoar.Compressor.signals.error(compressor, error)¶
- Signal Name:
error
- Flags:
- Parameters:
compressor (
GnomeAutoar.Compressor
) – 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_COMPRESSOR_ERROR, %G_IO_ERROR, and %AUTOAR_LIBARCHIVE_ERROR, which represent error occurs in
GnomeAutoar.Compressor
, GIO, and libarchive, respectively. TheGLib.Error
is owned byGnomeAutoar.Compressor
and should not be freed.
- GnomeAutoar.Compressor.signals.progress(compressor, completed_size, completed_files)¶
- Signal Name:
progress
- Flags:
- Parameters:
compressor (
GnomeAutoar.Compressor
) – The object which received the signalcompleted_size (
int
) – bytes has been read from source files and directoriescompleted_files (
int
) – number of files and directories has been read
This signal is used to report progress of creating archives. The value of completed_size and completed_files are the same as the #AutoarCompressor:completed_size and #AutoarCompressor:completed_files properties, respectively.
Property Details¶
- GnomeAutoar.Compressor.props.completed_files¶
-
Number of files has been read
- GnomeAutoar.Compressor.props.completed_size¶
-
Bytes has read from disk
- GnomeAutoar.Compressor.props.create_top_level_directory¶
- Name:
create-top-level-directory
- Type:
- Default Value:
- Flags:
Whether to create a top level directory
- GnomeAutoar.Compressor.props.files¶
-
Number of files will be compressed
- GnomeAutoar.Compressor.props.notify_interval¶
-
Minimal time interval between progress signal
- GnomeAutoar.Compressor.props.output_file¶
- Name:
output-file
- Type:
- Default Value:
- Flags:
Output directory (
Gio.File
) of created archive
- GnomeAutoar.Compressor.props.output_is_dest¶
-
Whether output file is used as destination
- GnomeAutoar.Compressor.props.size¶
-
Total bytes will be read from disk