コード例 #1
0
    def remove(self, from_library=False, from_disk=False):
        """Uninstall a game

        Params:
            from_library (bool): Completely remove the game from library, do
                                 not set it as uninstalled
            from_disk (bool): Delete the game files

        Return:
            bool: Updated value for from_library
        """
        if from_disk and self.runner:
            logger.debug("Removing game %s from disk", self.id)
            self.runner.remove_game_data(game_path=self.directory)

        # Do not keep multiple copies of the same game
        existing_games = pga.get_games_where(slug=self.slug)
        if len(existing_games) > 1:
            from_library = True

        if from_library:
            logger.debug("Removing game %s from library", self.id)
            pga.delete_game(self.id)
        else:
            pga.set_uninstalled(self.id)
        if self.config:
            self.config.remove()
        xdgshortcuts.remove_launcher(self.slug,
                                     self.id,
                                     desktop=True,
                                     menu=True)
        self.is_installed = False
        self.emit("game-removed")
        return from_library
コード例 #2
0
    def remove(self, delete_files=False):
        """Uninstall a game

        Params:
            delete_files (bool): Delete the game files
        """
        if delete_files and self.runner:
            self.runner.remove_game_data(game_path=self.directory)
        games_db.set_uninstalled(self.id)
        if self.config:
            self.config.remove()
        xdgshortcuts.remove_launcher(self.slug, self.id, desktop=True, menu=True)
        self.is_installed = False
        self.emit("game-removed")
コード例 #3
0
ファイル: game.py プロジェクト: mathieui/lutris
    def remove(self, delete_files=False):
        """Uninstall a game

        Params:
            delete_files (bool): Delete the game files
        """
        sql.db_update(settings.PGA_DB, "games", {"installed": 0, "runner": ""}, {"id": self.id})
        if self.config:
            self.config.remove()
        xdgshortcuts.remove_launcher(self.slug, self.id, desktop=True, menu=True)
        if delete_files and self.runner:
            self.runner.remove_game_data(game_path=self.directory)
        self.is_installed = False
        self.runner = None
        self.emit("game-removed")
コード例 #4
0
    def remove(self, from_library=False, from_disk=False):
        if from_disk and self.runner:
            logger.debug("Removing game %s from disk", self.id)
            self.runner.remove_game_data(game_path=self.directory)

        # Do not keep multiple copies of the same game
        existing_games = pga.get_games_where(slug=self.slug)
        if len(existing_games) > 1:
            from_library = True

        if from_library:
            logger.debug("Removing game %s from library", self.id)
            pga.delete_game(self.id)
        else:
            pga.set_uninstalled(self.id)
        self.config.remove()
        xdgshortcuts.remove_launcher(self.slug, self.id, desktop=True, menu=True)
        return from_library
コード例 #5
0
    def remove(self, from_library=False, from_disk=False):
        if from_disk and self.runner:
            logger.debug("Removing game %s from disk", self.id)
            self.runner.remove_game_data(game_path=self.directory)

        # Do not keep multiple copies of the same game
        existing_games = pga.get_games_where(slug=self.slug)
        if len(existing_games) > 1:
            from_library = True

        if from_library:
            logger.debug("Removing game %s from library", self.id)
            pga.delete_game(self.id)
        else:
            pga.set_uninstalled(self.id)
        if self.config:
            self.config.remove()
        xdgshortcuts.remove_launcher(self.slug, self.id, desktop=True, menu=True)
        self.is_installed = False
        self.emit("game-removed")
        return from_library
コード例 #6
0
 def on_remove_desktop_shortcut(self, *_args):
     """Remove a .desktop shortcut"""
     xdgshortcuts.remove_launcher(self.game.slug, self.game.id, desktop=True)
コード例 #7
0
 def on_remove_menu_shortcut(self, *_args):
     """Remove an XDG menu shortcut"""
     xdgshortcuts.remove_launcher(self.game.slug, self.game.id, menu=True)
コード例 #8
0
 def on_remove_desktop_shortcut(self, *_args):
     """Remove a .desktop shortcut"""
     xdgshortcuts.remove_launcher(self.game.slug, self.game.id, desktop=True)
コード例 #9
0
 def on_remove_menu_shortcut(self, *_args):
     """Remove an XDG menu shortcut"""
     xdgshortcuts.remove_launcher(self.game.slug, self.game.id, menu=True)
コード例 #10
0
 def remove_desktop_shortcut(self, *_args):
     """Remove a .desktop shortcut"""
     game = Game(self.view.selected_game)
     xdgshortcuts.remove_launcher(game.slug, game.id, desktop=True)
コード例 #11
0
 def remove_menu_shortcut(self, *_args):
     """Remove an XDG menu shortcut"""
     game = Game(self.view.selected_game)
     xdgshortcuts.remove_launcher(game.slug, game.id, menu=True)