GOffice.FileSaver¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
The description of the saver. |
||
r/w |
The standard file name extension of the saver. |
||
r/w |
? |
||
r/w/co |
The identifier of the saver. |
||
r/w |
|
||
r/w |
The MIME type of the saver. |
||
r/w |
Whether the saver will overwrite files. |
||
r/w |
How much of a document is saved |
||
r/w |
|
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Fields¶
- Inherited:
Class Details¶
- class GOffice.FileSaver(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod for_file_name(file_name)¶
- Parameters:
file_name (
str) – name- Returns:
GOffice.FileSaverfor file_name- Return type:
Searches for file saver matching the given file_name, registered using
GOffice.FileSaver.register.
- classmethod for_id(id)¶
- Parameters:
id (
str) – File saver’s ID- Returns:
GOffice.FileSaverwith given id.- Return type:
Searches for file saver with given id, registered using
GOffice.FileSaver.registeror register_file_opener_as_default.
- classmethod for_mime_type(mime_type)¶
- Parameters:
mime_type (
str) – A mime type- Returns:
A
GOffice.FileSaverobject associated with mime_type.- Return type:
- classmethod get_default()¶
- Returns:
GOffice.FileSaverfor the highest priority default saver.- Return type:
Finds file saver registered as default saver with the highest priority. Reference
GOffice.countfor the saver is NOT incremented.
- classmethod new(id, extension, description, level, save_func)¶
- Parameters:
description (
str) – Description of supported file formatlevel (
GOffice.FileFormatLevel) – File format levelsave_func (
GOffice.FileSaverSaveFunc) – Pointer to “save” function
- Returns:
newly created
GOffice.FileSaverobject.- Return type:
Creates new
GOffice.FileSaverobject. Optional id will be used after registering it withGOffice.FileSaver.registerorGOffice.FileSaver.register_as_defaultfunction.
- get_format_level()¶
- Returns:
The format level of self.
- Return type:
- get_save_scope()¶
- Returns:
The save scope of self.
- Return type:
- register()¶
Adds self saver to the list of available file savers, making it available for the user when selecting file format for save.
- register_as_default(priority)¶
- Parameters:
priority (
int) – Saver’s priority
Adds self saver to the list of available file savers, making it available for the user when selecting file format for save. The saver is also marked as default saver with given priority. When Gnumeric needs default file saver, it chooses the one with the highest priority. Recommended range for priority is [0, 100].
- save(io_context, view, output)¶
- Parameters:
io_context (
GOffice.IOContext) – Context for i/o operationview (
GOffice.View) –GOffice.Viewoutput (
Gsf.Output) – Output stream
Saves wbv and the
GOffice.workbookit is attached to into output stream. Results are reported using io_context object, useGOffice.io_error_occurredto find out if operation was successful. It’s possible that file_name is created and contain some data if operation fails, you should remove the file in that case.
- set_export_options(doc, options)¶
- Parameters:
doc (
GOffice.Doc) –options (
str) –
- Raises:
- Return type:
- set_overwrite_files(overwrite)¶
- Parameters:
overwrite (
bool) – A booleanGOffice.valuesaying whether the saver should overwrite existing files.
Changes behaviour of the saver when saving a file. If overwrite is set to
True, existing file will be overwritten. Otherwise, the saver will report an error without saving anything.
- set_save_scope(scope)¶
- Parameters:
scope (
GOffice.FileSaveScope) –
- unregister()¶
Removes self saver from list of available file savers. Reference
GOffice.countfor the saver is decremented inside the function.
Signal Details¶
- GOffice.FileSaver.signals.set_export_options(file_saver, object, p0, p1)¶
- Signal Name:
set-export-options- Flags:
- Parameters:
file_saver (
GOffice.FileSaver) – The object which received the signalobject (
GOffice.Doc) –p0 (
str) –
- Return type:
Property Details¶
- GOffice.FileSaver.props.description¶
-
The description of the saver.
- GOffice.FileSaver.props.extension¶
-
The standard file name extension of the saver.
- GOffice.FileSaver.props.format_level¶
- Name:
format-level- Type:
- Default Value:
- Flags:
?
- GOffice.FileSaver.props.id¶
- Name:
id- Type:
- Default Value:
- Flags:
The identifier of the saver.
- GOffice.FileSaver.props.mime_type¶
-
The MIME type of the saver.
- GOffice.FileSaver.props.overwrite¶
-
Whether the saver will overwrite files.
- GOffice.FileSaver.props.scope¶
- Name:
scope- Type:
- Default Value:
- Flags:
How much of a document is saved