Libxfce4util.Rc¶
Fields¶
None
Methods¶
| class | config_open(type, resource, readonly) | 
| class | simple_open(filename, readonly) | 
| close() | |
| delete_entry(key, global_) | |
| delete_group(group, global_) | |
| flush() | |
| get_entries(group) | |
| get_group() | |
| get_groups() | |
| get_locale() | |
| has_entry(key) | |
| has_group(group) | |
| is_dirty() | |
| is_readonly() | |
| read_bool_entry(key, fallback) | |
| read_entry(key, fallback) | |
| read_entry_untranslated(key, fallback) | |
| read_int_entry(key, fallback) | |
| read_list_entry(key, delimiter) | |
| rollback() | |
| set_group(group) | |
| write_bool_entry(key, value) | |
| write_entry(key, value) | |
| write_int_entry(key, value) | |
| write_list_entry(key, value, separator) | 
Details¶
- 
class Libxfce4util.Rc¶
- 
classmethod config_open(type, resource, readonly)¶
- Parameters: - type (Libxfce4util.ResourceType) – The resource type being opened
- resource (str) – The resource name to open
- readonly (bool) – whether to open resource readonly.
 - Returns: - the newly created - Libxfce4util.Rcobject, or- Noneon error.- Return type: - If readonly is - Trueparsing is generally faster, because only untranslated entries and entries that match the current locale will be loaded. Also if you pass- Truefor readonly, #xfce_rc_config will fail if resource does not reference a regular file.- It is no error if readonly is - Falseand the file referenced by resource does not exists. In this case you’ll start with a fresh config, which contains only the default group and no entries.- New in version 4.2. 
- type (
 - 
classmethod simple_open(filename, readonly)¶
- Parameters: - Returns: - the newly created - Libxfce4util.Rcobject, or- Noneon error.- Return type: - Parses the resource config file specified by filename. - If readonly is - Trueparsing is generally faster, because only untranslated entries and entries that match the current locale will be loaded. Also if you pass- Truefor readonly,- Libxfce4util.Rc.simple_openwill fail if filename does not reference a regular file.- It is no error if readonly is - Falseand the file referenced by filename does not exists. In this case you’ll start with a fresh config, which contains only the default group and no entries.- New in version 4.2. 
 - 
close()¶
- Destructs self. - If self was opened read-write and contains dirty (modified) entries, these will be flushed to permanent storage first. - New in version 4.2. 
 - 
delete_entry(key, global_)¶
- Parameters: - Similar to - Libxfce4util.Rc.delete_group, but works on an entry in the current group.- New in version 4.2. 
 - 
delete_group(group, global_)¶
- Parameters: - If self is a simple config object and group exists, it is deleted. All entries within group will be deleted. For simple config objects, global is ignored. - If self is a complex config object and group exists, it will be deleted will all entries. If global is - True, the entry will be marked as deleted globally, therefore all calls to- Libxfce4util.Rc.read_entryand related functions will return the fallback values. If global is- False, the group will be deleted in the per-user config file, and further calls to- Libxfce4util.Rc.read_entrywill most probably return the system-wide config entries.- New in version 4.2. 
 - 
flush()¶
- Flushes all changes that currently reside only in memory back to permanent storage. Dirty configuration entries are written in the most specific file available. - New in version 4.2. 
 - 
get_entries(group)¶
- Parameters: - group ( - str) – the name of the group to get entries from.- Returns: - a - None-terminated string array with all entries in group. Has to be freed using- GLib.strfreev() if no longer needed. If the specified group does not exists,- Noneis returned. If the group has no entries, an empty string array is returned.- Return type: - [ - str]- Returns the names of all entries in group if any. - Noneis a valid input value for group.- Libxfce4util.Rc.get_entrieswill then return all entries in the so called “- Nonegroup”. Though this “- Nonegroup” should only be used for backward compatibility with old applications. You should not use it in newly written code.- New in version 4.2. 
 - 
get_group()¶
- Returns: - the name of the current group. - Return type: - str- Returns the name of the group in which we are searching for keys and from which we are retrieving entries. If the currently active group is the default group (the so called “ - Nonegroup”),- Nonewill be returned.- New in version 4.2. 
 - 
get_groups()¶
- Returns: - a - None-terminated string array will the names of all groups in self. Should be freed using- GLib.strfreev() when no longer needed.- Return type: - [ - str]- Returns the names of all known groups in self. - Since the default groups (the “ - Nonegroup”) name is- None, it will not be returned with this functions. But it does not matter at all, since the default group is known to always exist.- New in version 4.2. 
 - 
get_locale()¶
- Returns: - a string representing the current locale. - Return type: - str- Returns current locale used by self to lookup translated entries. - New in version 4.2. 
 - 
has_entry(key)¶
- Parameters: - key ( - str) – the key to search for.- Returns: - Trueif the key is available, else- False.- Return type: - bool- Checks whether the key has an entry in the current group. - New in version 4.2. 
 - 
has_group(group)¶
- Parameters: - group ( - str) – the group to search for.- Returns: - Trueif the group exists.- Return type: - bool- Returns - Trueif the specified group is known about.- New in version 4.2. 
 - 
is_dirty()¶
- Returns: - Trueif self has any dirty (modified) entries.- Return type: - bool- Checks whether self has any dirty (modified) entries. - New in version 4.2. 
 - 
is_readonly()¶
- Returns: - the read-only status. - Return type: - bool- Returns the read-only status of self. - New in version 4.2. 
 - 
read_bool_entry(key, fallback)¶
- Parameters: - Returns: - the value for this key. - Return type: - Reads the value of an entry specified by key in the current group and interpret it as a boolean value. Currently “on”, “true” and “yes” are accepted as true, everything else is false. - New in version 4.2. 
 - 
read_entry(key, fallback)¶
- Parameters: - Returns: - the value for this key, or fallback if key was not found. - Return type: - Reads the value of an entry specified by key in the current group. - New in version 4.2. 
 - 
read_entry_untranslated(key, fallback)¶
- Parameters: - Returns: - the untranslated value for this key, or fallback if key was not found. - Return type: - Reads the value of an entry specified by key in the current group. The untranslated entry is returned. You normally do not need this. - New in version 4.2. 
 - 
read_int_entry(key, fallback)¶
- Parameters: - Returns: - the value for this key. - Return type: - Reads the value of an entry specified by key in the current group and interprets it as an integer value. - New in version 4.2. 
 - 
read_list_entry(key, delimiter)¶
- Parameters: - Returns: - the list or - Noneif the entry does not exist.- Return type: - [ - str]- Reads a list of strings in the entry specified by key in the current group. The returned list has to be freed using - GLib.strfreev() when no longer needed.- New in version 4.2. 
 - 
rollback()¶
- Mark self as “clean”, i.e. don’t write dirty entries at destruction time. If you then call - Libxfce4util.Rc.write_entryagain, the dirty flag is set again and dirty entries will be written at a subsequent- Libxfce4util.Rc.flushcall.- New in version 4.2. 
 - 
set_group(group)¶
- Parameters: - group ( - str) – the name of the new group or- Noneto to switch back to the default group.- Specifies the group in which keys will be read and written. Subsequent calls to - Libxfce4util.Rc.read_entryand- Libxfce4util.Rc.write_entrywill be applied only in the active group.- If group references a group that does not exists, it will be created for you. But note, that empty groups will not be synced to permanent storage. - New in version 4.2. 
 - 
write_bool_entry(key, value)¶
- Parameters: - Wrapper for - Libxfce4util.Rc.write_entry, that stores a boolean value.- New in version 4.2. 
 - 
write_entry(key, value)¶
- Parameters: - Writes a key/value pair. This has no effect if the resource config was opened readonly, else the value will be written to permanent storage on the next call to - Libxfce4util.Rc.flushor when self is destroyed using- Libxfce4util.Rc.close.- If self was opened using - Libxfce4util.Rc.config_open, the value will be written to the most specific config file.- New in version 4.2. 
 - 
write_int_entry(key, value)¶
- Parameters: - Wrapper for - Libxfce4util.Rc.write_entry, that stores an integer value.- New in version 4.2. 
 - 
write_list_entry(key, value, separator)¶
- Parameters: - Wrapper for - Libxfce4util.Rc.write_entry, that stores a string list value.- New in version 4.2. 
 
- 
classmethod