コード例 #1
0
    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
コード例 #2
0
 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()
コード例 #3
0
ファイル: search.py プロジェクト: FilipeTorresBR/Gnome-Menu
def launch(path):
    fileObj = Gio.File.new_for_path(path)
    Gio.app_info_launch_default_for_uri(fileObj.get_uri(), Gio.AppLaunchContext())