Compile gio settings schema in python



I am using Gio Schemas in my python code and I already use Debian packaging which can compile it in post-install script.

Now I want to migrate to Pypi as my main distribution system, but I don't know how can I do that platform-independently there.

If you are interested, here is my current code:

> def set_schema():
> global dconf
> schema = 'org.tractor'
> schemas = Gio.SettingsSchemaSource.get_default()
> if Gio.SettingsSchemaSource.lookup(schemas, schema, False):
> dconf = Gio.Settings.new(schema)
> else:
> print('''
> Please compile the "tractor.gschema.xml" file.
> In GNU/Linux you can copy it to "/usr/share/glib-2.0/schemas/"
> and run "sudo glib-compile-schemas /usr/share/glib-2.0/schemas/".
> The file is located at {}.
> '''.format(os.path.dirname(os.path.abspath(file))))
> sys.exit(1)

gitlab: https://gitlab.com/tractor-team/tractor/-/tree/module-test
ارسال از دستگاه اندرویدم با K-9. لطفاً کوتاهی متن را ببخشید

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]