Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, guake):
"""Constructor of GConfHandler, just add the guake dir to the
gconf client and bind the keys to its handler methods.
"""
self.guake = guake
client = gconf.client_get_default()
client.add_dir(GCONF_PATH, gconf.CLIENT_PRELOAD_RECURSIVE)
notify_add = client.notify_add
# these keys does not need to be watched.
# notify_add(KEY('/general/default_shell'), self.shell_changed)
# notify_add(KEY('/general/use_login_shell'), self.login_shell_toggled)
# notify_add(KEY('/general/use_popup'), self.popup_toggled)
# notify_add(KEY('/general/window_losefocus'), self.losefocus_toggled)
# notify_add(KEY('/general/use_vte_titles'), self.use_vte_titles_changed)
# notify_add(KEY('/general/quick_open_enable'), self.on_quick_open_enable_changed)
# notify_add(KEY('/general/quick_open_in_current_terminal'),
# self.on_quick_open_in_current_terminal_changed)
# Notification is not required for mouse_display/display_n because
# set_final_window_rect polls gconf and is called whenever Guake is
# shown or resized
def __init__ (self, term, settings = {}):
self.defaults['link_user'] = self.defaults['_link_user']%(self.defaults['link_userchars'], self.defaults['link_passchars'])
# Set up any overridden settings
for key in settings.keys ():
defaults[key] = settings[key]
self.term = term
self.profile = self.defaults['profile_dir'] + self.defaults['profile']
self.gconf_client = gconf.client_get_default ()
self.gconf_client.add_dir (self.profile, gconf.CLIENT_PRELOAD_RECURSIVE)
self.gconf_client.add_dir ('/apps/metacity/general', gconf.CLIENT_PRELOAD_RECURSIVE)
self.clipboard = gtk.clipboard_get (gtk.gdk.SELECTION_CLIPBOARD)
self._vte = vte.Terminal ()
self._vte.set_size (5, 5)
self.reconfigure_vte ()
self._vte.show ()
self._box = gtk.HBox ()
self._scrollbar = gtk.VScrollbar (self._vte.get_adjustment ())
if self.defaults['scrollbar']:
self._scrollbar.show ()
self._box.pack_start (self._vte)
self._box.pack_start (self._scrollbar, False)
def __init__ (self, term, settings = {}):
self.defaults['link_user'] = self.defaults['_link_user']%(self.defaults['link_userchars'], self.defaults['link_passchars'])
# Set up any overridden settings
for key in settings.keys ():
defaults[key] = settings[key]
self.term = term
self.profile = self.defaults['profile_dir'] + self.defaults['profile']
self.gconf_client = gconf.client_get_default ()
self.gconf_client.add_dir (self.profile, gconf.CLIENT_PRELOAD_RECURSIVE)
self.gconf_client.add_dir ('/apps/metacity/general', gconf.CLIENT_PRELOAD_RECURSIVE)
self.clipboard = gtk.clipboard_get (gtk.gdk.SELECTION_CLIPBOARD)
self._vte = vte.Terminal ()
self._vte.set_size (5, 5)
self.reconfigure_vte ()
self._vte.show ()
self._box = gtk.HBox ()
self._scrollbar = gtk.VScrollbar (self._vte.get_adjustment ())
if self.defaults['scrollbar']:
self._scrollbar.show ()
self._box.pack_start (self._vte)
self._box.pack_start (self._scrollbar, False)
def __init__(self):
self._parse_username()
try:
self._gconf_client = GConf.Client.get_default()
self._gconf_client.add_dir(GCONF_DIR, GConf.ClientPreloadType.PRELOAD_RECURSIVE)
except Exception as e:
self._gconf_client = gconf.client_get_default()
self._gconf_client.add_dir(GCONF_DIR, gconf.CLIENT_PRELOAD_RECURSIVE)
self._init_config()
def get_wallcolor(width, height):
import gconf
client = gconf.client_get_default()
client.add_dir("/desktop/gnome/background", gconf.CLIENT_PRELOAD_RECURSIVE)
value = client.get("/desktop/gnome/background/primary_color")
color = value.get_string()
pbuf = gtk.gdk.Pixbuf(0, 1, 8, width, height)
c = gtk.gdk.color_parse(color)
fillr = (c.red / 256) << 24
fillg = (c.green / 256) << 16
fillb = (c.blue / 256) << 8
fillcolor = fillr | fillg | fillb | 255
pbuf.fill(fillcolor)
return pbuf