Gimp.ConfigPath¶
- Subclasses:
None
Methods¶
class |
|
class |
|
class |
|
Virtual Methods¶
None
Fields¶
None
Class Details¶
- class Gimp.ConfigPath¶
- Abstract:
No
- classmethod expand(path, recode)¶
- Parameters:
- Raises:
- Returns:
a newly allocated NUL-terminated string
- Return type:
Paths as stored in gimprc and other config files have to be treated special. The string may contain special identifiers such as for example ${gimp_dir} that have to be substituted before use. Also the user’s filesystem may be in a different encoding than UTF-8 (which is what is used for the gimprc). This function does the variable substitution for you and can also attempt to convert to the filesystem encoding.
To reverse the expansion, use
Gimp.ConfigPath.unexpand
().New in version 2.4.
- classmethod expand_to_files(path)¶
- Parameters:
path (
str
) – a NUL-terminated string in UTF-8 encoding- Raises:
- Returns:
- Return type:
[
Gio.File
]
Paths as stored in the gimprc have to be treated special. The string may contain special identifiers such as for example ${gimp_dir} that have to be substituted before use. Also the user’s filesystem may be in a different encoding than UTF-8 (which is what is used for the gimprc).
This function runs path through
Gimp.ConfigPath.expand
() andGimp.Path.parse
(), then turns the filenames returned byGimp.Path.parse
() intoGio.File
usingGio.File.new_for_path
().New in version 2.10.
- classmethod unexpand(path, recode)¶
- Parameters:
- Raises:
- Returns:
a newly allocated NUL-terminated UTF-8 string
- Return type:
The inverse operation of
Gimp.ConfigPath.expand
()This function takes a path and tries to substitute the first elements by well-known special identifiers such as for example ${gimp_dir}. The unexpanded path can then be stored in gimprc and other config files.
If recode is
True
then path is in local filesystem encoding, if recode isFalse
then path is assumed to be UTF-8.New in version 2.10.