mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-03-28 14:50:14 +03:00
Gsettings applier updated to include somehow working userspace code
This commit is contained in:
parent
dd097313a8
commit
fb706c4c5c
@ -4,13 +4,21 @@ class system_gsetting:
|
||||
def __init__(self, schema, path, value):
|
||||
self.schema = schema
|
||||
self.path = path
|
||||
self.value = GLib.Variant('as', value)
|
||||
self.value = value
|
||||
|
||||
def apply(self):
|
||||
variants = gso.get_property(self.path)
|
||||
if (variants.has_key(self.path)):
|
||||
key = variants.get_key(self.path)
|
||||
print(key.get_range())
|
||||
pass
|
||||
#source = Gio.SettingsSchemaSource.get_default()
|
||||
#schema = source.lookup(self.schema, True)
|
||||
#key = schema.get_key(self.path)
|
||||
#gvformat = key.get_value_type()
|
||||
#val = GLib.Variant(gvformat.dup_string(), self.value)
|
||||
#schema.set_value(self.path, val)
|
||||
|
||||
#variants = gso.get_property(self.path)
|
||||
#if (variants.has_key(self.path)):
|
||||
# key = variants.get_key(self.path)
|
||||
# print(key.get_range())
|
||||
|
||||
class user_gsetting:
|
||||
def __init__(self, schema, path, value):
|
||||
@ -19,9 +27,15 @@ class user_gsetting:
|
||||
self.value = value
|
||||
|
||||
def apply(self):
|
||||
gso = Gio.Settings.new(seVlf.schema)
|
||||
variants = gso.get_property(self.path)
|
||||
if (variants.has_key(self.path)):
|
||||
key = variants.get_key(self.path)
|
||||
print(key.get_range())
|
||||
source = Gio.SettingsSchemaSource.get_default()
|
||||
schema = source.lookup(self.schema, True)
|
||||
key = schema.get_key(self.path)
|
||||
gvformat = key.get_value_type()
|
||||
val = GLib.Variant(gvformat.dup_string(), self.value)
|
||||
schema.set_value(self.path, val)
|
||||
#gso = Gio.Settings.new(self.schema)
|
||||
#variants = gso.get_property(self.path)
|
||||
#if (variants.has_key(self.path)):
|
||||
# key = variants.get_key(self.path)
|
||||
# print(key.get_range())
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user