v_sim.FileFormat¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
Don’t restrict file matching to the given patterns. |
||
r |
Label used to show the file pattern. |
||
r/w/co |
File format description. |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
||
priv |
r |
Class Details¶
- class v_sim.FileFormat(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
An opaque structure.
- classmethod new(descr, patterns)¶
- Parameters:
- Returns:
a newly allocated
v_sim.FileFormat, orNoneif something goes wrong.- Return type:
Allocate a new
v_sim.FileFormat. The patterns argument is copied in thev_sim.FileFormatobject and can be freed safely after the call to this method.
- classmethod newRestricted(descr, patterns)¶
- Parameters:
- Returns:
a newly allocated
v_sim.FileFormat, orNoneif something goes wrong.- Return type:
Allocate a new
v_sim.FileFormat. The patterns argument is copied in thev_sim.FileFormatobject and can be freed safely after the call to this method. The patterns list is not all the patterns supported by the format.
- addOption(opt)¶
- Parameters:
opt (
v_sim.Option) – av_sim.Optionobject.
File format may have options, like pseudo-potential pparameters in case of BigDFT calculations.
New in version 3.7.
- addPatterns(patterns)¶
- Parameters:
patterns ([
str]) – a list of matching patterns.
A file format may have pattern for the naming scheme of files, like “*.jpg” and “*.jpeg” for JPEG files. It’s not mandatory for a file format to match its own pattern anyway.
New in version 3.7.
- addPropertyBoolean(name, label, defaultVal)¶
- Parameters:
- Returns:
a newly created
v_sim.Option, free withv_sim.Option.free().- Return type:
Add a new boolean property to the file format self.
- addPropertyDouble(name, label, defaultVal)¶
- Parameters:
- Returns:
a newly created
v_sim.Option, free withv_sim.Option.free().- Return type:
Add a new integer property to the file format self.
New in version 3.7.
- addPropertyInt(name, label, defaultVal)¶
- Parameters:
- Returns:
a newly created
v_sim.Option, free withv_sim.Option.free().- Return type:
Add a new integer property to the file format self.
- canMatch()¶
- Returns:
Trueif a call tov_sim.FileFormat.match() is safe.- Return type:
This method is used to know if the file pattern list can be used to match a given filename with
v_sim.FileFormat.match().New in version 3.6.
- copy()¶
- Returns:
a newly created
v_sim.FileFormat. Should be freed withGObject.Object.unref().- Return type:
Copy the given file format self a create a new one.
New in version 3.6.
- getFilePatterns()¶
- Returns:
a list with the file patterns. This list should not be freed.
- Return type:
[
str]
This method gives a list with the file patterns.
New in version 3.6.
- getLabel()¶
- Returns:
a string made by the name and all the paterns of the given format, given in parentethis. This string should not be freed.
- Return type:
This method gives a label describing the file format.
- getName()¶
- Returns:
a string with the name. This string should not be freed.
- Return type:
This method gives the name describing the file format.
- getPropertyBoolean(name)¶
- Parameters:
name (
str) – a property name.- Returns:
the property value if exists,
Falseotherwise.- Return type:
Retrieves the value of property prop.
New in version 3.8.
- getPropertyInt(name)¶
- Parameters:
name (
str) – a property name.- Returns:
the property value if exists, -1 otherwise.
- Return type:
Retrieves the value of property prop.
New in version 3.8.
- iterNextProperty(iter)¶
- Parameters:
iter (
v_sim.FileFormatIter) – an iterator.- Returns:
Trueif any.- Return type:
Run to the next property of the file format self. The iterator attributes are updated so it’s convenient to access the property values and details, see
v_sim.FileFormatIter.New in version 3.6.
- match(filename)¶
- Parameters:
filename (
str) – a string to match.- Returns:
the matching pattern, if any.
- Return type:
This method try to match the given string to one of the patterns of the
v_sim.FileFormatself.
- setPropertiesFromCLI()¶
Scan all options from command line and affects values.
New in version 3.8.
- setValidator(validate)¶
- Parameters:
validate (
v_sim.FileFormatValidateorNone) – a pointer to a validator routine.
Set up a validating routine that do a minimal parsing to check that a provided file corresponds to this file format.
New in version 3.7.
- validate(filename)¶
- Parameters:
filename (
str) – a string to match.- Returns:
True, if the file (after minimal parsing) is of this file format. If there is no validator routine, it is using a built-in one, based on pattern matching with file types, seev_sim.FileFormat.addPatterns().- Return type:
This method runs a minimal parsing routine set with
v_sim.FileFormat.setValidator() to check if the provided filename correspond to this file format.New in version 3.7.
Property Details¶
- v_sim.FileFormat.props.ignore_type¶
-
Don’t restrict file matching to the given patterns.
- v_sim.FileFormat.props.label¶
-
Label used to show the file pattern.
- v_sim.FileFormat.props.name¶
- Name:
name- Type:
- Default Value:
''- Flags:
File format description.