Package easygconf :: Module gconfdict :: Class GConfDict
[hide private]
[frames] | no frames]

Class GConfDict

source code

object --+
         |
        GConfDict

A dict-like interface to GConf
Instance Methods [hide private]
 
__init__(self, dir=None)
Arguments:
source code
 
normalize_key(self, key)
Expands relativ keys if needed
source code
 
normalize_dir(self, dir)
Expands relativ dirs if needed
source code
 
get(self, key)
Returns the value for key
source code
 
set(self, key, value)
Set value for key to value
source code
 
unset(self, key)
Unset key
source code
 
sync(self)
Suggests to gconfd that you've just finished a block of changes, and it would be an optimal time to sync to permanent storage.
source code
 
add_listener(self, key, func, *args)
Request notification of changes to key
source code
 
remove_listener(self, id)
Remove a notification using the ID returned from add_listener()
source code
 
has_key(self, key)
True if key is defined and not a dir
source code
 
to_python(self, gcvalue)
Convert a gconf value to a python value Arguments: - gcvalue: a gconf value
source code
 
from_python(self, value)
Convert a Python value to a gconf value
source code
 
iterkeys(self)
return an iterator over the keys
source code
 
keys(self)
return a list of all keys
source code
 
itervalues(self)
return an iterator over the values
source code
 
values(self)
return a list of all values
source code
 
iteritems(self)
return an iterator over (key, value) pairs
source code
 
iterdirs(self)
return an iterator over the subdirs
source code
 
dirs(self)
return a list of all subdirs
source code
 
children(self)
return a list of all sudbirs and keys
source code
 
__getitem__(x, y)
x[y]
source code
 
__setitem__(x, i, y)
x[i]=y
source code
 
__iter__(x)
iter(x)
source code
 
__delitem__(x, y)
del x[y]
source code
 
__len__(x)
len(x)
source code
 
__contains__(x, y)
y in x
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, dir=None)
(Constructor)

source code 

Arguments:

  • dir: The base dir for this GConfDict.

    Any key not starting with '/' is realtiv to this.

Overrides: object.__init__

sync(self)

source code 
Suggests to gconfd that you've just finished a block of changes, and it would be an optimal time to sync to permanent storage. This is only a suggestion; and gconfd will eventually sync even if you don't call sync(). This function is just a "hint" provided to gconfd to maximize efficiency and minimize data loss.

add_listener(self, key, func, *args)

source code 

Request notification of changes to key

  • func: function to call when changes occur.

    It's called as func(key, value, gconfdict, id, args)

  • args: user data to pass to func

The function returns a connection ID you can use to call remove_listener()

remove_listener(self, id)

source code 

Remove a notification using the ID returned from add_listener()

  • id: connection ID returned from add_listener()