예제 #1
0
def _set_pref(key, setter_name, value):
    gconf_lock.acquire()
    try:
        client = gconf.client_get_default()
        fullkey = gconf_key(key)
        setter = getattr(client, setter_name)
        setter(fullkey, value)
    finally:
        gconf_lock.release()
예제 #2
0
def _set_pref(key, setter_name, value):
    gconf_lock.acquire()
    try:
        client = gconf.client_get_default()
        fullkey = gconf_key(key)
        setter = getattr(client, setter_name)
        setter(fullkey, value)
    finally:
        gconf_lock.release()
예제 #3
0
def _get_pref(key, getter_name):
    gconf_lock.acquire()
    try:
        client = gconf.client_get_default()
        fullkey = gconf_key(key)
        value = client.get(fullkey)
        if value is not None:
            getter = getattr(value, getter_name)
            return getter()
        else:
            return None
    finally:
        gconf_lock.release()
예제 #4
0
def _get_pref(key, getter_name):
    gconf_lock.acquire()
    try:
        client = gconf.client_get_default()
        fullkey = gconf_key(key)
        value = client.get(fullkey)
        if value is not None:
            getter = getattr(value, getter_name)
            return getter()
        else:
            return None
    finally:
        gconf_lock.release()