Ejemplo n.º 1
0
 def get_update_installers(self, db_game):
     appid = db_game["service_id"]
     patch_versions = self.get_update_versions(appid)
     patch_installers = []
     for version in patch_versions:
         patch = patch_versions[version]
         size = human_size(sum([part["total_size"] for part in patch]))
         patch_id = "gogpatch-%s" % slugify(patch[0]["version"])
         installer = {
             "name": db_game["name"],
             "description": patch[0]["name"] + " " + size,
             "slug": db_game["installer_slug"],
             "game_slug": db_game["slug"],
             "version": "GOG " + patch[0]["version"],
             "runner": "wine",
             "script": {
                 "extends":
                 db_game["installer_slug"],
                 "files": [{
                     patch_id: "N/A:Select the patch from GOG"
                 }],
                 "installer": [{
                     "task": {
                         "name": "wineexec",
                         "executable": patch_id
                     }
                 }]
             }
         }
         patch_installers.append(installer)
     return patch_installers
Ejemplo n.º 2
0
 def folder_size_cb(self, folder_size, error):
     if error:
         logger.error(error)
         return
     self.delete_files = True
     self.delete_button.set_sensitive(True)
     self.folder_label.set_markup(
         "This will delete all contents from <b>%s</b> (%s)" %
         (reverse_expanduser(self.game.directory), human_size(folder_size)))
Ejemplo n.º 3
0
 def get_extra_label(self, extra):
     """Return a label for the extras picker"""
     label = extra["name"]
     _infos = []
     if extra.get("total_size"):
         _infos.append(human_size(extra["total_size"]))
     if extra.get("type"):
         _infos.append(extra["type"])
     if _infos:
         label += " (%s)" % ", ".join(_infos)
     return label
Ejemplo n.º 4
0
 def folder_size_cb(self, folder_size, error):
     if error:
         logger.error(error)
         return
     self.delete_files = True
     self.delete_button.set_sensitive(True)
     self.folder_label.hide()
     self.confirm_delete_button.show()
     self.confirm_delete_button.set_label(
         "Delete %s (%s)" %
         (reverse_expanduser(self.game.directory), human_size(folder_size)))