GtkSource.File¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r |
|||
r |
|||
r/w/c |
|||
r |
|||
r |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class GtkSource.File(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
On-disk representation of a [class`Buffer`].
A
GtkSourceFileobject is the on-disk representation of a [class`Buffer`]. With aGtkSourceFile, you can create and configure a [class`FileLoader`] and [class`FileSaver`] which take by default the values of theGtkSourceFileproperties (except for the file loader which auto-detect some properties). On a successful load or save operation, theGtkSourceFileproperties are updated. If an operation fails, theGtkSourceFileproperties have still the previous valid values.- classmethod new()¶
- Returns:
a new
GtkSource.Fileobject.- Return type:
- check_file_on_disk()¶
Checks synchronously the file on disk, to know whether the file is externally modified, or has been deleted, and whether the file is read-only.
GtkSource.Filedoesn’t create a [class`Gio`.FileMonitor] to track those properties, so this function needs to be called instead. Creating lots of [class`Gio`.FileMonitor]’s would take lots of resources.Since this function is synchronous, it is advised to call it only on local files. See [method`File`.is_local].
- get_compression_type()¶
- Returns:
the compression type.
- Return type:
- get_encoding()¶
- Returns:
the character encoding.
- Return type:
The encoding is initially
None. After a successful file loading or saving operation, the encoding is non-None.
- get_newline_type()¶
- Returns:
the newline type.
- Return type:
- is_deleted()¶
- Returns:
whether the file has been deleted.
- Return type:
Returns whether the file has been deleted. If the [property`File`:py:data::location<GtkSource.File.props.location>] is
None, returnsFalse.To have an up-to-date value, you must first call [method`File`.check_file_on_disk].
- is_externally_modified()¶
- Returns:
whether the file is externally modified.
- Return type:
Returns whether the file is externally modified. If the [property`File`:py:data::location<GtkSource.File.props.location>] is
None, returnsFalse.To have an up-to-date value, you must first call [method`File`.check_file_on_disk].
- is_local()¶
- Returns:
whether the file is local.
- Return type:
Returns whether the file is local. If the [property`File`:py:data::location<GtkSource.File.props.location>] is
None, returnsFalse.
Property Details¶
- GtkSource.File.props.compression_type¶
- Name:
compression-type- Type:
- Default Value:
- Flags:
The compression type.
- GtkSource.File.props.encoding¶
- Name:
encoding- Type:
- Default Value:
- Flags:
The character encoding, initially
None. After a successful file loading or saving operation, the encoding is non-None.
- GtkSource.File.props.location¶
-
The location.
- GtkSource.File.props.newline_type¶
- Name:
newline-type- Type:
- Default Value:
- Flags:
The line ending type.