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
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")
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")
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
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
def on_remove_desktop_shortcut(self, *_args): """Remove a .desktop shortcut""" xdgshortcuts.remove_launcher(self.game.slug, self.game.id, desktop=True)
def on_remove_menu_shortcut(self, *_args): """Remove an XDG menu shortcut""" xdgshortcuts.remove_launcher(self.game.slug, self.game.id, menu=True)
def on_remove_desktop_shortcut(self, *_args): """Remove a .desktop shortcut""" xdgshortcuts.remove_launcher(self.game.slug, self.game.id, desktop=True)
def on_remove_menu_shortcut(self, *_args): """Remove an XDG menu shortcut""" xdgshortcuts.remove_launcher(self.game.slug, self.game.id, menu=True)
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)
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)