Jcat.File¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Jcat.File(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
-
Creates a new file.
New in version 0.1.0.
- add_item(item)¶
-
Adds an item to a file.
New in version 0.1.0.
- export_file(gfile, flags, cancellable)¶
- Parameters:
gfile (
Gio.File
) – #gfileflags (
Jcat.ExportFlags
) – aJcat.ExportFlags
, typicallyJcat.ExportFlags.NONE
cancellable (
Gio.Cancellable
orNone
) –Gio.Cancellable
, orNone
- Raises:
- Returns:
True
for success- Return type:
Exports a Jcat file to a compressed file.
New in version 0.1.0.
- export_json(flags)¶
- Parameters:
flags (
Jcat.ExportFlags
) – aJcat.ExportFlags
, typicallyJcat.ExportFlags.NONE
- Raises:
- Returns:
JSON output, or
None
for error- Return type:
Exports a Jcat file to raw JSON.
New in version 0.1.0.
- export_stream(ostream, flags, cancellable)¶
- Parameters:
ostream (
Gio.OutputStream
) –Gio.OutputStream
flags (
Jcat.ExportFlags
) – aJcat.ExportFlags
, typicallyJcat.ExportFlags.NONE
cancellable (
Gio.Cancellable
orNone
) –Gio.Cancellable
, orNone
- Raises:
- Returns:
True
for success- Return type:
Exports a Jcat file to a compressed stream.
New in version 0.1.0.
- get_item_by_id(id)¶
- Parameters:
id (
str
) – An ID, typically a filename basename- Raises:
- Returns:
- Return type:
Finds the item with the specified ID, falling back to the ID alias if set.
New in version 0.1.0.
- get_item_default()¶
- Raises:
- Returns:
- Return type:
Finds the default item. If more than one
Jcat.Item
exists this function will return with an error.New in version 0.1.0.
- get_items()¶
- Returns:
all the items in the file
- Return type:
Returns all the items in the file.
New in version 0.1.0.
- get_version_major()¶
- Returns:
integer
- Return type:
Returns the major version number of the Jcat specification
New in version 0.1.0.
- get_version_minor()¶
- Returns:
integer
- Return type:
Returns the minor version number of the Jcat specification
New in version 0.1.0.
- import_file(gfile, flags, cancellable)¶
- Parameters:
gfile (
Gio.File
) – #gfileflags (
Jcat.ImportFlags
) –Jcat.ImportFlags
, typicallyJcat.ImportFlags.NONE
cancellable (
Gio.Cancellable
orNone
) –Gio.Cancellable
, orNone
- Raises:
- Returns:
True
for success- Return type:
Imports a compressed Jcat file from an input stream.
New in version 0.1.0.
- import_json(json, flags)¶
- Parameters:
json (
str
) – JSON dataflags (
Jcat.ImportFlags
) –Jcat.ImportFlags
, typicallyJcat.ImportFlags.NONE
- Raises:
- Returns:
True
for success- Return type:
Imports a Jcat file from raw JSON.
New in version 0.1.0.
- import_stream(istream, flags, cancellable)¶
- Parameters:
istream (
Gio.InputStream
) –Gio.InputStream
flags (
Jcat.ImportFlags
) –Jcat.ImportFlags
, typicallyJcat.ImportFlags.NONE
cancellable (
Gio.Cancellable
orNone
) –Gio.Cancellable
, orNone
- Raises:
- Returns:
True
for success- Return type:
Imports a compressed Jcat file from a file.
New in version 0.1.0.