Mercurial > sat_docs
view flatpak/sat_wrapper.py @ 161:4fe61dcd856e
flatpak: update build-manifest to retrieve dependencies without initial download phase:
- dependencies are now entirely retrieved from the installation, and requirement are build
from there. The source package is currently always used, and it is now possible to use
PYTHON_DEP_PREINSTALL to add extra packages or use a specific version of a package.
- fixed insertion of `release_elt` for dev version at the right location.
- `branch` is not set anymore for stable versions.
- libxslt is not added anymore as it is part of freedesktop runtime
- flathub share-modules is now used for Python 2
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 23 Aug 2019 16:41:05 +0200 |
parents | 2602c690806b |
children |
line wrap: on
line source
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """This script launch SàT backend if it's not before running command""" import os import sys import dbus import subprocess command = "##COMMAND##" const_INT_PREFIX = "org.salutatoi.SAT" const_OBJ_PATH = '/org/salutatoi/SAT/bridge' # we remove any path with "/home" from PYTHONPATH because we have # "--filesystem=home" permission and packages in .local/lib/python2.7/site-packages may # conflict with the ones from flatpak clean_pythonpath = ':'.join(p for p in sys.path if p and not p.startswith('/home')) os.environ['PYTHONPATH'] = clean_pythonpath os.environ['PYTHONNOUSERSITE'] = '1' try: sessions_bus = dbus.SessionBus() db_object = sessions_bus.get_object(const_INT_PREFIX, const_OBJ_PATH) except dbus.exceptions.DBusException as e: if e._dbus_error_name != 'org.freedesktop.DBus.Error.ServiceUnknown': raise e # backend not found, we need to launch it print("Launching SàT backend") subprocess.check_call("sat") os.execlp(command, command, *sys.argv[1:])