def launch_app(self, label, uri): try: ditem = Gio.DesktopAppInfo.new(uri) ctx = Gio.AppLaunchContext() ditem.launch([], ctx) except Exception as err: print('Warning: could not execute file "%s" : %s' % (uri, err)) return True
def create_app(self, url, name): manager = FogAppManager() try: app = manager.create(name, url, self.icon, self.themed_icon) except BaseFogAppException: logger.error("Error creating App %s" % url) else: app = Gio.DesktopAppInfo.new_from_filename(app.desktop_file) app.launch([], Gio.AppLaunchContext()) self.destroy()
def launch(path): fileObj = Gio.File.new_for_path(path) Gio.app_info_launch_default_for_uri(fileObj.get_uri(), Gio.AppLaunchContext())