Tepl.FileSaver¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/co |
|||
r/w/co |
|||
r/w/c |
|||
r/w/co |
|||
r/w/c |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
object |
r |
Class Details¶
- class Tepl.FileSaver(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(buffer, file)¶
- Parameters:
buffer (
Tepl.Buffer) – theTepl.Bufferto save.
- Returns:
a new
Tepl.FileSaverobject.- Return type:
Creates a new
Tepl.FileSaverobject. The buffer will be saved to theTepl.File's location.This constructor is suitable for a simple “save” operation, when the file already contains a non-
NoneTepl.File:location.New in version 1.0.
- classmethod new_with_target(buffer, file, target_location)¶
- Parameters:
buffer (
Tepl.Buffer) – theTepl.Bufferto save.target_location (
Gio.File) – theGio.Filewhere to save the buffer to.
- Returns:
a new
Tepl.FileSaverobject.- Return type:
Creates a new
Tepl.FileSaverobject with a target location. When the file saving is finished successfully, target_location is set to the file'sTepl.File:locationproperty. If an error occurs, the previous valid location is still available inTepl.File.This constructor is suitable for a “save as” operation, or for saving a new buffer for the first time.
New in version 1.0.
- get_buffer()¶
- Returns:
the
Tepl.Bufferto save.- Return type:
New in version 1.0.
- get_flags()¶
- Returns:
the flags.
- Return type:
New in version 1.0.
- get_location()¶
-
New in version 1.0.
- get_newline_type()¶
- Returns:
the newline type.
- Return type:
New in version 1.0.
- save_async(io_priority, cancellable, callback, *user_data)¶
- Parameters:
io_priority (
int) – the I/O priority of the request. E.g.GLib.PRIORITY_LOW,GLib.PRIORITY_DEFAULTorGLib.PRIORITY_HIGH.cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignore.callback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied.
Saves asynchronously the buffer into the file. See the
Gio.AsyncResultdocumentation to know how to use this function.New in version 5.0.
- save_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – aGio.AsyncResult.- Raises:
- Returns:
whether the file was saved successfully.
- Return type:
Finishes a file saving started with
Tepl.FileSaver.save_async().If the file has been saved successfully, the following
Tepl.Fileproperties will be updated: the location and the newline type.Gtk.TextBuffer.set_modified() is called withFalseif the file has been saved successfully.New in version 1.0.
- set_flags(flags)¶
- Parameters:
flags (
Tepl.FileSaverFlags) – the new flags.
New in version 1.0.
- set_newline_type(newline_type)¶
- Parameters:
newline_type (
Tepl.NewlineType) – the new newline type.
Sets the newline type. By default the newline type is taken from the
Tepl.File.New in version 1.0.
Property Details¶
- Tepl.FileSaver.props.buffer¶
- Name:
buffer- Type:
- Default Value:
- Flags:
The
Tepl.Bufferto save. TheTepl.FileSaverobject has a weak reference to the buffer.New in version 1.0.
- Tepl.FileSaver.props.file¶
- Name:
file- Type:
- Default Value:
- Flags:
The
Tepl.File. TheTepl.FileSaverobject has a weak reference to the file.New in version 1.0.
- Tepl.FileSaver.props.flags¶
- Name:
flags- Type:
- Default Value:
- Flags:
File saving flags.
New in version 1.0.
- Tepl.FileSaver.props.location¶
- Name:
location- Type:
- Default Value:
- Flags:
The
Gio.Filewhere to save the buffer. By default the location is taken from theTepl.Fileat construction time.New in version 1.0.
- Tepl.FileSaver.props.newline_type¶
- Name:
newline-type- Type:
- Default Value:
- Flags:
The newline type.
New in version 1.0.