EBackend.FileCache¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | new(filename) | 
| add_object(key, value) | |
| clean() | |
| freeze_changes() | |
| get_filename() | |
| get_keys() | |
| get_object(key) | |
| get_objects() | |
| remove() | |
| remove_object(key) | |
| replace_object(key, new_value) | |
| thaw_changes() | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class EBackend.FileCache(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - Structure: - EBackend.FileCacheClass- Contains only private data that should be read and manipulated using the functions below. - 
classmethod new(filename)¶
- Parameters: - filename ( - str) – filename where the cache is kept- Returns: - a new - EBackend.FileCache- Return type: - EBackend.FileCache- Creates a new - EBackend.FileCacheobject, which implements a cache of objects. Useful for remote backends.
 - 
add_object(key, value)¶
- Parameters: - Returns: - Return type: - Adds a new key / value entry to self. If an object corresponding to key already exists in self, the function returns - False.
 - 
freeze_changes()¶
- Disables temporarily all writes to disk for self. 
 - 
get_filename()¶
- Returns: - The name of the cache. - Return type: - str- Gets the name of the file where the cache is being stored. 
 - 
get_keys()¶
- Returns: - a list of keys - Return type: - [ - str]- Returns a list of keys in self. The keys are owned by self and must not be modified or freed. Free the returned list with g_slist_free(). 
 - 
get_object(key)¶
- Parameters: - key ( - str) – the hash key of the object to find- Returns: - the object corresponding to key - Return type: - str- Returns the object corresponding to key. If no such object exists in self, the function returns - None.
 - 
get_objects()¶
- Returns: - a list of objects - Return type: - [ - str]- Returns a list of objects in self. The objects are owned by self and must not be modified or freed. Free the returned list with g_slist_free(). 
 - 
remove()¶
- Returns: - Trueif successful,- Falseif a file error occurred- Return type: - bool- Remove the cache from disk. 
 - 
remove_object(key)¶
- Parameters: - key ( - str) – the hash key of the object to remove- Returns: - Trueif successful,- Falseif key was not found- Return type: - bool- Removes the object corresponding to key from self. If no such object exists in self, the function returns - False.
 - 
replace_object(key, new_value)¶
- Parameters: - Returns: - Return type: - Replaces the object corresponding to key with new_value. If no such object exists in self, the function returns - False.
 - 
thaw_changes()¶
- Reverts the affects of - EBackend.FileCache.freeze_changes(). Each change to self is once again written to disk.
 
- 
classmethod