GOffice.FileOpener¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
The description of the opener |
||
r |
The identifier of the opener |
||
r/w |
|
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class GOffice.FileOpener(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod for_id(id)¶
- Parameters:
id (
str) – File opener’s ID- Returns:
GOffice.FileOpenerwith given id.- Return type:
Searches for file opener with given id, registered using
GOffice.FileOpener.register
- classmethod new(id, description, suffixes, mimes, probe_func, open_func)¶
- Parameters:
description (
str) – Description of supported file formatsuffixes ([
str]) – List of suffixes to associate with the openermimes ([
str]) – List of mime types to associate with the openerprobe_func (
GOffice.FileOpenerProbeFuncorNone) – “probe” functionopen_func (
GOffice.FileOpenerOpenFunc) – “open” function
- Returns:
newly created
GOffice.FileOpenerobject.- Return type:
Creates new
GOffice.FileOpenerobject. Optional id will be used after registering it withGOffice.FileOpener.registerfunction.
- classmethod new_with_enc(id, description, suffixes, mimes, probe_func, open_func)¶
- Parameters:
description (
str) – Description of supported file formatsuffixes ([
str]) – List of suffixes to associate with the openermimes ([
str]) – List of mime types to associate with the openerprobe_func (
GOffice.FileOpenerProbeFuncorNone) – “probe” functionopen_func (
GOffice.FileOpenerOpenFuncWithEnc) – “open” function
- Returns:
newly created
GOffice.FileOpenerobject.- Return type:
Creates new
GOffice.FileOpenerobject. Optional id will be used after registering it withGOffice.FileOpener.registerfunction.
- can_probe(pl)¶
- Parameters:
pl (
GOffice.FileProbeLevel) – probe level- Returns:
Trueif self has a probe function- Return type:
- open(opt_enc, io_context, view, input)¶
- Parameters:
io_context (
GOffice.IOContext) – Context for i/o operationview (
GOffice.View) –GOffice.Viewinput (
Gsf.Input) – Gsf input stream
Reads content of file_name file into
GOffice.workbookwbv is attached to. Results are reported using io_context object, useGOffice.io_error_occurredto find out if operation was successful. The state of wbv and itsGOffice.workbookis undefined if operation fails, you should destroy them in that case.
- probe(input, pl)¶
-
Checks if a given file is supported by the opener.
- register(priority)¶
- Parameters:
priority (
int) – Opener’s priority
Adds self opener to the list of available file openers, making it available for Gnumeric i/o routines. The opener is registered with given priority. The priority is used to determine the order in which openers will be tried when reading a file. The higher the priority, the sooner it will be tried. Default XML-based Gnumeric file opener is registered at priority 50. Recommended range for priority is [0, 100]. Reference
GOffice.countfor the opener is incremented inside the function, but you don’t have to (and shouldn’t) callGObject.Object.unrefon it if it’s floating object (for example, when you pass object newly created withGOffice.FileOpener.newand not referenced anywhere).
- unregister()¶
Removes self opener from list of available file openers. Reference
GOffice.countfor the opener is decremented inside the function.
Property Details¶
- GOffice.FileOpener.props.description¶
-
The description of the opener
- GOffice.FileOpener.props.id¶
-
The identifier of the opener