mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-03-21 18:50:38 +03:00
glib_map function to convert Python data to GLib (GSettings) type system
This commit is contained in:
parent
63e7dab1ee
commit
ace949d4ec
@ -46,6 +46,16 @@ class system_gsetting:
|
||||
with open(self.file_path, 'w') as f:
|
||||
config.write(f)
|
||||
|
||||
def glib_map(value, glib_type):
|
||||
result_value = value
|
||||
|
||||
if glib_type == 'i':
|
||||
result_value = GLib.Variant(glib_type, int(value))
|
||||
else:
|
||||
result_value = GLib.Variant(glib_type, value)
|
||||
|
||||
return result_value
|
||||
|
||||
class user_gsetting:
|
||||
def __init__(self, schema, path, value):
|
||||
self.schema = schema
|
||||
|
Loading…
x
Reference in New Issue
Block a user