How to use the gconf.VALUE_BOOL function in gconf

To help you get started, we’ve selected a few gconf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cemmanouilidis / naturalscrolling / naturalscrolling_lib / gconfsettings.py View on Github external
def python_type_to_gconf_type(self, type):
        """
        Convert a Python type (bool, int, str, ...) to GConf type
        """
        if type == bool:
            return gconf.VALUE_BOOL
        elif type == str:
            return gconf.VALUE_STRING
        elif type == int:
            return gconf.VALUE_INT
github ivyl / gedit-mate / legacy-plugins / gotofile / __init__.py View on Github external
def getShowHidden(self):
		return self._readSetting('show_hidden', gconf.VALUE_BOOL, False)
github pculture / miro / tv / linux / plat / config.py View on Github external
client.set_bool(fullkey, value)
            elif isinstance(value, int):
                client.set_int(fullkey, value)
            elif isinstance(value, float):
                client.set_float(fullkey, value)
            elif isinstance(value, list):
                # this is lame, but there isn't enough information to
                # figure it out another way
                if len(value) == 0 or isinstance(value[0], str):
                    list_type = gconf.VALUE_STRING
                elif isinstance(value[0], int):
                    list_type = gconf.VALUE_INT
                elif isinstance(value[0], float):
                    list_type = gconf.VALUE_FLOAT
                elif isinstance(value[0], bool):
                    list_type = gconf.VALUE_BOOL
                else:
                    raise TypeError("unknown gconf type %s" % type(value[0]))

                client.set_list(fullkey, list_type, value)
            else:
                raise TypeError()
        finally:
            gconf_lock.release()
github gmate / gmate / plugins / gotofile / __init__.py View on Github external
def _writeSetting(self, name, gconfType, value):
		base = '/apps/gedit-2/plugins/gotofile/'
		if gconfType == gconf.VALUE_STRING:
			self._gconf.set_string(base + name, value)
		elif gconfType == gconf.VALUE_INT:
			self._gconf.set_int(base + name, value)			
		elif gconfType == gconf.VALUE_BOOL:
			self._gconf.set_bool(base + name, value)
		else:
			raise "Not supported"
github pculture / miro / tv / linux / plat / config.py View on Github external
client.set_bool(fullkey, value)
            elif isinstance(value, int):
                client.set_int(fullkey, value)
            elif isinstance(value, float):
                client.set_float(fullkey, value)
            elif isinstance(value, list):
                # this is lame, but there isn't enough information to
                # figure it out another way
                if len(value) == 0 or isinstance(value[0], str):
                    list_type = gconf.VALUE_STRING
                elif isinstance(value[0], int):
                    list_type = gconf.VALUE_INT
                elif isinstance(value[0], float):
                    list_type = gconf.VALUE_FLOAT
                elif isinstance(value[0], bool):
                    list_type = gconf.VALUE_BOOL
                else:
                    raise TypeError("unknown gconf type %s" % type(value[0]))

                client.set_list(fullkey, list_type, value)
            else:
                raise TypeError()
        finally:
            gconf_lock.release()
github pychess / pychess / lib / pychess / System / conf_gconf.py View on Github external
def get (key):
    key = normpath(GDIR+key)
    value = c.get(key)
    if value.type == gconf.VALUE_BOOL:
        return value.get_bool()
    if value.type == gconf.VALUE_FLOAT:
        return value.get_float()
    if value.type == gconf.VALUE_INT:
        return value.get_int()
    if value.type == gconf.VALUE_STRING:
        return value.get_string()
github codebutler / gedit-gotofile-plugin / gotofile / __init__.py View on Github external
def _writeSetting(self, name, gconfType, value):
		base = '/apps/gedit-2/plugins/gotofile/'
		if gconfType == gconf.VALUE_STRING:
			self._gconf.set_string(base + name, value)
		elif gconfType == gconf.VALUE_INT:
			self._gconf.set_int(base + name, value)			
		elif gconfType == gconf.VALUE_BOOL:
			self._gconf.set_bool(base + name, value)
		else:
			raise "Not supported"
github tualatrix / ubuntu-tweak / debain / usr / share / ubuntu-tweak / compizpage.py View on Github external
value = client.get(data)

			if value.type == gconf.VALUE_INT:
				client.set_int(data, 1)
				client.set_string("/apps/compiz/plugins/wobbly/screen0/options/map_window_match","Splash | DropdownMenu | PopupMenu | Tooltip | Notification | Combo | Dnd | Unknown")
			elif value.type == gconf.VALUE_BOOL:
				client.set_bool(data, True)
			elif value.type == gconf.VALUE_STRING:
				client.set_string(data, "Toolbar | Menu | Utility | Dialog | Normal | Unknown")
		else:
			self.__set_active("wobbly", False)
			value = client.get(data)

			if value.type == gconf.VALUE_INT:
				client.set_int(data, 0)
			elif value.type == gconf.VALUE_BOOL:
				client.set_bool(data, False)
			elif value.type == gconf.VALUE_STRING:
				client.set_string(data, "")
github andrewbird / wader / wader / common / _gconf.py View on Github external
def get_value(self, value):
        """Gets the value of ``value``"""
        if value.type == gconf.VALUE_STRING:
            return value.get_string()
        elif value.type == gconf.VALUE_INT:
            return value.get_int()
        elif value.type == gconf.VALUE_FLOAT:
            return value.get_float()
        elif value.type == gconf.VALUE_BOOL:
            return value.get_bool()
        elif value.type == gconf.VALUE_LIST:
            _list = value.get_list()
            return [self.get_value(v) for v in _list]
        else:
            msg = "Unsupported type %s for %s"
            raise TypeError(msg % (type(value), value))
github GNOME / gedit-plugins / plugins / drawspaces / drawspaces.py View on Github external
def gconf_get_bool(key, default = False):
    val = gconf.client_get_default().get(key)
    if val is not None and val.type == gconf.VALUE_BOOL:
        return val.get_bool()
    else:
        return default