GtkSource.File¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | new() | 
| check_file_on_disk() | |
| get_compression_type() | |
| get_encoding() | |
| get_location() | |
| get_newline_type() | |
| is_deleted() | |
| is_externally_modified() | |
| is_local() | |
| is_readonly() | |
| set_location(location) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| compression-type | GtkSource.CompressionType | r | |
| encoding | GtkSource.Encoding | r | |
| location | Gio.File | r/w/c | |
| newline-type | GtkSource.NewlineType | r | |
| read-only | bool | r | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class GtkSource.File(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - Structure: - GtkSource.FileClass- 
classmethod new()¶
- Returns: - a new - GtkSource.Fileobject.- Return type: - GtkSource.File- New in version 3.14. 
 - 
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- Gio.FileMonitorto track those properties, so this function needs to be called instead. Creating lots of- Gio.FileMonitor’s would take lots of resources.- Since this function is synchronous, it is advised to call it only on local files. See - GtkSource.File.is_local().- New in version 3.18. 
 - 
get_compression_type()¶
- Returns: - the compression type. - Return type: - GtkSource.CompressionType- New in version 3.14. 
 - 
get_encoding()¶
- Returns: - the character encoding. - Return type: - GtkSource.Encoding- The encoding is initially - None. After a successful file loading or saving operation, the encoding is non-- None.- New in version 3.14. 
 - 
get_newline_type()¶
- Returns: - the newline type. - Return type: - GtkSource.NewlineType- New in version 3.14. 
 - 
is_deleted()¶
- Returns: - whether the file has been deleted. - Return type: - bool- Returns whether the file has been deleted. If the - GtkSource.File- :locationis- None, returns- False.- To have an up-to-date value, you must first call - GtkSource.File.check_file_on_disk().- New in version 3.18. 
 - 
is_externally_modified()¶
- Returns: - whether the file is externally modified. - Return type: - bool- Returns whether the file is externally modified. If the - GtkSource.File- :locationis- None, returns- False.- To have an up-to-date value, you must first call - GtkSource.File.check_file_on_disk().- New in version 3.18. 
 - 
is_local()¶
- Returns: - whether the file is local. - Return type: - bool- Returns whether the file is local. If the - GtkSource.File- :locationis- None, returns- False.- New in version 3.18. 
 - 
is_readonly()¶
- Returns: - whether the file is read-only. - Return type: - bool- Returns whether the file is read-only. If the - GtkSource.File- :locationis- None, returns- False.- To have an up-to-date value, you must first call - GtkSource.File.check_file_on_disk().- New in version 3.18. 
 
- 
classmethod 
Property Details¶
- 
GtkSource.File.props.compression_type¶
- Name: - compression-type- Type: - GtkSource.CompressionType- Default Value: - GtkSource.CompressionType.NONE- Flags: - READABLE- The compression type. - New in version 3.14. 
- 
GtkSource.File.props.encoding¶
- Name: - encoding- Type: - GtkSource.Encoding- Default Value: - None- Flags: - READABLE- The character encoding, initially - None. After a successful file loading or saving operation, the encoding is non-- None.- New in version 3.14. 
- 
GtkSource.File.props.location¶
- Name: - location- Type: - Gio.File- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT- The location. - New in version 3.14. 
- 
GtkSource.File.props.newline_type¶
- Name: - newline-type- Type: - GtkSource.NewlineType- Default Value: - GtkSource.NewlineType.LF- Flags: - READABLE- The line ending type. - New in version 3.14.