Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _remove_conf(self, key):
client=gconf.client_get_default()
if key==None:
add='/apps/rhythmbox/plugins/%s' % __name__
else:
add=KEYS['a'] + str(key)
client.recursive_unset(add, gconf.UNSET_INCLUDING_SCHEMA_NAMES)
client.remove_dir(add)
if key==None:
for i in range(100):
client.remove_dir(add)
def delete_macro(self, memory, keys):
key_list_key = get_keys_key(keys)
key_dir = self.profile_dir + "/keys/m" + str(memory) + "/" + key_list_key
conf_client.recursive_unset(key_dir, gconf.UNSET_INCLUDING_SCHEMA_NAMES)
key_list = list(conf_client.get_list(self.profile_dir + "/key_list_str_" + str(memory), gconf.VALUE_STRING))
if key_list_key in key_list:
key_list.remove(key_list_key);
conf_client.set_list(self.profile_dir + "/key_list_str_" + str(memory), gconf.VALUE_STRING, key_list)
def remove(self):
"""Removes the profile"""
from gconf import UNSET_INCLUDING_SCHEMA_NAMES
self.helper.client.recursive_unset(self.gpath,
UNSET_INCLUDING_SCHEMA_NAMES)
# emit Removed and unexport from DBus
self.Removed()
self.remove_from_connection()
for d in dir_list:
dir_list.extend(self.client.all_dirs(d))
for d in dir_list:
entries = self.client.all_entries(d)
for en in entries:
key = en.get_key()
new_key = self.new + key[len(self.old):]
value = en.get_value()
if value:
self.client.set(new_key, value)
# We remove old directory.
self.client.recursive_unset(self.old,
gconf.UNSET_INCLUDING_SCHEMA_NAMES)